Skip to content

Commit bdfcbcd

Browse files
updated documents
1 parent 3b3b2e7 commit bdfcbcd

File tree

2 files changed

+102
-0
lines changed

2 files changed

+102
-0
lines changed

experiment/posttest.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,57 @@
5151
},
5252
"correctAnswer": "a",
5353
"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"
54105
}
55106
]
56107
}

experiment/pretest.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,57 @@
5151
},
5252
"correctAnswer": "a",
5353
"difficulty": "beginner"
54+
},
55+
{
56+
"question": "Which attribute prevents JavaScript from accessing session cookies?",
57+
"answers": {
58+
"a": "HttpOnly",
59+
"b": "Secure",
60+
"c": "SameSite",
61+
"d": "Path"
62+
},
63+
"explanations": {
64+
"a": "The HttpOnly attribute prevents JavaScript from accessing cookies, reducing the risk of cross-site scripting (XSS) attacks.<a href='https://owasp.org/www-community/HttpOnly'>Learn more</a>",
65+
"b": "The Secure attribute ensures cookies are sent only over HTTPS but does not prevent JavaScript access.",
66+
"c": "SameSite helps prevent cross-site request forgery (CSRF) but does not restrict JavaScript access.",
67+
"d": "The Path attribute defines where the cookie is valid but does not restrict JavaScript access."
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 predictable session IDs",
77+
"c": "Allow session IDs to be set manually",
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": "Predictable session IDs can be guessed by attackers, making them insecure.",
83+
"c": "Allowing manual setting of session IDs exposes them to manipulation.",
84+
"d": "Storing session IDs in local storage makes them vulnerable to cross-site scripting (XSS) attacks."
85+
},
86+
"correctAnswer": "a",
87+
"difficulty": "beginner"
88+
},
89+
{
90+
"question": "Why should the Secure attribute be used with session cookies?",
91+
"answers": {
92+
"a": "To ensure cookies are only sent over HTTPS",
93+
"b": "To prevent JavaScript from accessing cookies",
94+
"c": "To extend the cookie expiration time",
95+
"d": "To allow cookies across multiple domains"
96+
},
97+
"explanations": {
98+
"a": "The Secure attribute ensures cookies are only sent over HTTPS, preventing interception over unsecured connections.<a href='https://owasp.org/www-community/controls/SecureCookieAttribute'>Learn more</a>",
99+
"b": "The HttpOnly attribute prevents JavaScript access, not Secure.",
100+
"c": "Cookie expiration is controlled by the Expires or Max-Age attributes, not Secure.",
101+
"d": "Cross-domain cookie behavior is controlled by the Domain attribute, not Secure."
102+
},
103+
"correctAnswer": "a",
104+
"difficulty": "beginner"
54105
}
55106
]
56107
}

0 commit comments

Comments
 (0)