Skip to content

Commit 4b01a61

Browse files
Merge pull request #17 from lukasz-a-krol/main
hiding answers
2 parents 2dee8ec + 4965906 commit 4b01a61

File tree

3 files changed

+91
-26
lines changed

3 files changed

+91
-26
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ Explanation:
384384
A) Incorrect. Failing to implement proper data validation typically does not lead to increased server performance.\
385385
B) Incorrect. While proper data validation contributes to a better user experience by preventing errors, its absence does not enhance user experience.\
386386
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.\
387-
D) Incorrect. Data validation helps maintain data integrity, but its absence does not improve data integrity*.
387+
D) Incorrect. Data validation helps maintain data integrity, but its absence does not improve data integrity.
388388
{{< /question >}}
389389

390390
**Question 2**

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

Lines changed: 45 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -389,81 +389,114 @@ B) An exploit that grants unauthorized access to restricted parts of a web appli
389389
C) A weakness in the authentication mechanism of a web application, leading to compromised user credentials.\
390390
D) A security flaw that enables attackers to intercept communication between the client and server.
391391

392-
Question 2. What are the potential risks associated with broken authentication vulnerabilities?
392+
{{< question title="Answer" >}}
393+
1. B) A weakness in the authentication mechanism of a web application, leading to compromised user credentials.
394+
395+
**Question 2**. What are the potential risks associated with broken authentication vulnerabilities?
393396

394397
A) Unauthorized access to sensitive data and user accounts.\
395398
B) Exposure of session tokens, leading to session hijacking attacks.\
396399
C) Compromise of user credentials, including passwords and authentication tokens.\
397400
D) All of the above.
398401

402+
{{< question title="Answer" >}}
403+
2. D) All of the above.
404+
{{< /question >}}
405+
399406
**Question 3**. Which of the following is NOT an example of a mitigation mechanism for broken authentication vulnerabilities?
400407

401408
A) Implementing multi-factor authentication (MFA) for user accounts.\
402409
B) Enforcing strong password policies, including regular password rotation.\
403410
C) Disabling HTTPS to prevent interception of authentication credentials.\
404411
D) Implementing account lockout mechanisms to prevent brute force attacks.
405412

413+
{{< question title="Answer" >}}
414+
3. C) Disabling HTTPS to prevent interception of authentication credentials.
415+
{{< /question >}}
416+
406417
**Question 4**. Which type of flaw may lead to compromised authentication mechanisms by allowing attackers to guess or crack user passwords?
407418

408419
A) Session Fixation\
409420
B) Cross-Site Request Forgery (CSRF)\
410421
C) Insufficient Password Complexity\
411422
D) Cross-Site Scripting (XSS)
412423

424+
{{< question title="Answer" >}}
425+
4. C) Insufficient Password Complexity
426+
{{< /question >}}
427+
413428
**Question 5**. What is a specific example of a mitigation strategy for addressing the flaw of insufficient password complexity?
414429

415430
A) Implementing CAPTCHA challenges during the login process.\
416431
B) Enforcing password length and complexity requirements.\
417432
C) Encrypting authentication tokens to prevent interception.\
418433
D) Whitelisting trusted IP addresses for accessing the login page.
419434

435+
{{< question title="Answer" >}}
436+
5. B) Enforcing password length and complexity requirements.
437+
{{< /question >}}
438+
420439
**Question 6**. Which mitigation strategy aims to prevent attackers from exploiting session fixation vulnerabilities?
421440

422441
A) Implementing session timeout mechanisms.\
423442
B) Encrypting session cookies using HTTPS.\
424443
C) Regenerating session identifiers after successful authentication.\
425444
D) Enforcing strong password policies for user accounts.
426445

446+
{{< question title="Answer" >}}
447+
6. C) Regenerating session identifiers after successful authentication.
448+
{{< /question >}}
449+
427450
**Question 7**. What type of flaw may lead to compromised authentication mechanisms by allowing attackers to hijack active user sessions?
428451

429452
A) Insufficient Session Expiration\
430453
B) Insecure Token Storage\
431454
C) Cross-Site Scripting (XSS)\
432455
D) Cross-Site Request Forgery (CSRF)
433456

457+
{{< question title="Answer" >}}
458+
7. A) Insufficient Session Expiration
459+
{{< /question >}}
460+
434461
**Question 8**. Which mitigation strategy addresses the flaw of insecure token storage by securely managing authentication tokens?
435462

436463
A) Storing tokens in plaintext within client-side cookies.\
437464
B) Encrypting tokens using a symmetric encryption algorithm.\
438465
C) Implementing secure password hashing algorithms.\
439466
D) Using HTTP headers for transmitting authentication tokens.
440467

468+
{{< question title="Answer" >}}
469+
8. B) Encrypting tokens using a symmetric encryption algorithm.
470+
{{< /question >}}
471+
441472
**Question 9**. What is a specific example of a mitigation strategy for preventing session fixation attacks?
442473

443474
A) Rotating session identifiers after a successful login.\
444475
B) Implementing multi-factor authentication (MFA).\
445476
C) Using CAPTCHA challenges to verify user authenticity.\
446477
D) Enforcing strict input validation on the login form.
447478

479+
{{< question title="Answer" >}}
480+
9. A) Rotating session identifiers after a successful login.
481+
{{< /question >}}
482+
448483
**Question 10**. What type of flaw may lead to compromised authentication mechanisms by allowing attackers to forge requests to the web application while authenticated as another user?
449484

450485
A) Insufficient Session Expiration\
451486
B) Insufficient Transport Layer Protection\
452487
C) Cross-Site Scripting (XSS)\
453488
D) Cross-Site Request Forgery (CSRF)
454489

455-
#### Answer key
456-
457-
1. B) A weakness in the authentication mechanism of a web application, leading to compromised user credentials.
458-
2. D) All of the above.
459-
3. C) Disabling HTTPS to prevent interception of authentication credentials.
460-
4. C) Insufficient Password Complexity
461-
5. B) Enforcing password length and complexity requirements.
462-
6. C) Regenerating session identifiers after successful authentication.
463-
7. A) Insufficient Session Expiration
464-
8. B) Encrypting tokens using a symmetric encryption algorithm.
465-
9. A) Rotating session identifiers after a successful login.
490+
{{< question title="Answer" >}}
466491
10. D) Cross-Site Request Forgery (CSRF)
492+
{{< /question >}}
493+
494+
495+
496+
497+
498+
499+
467500

468501

469502
## Learning Resources

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

Lines changed: 45 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -90,81 +90,112 @@ B) Ensuring data integrity\
9090
C) Verifying user permissions\
9191
D) Encrypting sensitive information
9292

93+
{{< question title="Answer" >}}
94+
C) Verifying user permissions
95+
{{< /question >}}
96+
9397
**Question 2**. Which category of vulnerability involves developers failing to check if a user is logged in on certain pages?
9498

9599
A) Vertical Privilege Escalation\
96100
B) Horizontal Privilege Escalation\
97101
C) Missing Authentication\
98102
D) Forced Browsing
99103

104+
{{< question title="Answer" >}}
105+
C) Missing Authentication
106+
{{< /question >}}
107+
100108
**Question 3**. What is one common pattern of missing authentication vulnerability mentioned in the subtopic text?
101109

102110
A) Failing to check permissions on data-level actions\
103111
B) Passing user IDs in URL parameters\
104112
C) Allowing users to modify their own data\
105113
D) Showing different links based on user login status
106114

115+
{{< question title="Answer" >}}
116+
D) Showing different links based on user login status
117+
{{< /question >}}
118+
107119
**Question 4**. What is the result of vertical privilege escalation vulnerability?
108120

109121
A) Users can access unauthorized data\
110122
B) Less powerful users can perform powerful actions they were not authorized to do\
111123
C) Users can edit other users' data without permission\
112124
D) The entire site becomes vulnerable to attacks
113125

126+
{{< question title="Answer" >}}
127+
B) Less powerful users can perform powerful actions
128+
{{< /question >}}
129+
130+
114131
**Question 5**. In the context of horizontal privilege escalation, what is a common cause of vulnerability according to the subtopic text?
115132

116133
A) Lack of developer awareness\
117134
B) Inconsistent implementation of controls\
118135
C) Passing user IDs in URL parameters\
119136
D) Insufficient encryption protocols
120137

138+
{{< question title="Answer" >}}
139+
B) Inconsistent implementation of controls
140+
{{< /question >}}
141+
142+
121143
**Question 6**. How can developers prevent authorization vulnerabilities according to the subtopic text?
122144

123145
A) Use complex logic for authorization checks\
124146
B) Rely solely on framework support\
125147
C) Implement their own controls consistently\
126148
D) Ignore data-level permissions checks
127149

150+
{{< question title="Answer" >}}
151+
C) Implement their own controls consistently
152+
{{< /question >}}
153+
128154
**Question 7**. Which of the following is NOT a tip mentioned in the text for preventing authorization vulnerabilities?
129155

130156
A) Layer and simplify the process of checking user permissions\
131157
B) Use separate websites for regular users and administrators\
132158
C) Rely solely on framework functions for authorization\
133159
D) Establish consistent developer guidelines for data access
134160

161+
{{< question title="Answer" >}}
162+
C) Rely solely on framework functions for authorization
163+
{{< /question >}}
164+
135165
**Question 8**. What is the significance of consistency in implementing authorization controls?
136166

137167
A) It increases the complexity of the system\
138168
B) It reduces the likelihood of errors\
139169
C) It limits access to certain users\
140170
D) It makes authorization checks more difficult
141171

172+
{{< question title="Answer" >}}
173+
B) It reduces the likelihood of errors
174+
{{< /question >}}
175+
142176
**Question 9**. What is one example provided in the subtopic text for vertical privilege escalation vulnerability?
143177

144178
A) Modifying URL parameters to escalate privileges\
145179
B) Allowing users to view other users' data\
146180
C) Passing user IDs in hidden form fields\
147181
D) Regular users gaining access to administrative features
148182

183+
{{< question title="Answer" >}}
184+
D) Regular users gaining access to administrative features
185+
{{< /question >}}
186+
149187
**Question 10**. Which vulnerability category involves users performing actions on other users' data with the same access level?
150188

151189
A) Missing Authentication\
152190
B) Vertical Privilege Escalation\
153191
C) Horizontal Privilege Escalation\
154192
D) Forced Browsing\
155193

156-
#### Answer key
194+
{{< question title="Answer" >}}
195+
C) Horizontal Privilege Escalation
196+
{{< /question >}}
197+
157198

158-
Question 1: C) Verifying user permissions\
159-
Question 2: C) Missing Authentication\
160-
Question 3: D) Showing different links based on user login status\
161-
Question 4: B) Less powerful users can perform powerful actions\
162-
Question 5: B) Inconsistent implementation of controls\
163-
Question 6: C) Implement their own controls consistently\
164-
Question 7: C) Rely solely on framework functions for authorization\
165-
Question 8: B) It reduces the likelihood of errors\
166-
Question 9: D) Regular users gaining access to administrative features\
167-
Question 10: C) Horizontal Privilege Escalation
168199

169200
### Exercise 3 (optional, only for those comfortable with basic python): code bug finding challenge
170201

@@ -211,15 +242,16 @@ print(result)
211242

212243
**Find and fix the vulnerability in the `delete_profile` function.**
213244

214-
#### Answer key and explanation
215-
245+
{{< question title="Answer and explanation" >}}
216246
The vulnerability lies in the fact that the `delete_profile` function only checks for the current user's write permission but does not verify that the current user is authorized to delete other users' profiles. This allows any user with write permission to delete any other user's profile, regardless of their own permissions.
217247

218248
**To fix the vulnerability, you could:**
219249

220250
1. Check if the current user has the "delete" permission specifically.
221251
2. Implement role-based access control (RBAC) to restrict deletion based on user roles.
222252
3. Add additional checks to verify the legitimacy of the deletion request.
253+
{{< /question >}}
254+
223255

224256
## Learning Resources
225257

0 commit comments

Comments
 (0)