You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/learning-path/4/module-2.en.md
+35-30Lines changed: 35 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -376,35 +376,7 @@ B) Enhanced user experience\
376
376
C) Vulnerability to SQL injection attacks\
377
377
D) Improved data integrity
378
378
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" >}}
408
380
**Question 1 correct answer**: C) Vulnerability to SQL injection attacks
409
381
410
382
Explanation:
@@ -413,8 +385,18 @@ A) Incorrect. Failing to implement proper data validation typically does not lea
413
385
B) Incorrect. While proper data validation contributes to a better user experience by preventing errors, its absence does not enhance user experience.\
414
386
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.\
415
387
D) Incorrect. Data validation helps maintain data integrity, but its absence does not improve data integrity*.
416
-
*
388
+
{{< /question >}}
417
389
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" >}}
418
400
**Question 2 Correct Answer**: B) Escaping user input before displaying it
419
401
420
402
Explanation:
@@ -423,7 +405,18 @@ A) Incorrect. Using plaintext for storing sensitive data does not prevent XSS at
423
405
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.\
424
406
C) Incorrect. Storing user passwords in plaintext is a security risk and unrelated to preventing XSS attacks.\
425
407
D) Incorrect. Disabling HTTPS encryption exposes sensitive data to interception and does not prevent XSS attacks.
408
+
{{< /question >}}
409
+
410
+
**Question 3**
426
411
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" >}}
427
420
**Question 3 Correct Answer**: B) Employing input sanitization and parameterized queries
428
421
429
422
Explanation:
@@ -432,8 +425,20 @@ A) Incorrect. Using dynamic SQL queries without proper input validation and sani
432
425
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.\
433
426
C) Incorrect. Storing sensitive data in plain text increases the risk of data exposure but does not directly prevent SQL injection attacks.\
434
427
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.
435
438
439
+
{{< question title="Answer" >}}
436
440
**Question 4 Correct Answer**: D) All of the above.
0 commit comments