Skip to main content
CriticalInfo disclosureOWASP A05:2021CWE-209

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

  1. 1Ensure config.consider_all_requests_local = false in production.rb
  2. 2Rails automatically uses the public/500.html error page in production mode
  3. 3Set RAILS_ENV=production in your deployment environment

Code examples

config/environments/production.rb

Ruby
Rails.application.configure do
  config.consider_all_requests_local = false
  config.action_dispatch.show_exceptions = :sanitized
end

References

Detected automatically by VulnRadar. The check id is rails-error-page-disclosure, stable across every scan so you can filter or diff on it.

See every info disclosure check

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.

Propose a checkHow a check is built

Scan your own site for rails exception page accessible in production

VulnRadar runs this check and hundreds more against a URL in seconds. No agent to install, just paste a URL.

Or scan this site as a demoRead the docs

Rails exception page accessible in production | VulnRadar