Test For Checking Session Cookie Httponly

OWASP 2013-A2 OWASP 2017-A2 OWASP 2021-A7 OWASP 2019-API7 OWASP PC-C1 CWE-1004 WASC-14 WSTG-SESS-02

The session.cookie_httponly is used to block cookie access to the Javascript. If this setting is disabled, the Javascript can access and make changes to the session cookies. There are many servers that has a disabled session.cookie_httponly. This vulnerability allows access to session cookie to the malicious JavaScript code by the attacker. An enabled session.cookie_httponly setting prevents JavaScript injection.


The below code is an example of session.cookie_httponly




The impact include:-

  • Cross-Site Request Forgery
  • Possible manipulation of sensitive information
  • Possible leakage of sensitive information
  • The attacker will gain administrator access to the web application

Mitigation / Precaution

This vulnerability can be fixed by:-

  • Enabling session.cookie_httponly.

  • Using CSRF protection token.

Latest Articles