Skip to content

Commit 2dee8ec

Browse files
Merge pull request #16 from lukasz-a-krol/main
trying out a new system for hiding answers
2 parents 5e1f8e0 + 288d552 commit 2dee8ec

File tree

1 file changed

+35
-30
lines changed

1 file changed

+35
-30
lines changed

content/learning-path/4/module-2.en.md

Lines changed: 35 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -376,35 +376,7 @@ B) Enhanced user experience\
376376
C) Vulnerability to SQL injection attacks\
377377
D) Improved data integrity
378378

379-
**Question 2**
380-
381-
Which of the following is an effective mechanism for preventing cross-site scripting (XSS) attacks in web applications?
382-
383-
A) Using plaintext for storing sensitive data\
384-
B) Escaping user input before displaying it\
385-
C) Storing user passwords in plain text\
386-
D) Disabling HTTPS encryption
387-
388-
**Question 3**
389-
390-
Which technique is effective in preventing SQL injection attacks in web applications?
391-
392-
A) Using dynamic SQL queries\
393-
B) Employing input sanitization and parameterized queries\
394-
C) Storing sensitive data in plain text\
395-
D) Disabling error messages
396-
397-
**Question 4**
398-
399-
Which of the following statements best explains how proper data validation helps prevent command injection attacks in web application security?
400-
401-
A) Data validation restricts the input to predefined characters and patterns, thereby minimizing the likelihood of malicious commands being injected into the application.\
402-
B) Proper validation techniques, such as input sanitization and parameterized queries, help neutralize malicious commands embedded in user inputs, thereby mitigating command injection vulnerabilities.\
403-
C) Implementing validation methods like input length checks and whitelisting of acceptable characters reduces the attack surface and prevents execution of unauthorized commands within the web application.\
404-
D) All of the above.
405-
406-
### Answer key
407-
379+
{{< question title="Answer and explanation" >}}
408380
**Question 1 correct answer**: C) Vulnerability to SQL injection attacks
409381

410382
Explanation:
@@ -413,8 +385,18 @@ A) Incorrect. Failing to implement proper data validation typically does not lea
413385
B) Incorrect. While proper data validation contributes to a better user experience by preventing errors, its absence does not enhance user experience.\
414386
C) Correct. Without proper data validation, web applications are vulnerable to SQL injection attacks, where attackers can manipulate database queries by injecting malicious SQL code.\
415387
D) Incorrect. Data validation helps maintain data integrity, but its absence does not improve data integrity*.
416-
*
388+
{{< /question >}}
417389

390+
**Question 2**
391+
392+
Which of the following is an effective mechanism for preventing cross-site scripting (XSS) attacks in web applications?
393+
394+
A) Using plaintext for storing sensitive data\
395+
B) Escaping user input before displaying it\
396+
C) Storing user passwords in plain text\
397+
D) Disabling HTTPS encryption
398+
399+
{{< question title="Answer and explanation" >}}
418400
**Question 2 Correct Answer**: B) Escaping user input before displaying it
419401

420402
Explanation:
@@ -423,7 +405,18 @@ A) Incorrect. Using plaintext for storing sensitive data does not prevent XSS at
423405
B) Correct. Escaping user input before displaying it helps mitigate XSS attacks by rendering any potentially malicious scripts harmless, thereby preventing them from executing in users' browsers.\
424406
C) Incorrect. Storing user passwords in plaintext is a security risk and unrelated to preventing XSS attacks.\
425407
D) Incorrect. Disabling HTTPS encryption exposes sensitive data to interception and does not prevent XSS attacks.
408+
{{< /question >}}
409+
410+
**Question 3**
426411

412+
Which technique is effective in preventing SQL injection attacks in web applications?
413+
414+
A) Using dynamic SQL queries\
415+
B) Employing input sanitization and parameterized queries\
416+
C) Storing sensitive data in plain text\
417+
D) Disabling error messages
418+
419+
{{< question title="Answer and explanation" >}}
427420
**Question 3 Correct Answer**: B) Employing input sanitization and parameterized queries
428421

429422
Explanation:
@@ -432,8 +425,20 @@ A) Incorrect. Using dynamic SQL queries without proper input validation and sani
432425
B) Correct. Employing input sanitization and parameterized queries helps prevent SQL injection attacks by ensuring that user input is treated as data rather than executable code, thus neutralizing malicious SQL injection attempts.\
433426
C) Incorrect. Storing sensitive data in plain text increases the risk of data exposure but does not directly prevent SQL injection attacks.\
434427
D) Incorrect. Disabling error messages may hide potential vulnerabilities from attackers but does not address the root cause of SQL injection vulnerabilities.
428+
{{< /question >}}
429+
430+
**Question 4**
431+
432+
Which of the following statements best explains how proper data validation helps prevent command injection attacks in web application security?
433+
434+
A) Data validation restricts the input to predefined characters and patterns, thereby minimizing the likelihood of malicious commands being injected into the application.\
435+
B) Proper validation techniques, such as input sanitization and parameterized queries, help neutralize malicious commands embedded in user inputs, thereby mitigating command injection vulnerabilities.\
436+
C) Implementing validation methods like input length checks and whitelisting of acceptable characters reduces the attack surface and prevents execution of unauthorized commands within the web application.\
437+
D) All of the above.
435438

439+
{{< question title="Answer" >}}
436440
**Question 4 Correct Answer**: D) All of the above.
441+
{{< /question >}}
437442

438443
## Learning Resources
439444

0 commit comments

Comments
 (0)