|
51 | 51 | }, |
52 | 52 | "correctAnswer": "a", |
53 | 53 | "difficulty": "beginner" |
| 54 | + }, |
| 55 | + { |
| 56 | + "question": "Which attribute should be enabled to ensure cookies are only sent over HTTPS?", |
| 57 | + "answers": { |
| 58 | + "a": "Secure attribute", |
| 59 | + "b": "HttpOnly attribute", |
| 60 | + "c": "SameSite attribute", |
| 61 | + "d": "Domain attribute" |
| 62 | + }, |
| 63 | + "explanations": { |
| 64 | + "a": "The Secure attribute ensures that cookies are only sent over HTTPS, preventing interception over unsecured connections.<a href='https://owasp.org/www-community/controls/SecureCookieAttribute'>Learn more</a>", |
| 65 | + "b": "HttpOnly prevents JavaScript access but does not enforce HTTPS.", |
| 66 | + "c": "SameSite prevents cross-site request forgery (CSRF) but does not enforce HTTPS.", |
| 67 | + "d": "Domain defines which domains can receive the cookie but does not enforce HTTPS." |
| 68 | + }, |
| 69 | + "correctAnswer": "a", |
| 70 | + "difficulty": "beginner" |
| 71 | + }, |
| 72 | + { |
| 73 | + "question": "How can an application prevent session fixation attacks?", |
| 74 | + "answers": { |
| 75 | + "a": "Regenerate session IDs after login", |
| 76 | + "b": "Use weak session IDs", |
| 77 | + "c": "Allow users to reuse session tokens", |
| 78 | + "d": "Store session IDs in local storage" |
| 79 | + }, |
| 80 | + "explanations": { |
| 81 | + "a": "Regenerating session IDs after login prevents attackers from setting a fixed session ID for a victim.<a href='https://owasp.org/www-community/attacks/Session_fixation'>Learn more</a>", |
| 82 | + "b": "Weak session IDs make it easier to predict or guess a valid session.", |
| 83 | + "c": "Allowing reuse of session tokens increases the risk of fixation attacks.", |
| 84 | + "d": "Storing session IDs in local storage exposes them to JavaScript-based attacks." |
| 85 | + }, |
| 86 | + "correctAnswer": "a", |
| 87 | + "difficulty": "beginner" |
| 88 | + }, |
| 89 | + { |
| 90 | + "question": "What is the main purpose of the SameSite cookie attribute?", |
| 91 | + "answers": { |
| 92 | + "a": "To prevent cross-site request forgery (CSRF) attacks", |
| 93 | + "b": "To encrypt cookies", |
| 94 | + "c": "To allow cookies across multiple domains", |
| 95 | + "d": "To set an expiration date for cookies" |
| 96 | + }, |
| 97 | + "explanations": { |
| 98 | + "a": "The SameSite attribute prevents browsers from sending cookies with cross-site requests, helping prevent CSRF attacks.<a href='https://owasp.org/www-community/SameSite'>Learn more</a>", |
| 99 | + "b": "Cookies are not encrypted by SameSite; encryption requires Secure or encryption techniques.", |
| 100 | + "c": "SameSite restricts cookies to first-party requests, not cross-domain usage.", |
| 101 | + "d": "Max-Age or Expires attributes define cookie expiration, not SameSite." |
| 102 | + }, |
| 103 | + "correctAnswer": "a", |
| 104 | + "difficulty": "beginner" |
54 | 105 | } |
55 | 106 | ] |
56 | 107 | } |
0 commit comments