Sensitive data stored in a cookie detected.

  • Rule ID: php_lang_cookies
  • Languages: php
  • Source: cookies.yml

Description

Storing sensitive data in cookies can lead to a data breach. This rule looks for instances where sensitive data is stored in browser cookies.

Remediations

❌ Avoid storing sensitive data in unencrypted cookies:

setcookie("user_email", $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=php_lang_cookies

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

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

Ready to take the next step? Learn more about Bearer Cloud.