How to fix: Rails default session cookie name reveals framework
A cookie matching Rails' default *_session naming convention was found in the Set-Cookie header. This reveals that the server-side framework is Ruby on Rails, but not which version.
Why it matters
Knowing the server runs Rails lets attackers focus reconnaissance on Rails-specific vulnerabilities and misconfigurations instead of probing the stack blindly. This is a framework fingerprint only: it does not reveal the Rails version, and is unrelated to whether X-Powered-By or X-Runtime headers are present.
Rails names its session cookie <app>_session by default. This name is a recognizable Rails fingerprint independent of any response header. Renaming it to a generic opaque string costs nothing and removes this passive disclosure.
How to fix it
- 1Set a custom session cookie key in config/initializers/session_store.rb.
- 2Choose a name that does not reference the framework or language.
- 3If X-Powered-By or X-Runtime headers are also present, strip those separately via config.action_dispatch.default_headers in production.rb.
Code examples
config/initializers/session_store.rb
Rails.application.config.session_store :cookie_store,
key: '_app_sid',
httponly: true,
secure: Rails.env.production?,
same_site: :strictReferences
Detected automatically by VulnRadar. The check id is rails-version-exposure, stable across every scan so you can filter or diff on it.
More info disclosure checks
- MediumRails Session Cookie Missing HttpOnly Flag
- InfoServer header truncated
- InfoPHP session cookie naming exposes runtime
- Infoconfig.js / settings.js referenced (verify contents)
- Infoenv.js / environment.js referenced (verify contents)
- InfoSitemap.xml publicly accessible
- InfoOpenAPI schema version exposed in URL
- LowCORS exposes internal CDN hostname
Questions
- How severe is Rails default session cookie name reveals framework?
- VulnRadar rates this info severity in the info disclosure category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
- Does VulnRadar check for this automatically?
- Yes. It runs as part of every scan under the check id rails-version-exposure, which stays the same between runs so you can filter, diff, or gate CI on it.
- Which standards does Rails default session cookie name reveals framework map to?
- It maps to CWE-200. In the OWASP Top 10 it falls under A05:2021.
Missing a check?
The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.