Test For Checking Session Cookie Httponly

By
Sooraj V Nair
Published on
02 Jul 2018
Vulnerability

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.

Example

The below code is an example of session.cookie_httponly

        session.cookie_httponly=off

    

Impact

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.
        session.cookie_httponly=on

    
  • Using CSRF protection token.

Written by
Sooraj V Nair
Sooraj V Nair
Cyber Security Engineer
Experience the Beagle Security platform
Unlock one full penetration test and all Advanced plan features free for 10 days