Leakage of sensitive data in session cookie
- Rule ID: ruby_rails_session
- Languages: ruby
- Source: session.yml
Sensitive data should not be stored in session cookies. This policy looks for any sensitive data stored within the session cookies.
By default, Rails uses a Cookie based session store. This makes it unsafe if you use it to store sensitive data in addition of making invalidating cookies difficult as they are stored on the client.
✅ To ensure session's data stays safe, ensure to use a database-based session storage, which is easily done though Rails configuration:
OWASP Top 10
To skip this rule during a scan, use the following flag
bearer scan /path/to/your-project/ --skip-rule=ruby_rails_session
To run only this rule during a scan, use the following flag
bearer scan /path/to/your-project/ --only-rule=ruby_rails_session
Ready to take the next step? Learn more about Bearer Cloud.