Leakage of sensitive data in cookie

Description

Leakage of sensitive data in cookies can lead to a data breach. This vulnerability occurs when sensitive information is stored in browser cookies, putting it at risk of unauthorized access.

Remediations

  • Do not store sensitive data in unencrypted cookies. This practice can expose sensitive information to potential security threats.
    Cookie cookie = new Cookie("user", user.email);

Associated CWE

OWASP Top 10

Configuration

To skip this rule during a scan, use the following flag

bearer scan /path/to/your-project/ --skip-rule=java_lang_cookie_leak

To run only this rule during a scan, use the following flag

bearer scan /path/to/your-project/ --only-rule=java_lang_cookie_leak