Missing secure options for cookie detected

Description

To make sure cookies don't open your application up to exploits or unauthorized access, make sure to set security options appropriately.

Remediations

✅ Set HttpOnly to true to protect the cookie value from being accessed by client side JavaScript

cookie.setHttpOnly(true);

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_with_http_only_false

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

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

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