How to fix: Rails exception page accessible in production
A Rails exception page is visible, exposing stack traces and application internals to the public.
Why it matters
Rails exception pages in production expose Ruby backtraces with file paths, gem versions, and application source snippets, giving attackers a detailed understanding of the application structure and dependencies.
In development, Rails shows detailed error pages via BetterErrors or the default exception page. These must never be shown in production.
How to fix it
- 1Ensure config.consider_all_requests_local = false in production.rb
- 2Rails automatically uses the public/500.html error page in production mode
- 3Set RAILS_ENV=production in your deployment environment
Code examples
config/environments/production.rb
Rails.application.configure do
config.consider_all_requests_local = false
config.action_dispatch.show_exceptions = :sanitized
endReferences
Detected automatically by VulnRadar. The check id is rails-error-page-disclosure, 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 exception page accessible in production?
- VulnRadar rates this critical 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-error-page-disclosure, which stays the same between runs so you can filter, diff, or gate CI on it.
- Which standards does Rails exception page accessible in production map to?
- It maps to CWE-209. 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.