Test For Checking Session Cookie Httponly

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.

Latest Articles