Testing for cookie attributes
Important user-specific information, such as session tokens, is often stored in cookies within the client browser. Due to their importance, cookies need to be protected from malicious attacks. This protection usually comes in the form of two flags—secure
and HttpOnly
.
The secure
flag informs the browser to only send the cookie to the web server if the protocol is encrypted (for example, HTTPS or TLS). This flag protects the cookie from eavesdropping over unencrypted channels.
The HttpOnly
flag instructs the browser to not allow access or manipulation of the cookie via JavaScript. This flag protects the cookie from cross-site scripting attacks.
Getting ready
Check the cookies used in the OWASP Mutillidae II application, to ensure the presence of protective flags. Since the Mutillidae application runs over an unencrypted channel (for example, HTTP), we can only check for the presence of the HttpOnly
flag. Therefore, the secure
flag is...