Skip to content
Info disclosure Write-up Intermediate

RCE due to showexceptions

The Rails exceptions page was enabled in production and exposed the application's secret token. An attacker could use this token to forge signed cookies and potentially achieve remote code execution.

Harsh Jaiswal Follow

Published on sites.google.com

Bounty$5,000 View original

As the the Rack's page suggests, "Be careful when you use this on public-facing sites as it could reveal information helpful to attackers", This must not be turned on on production environment. Rails (up to v4.0.2 NOT SURE) had a Secret token in /config/initializers/secrettoken.rb.

Harsh Jaiswal (@rootxharsh), on sites.google.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the Rails exceptions page (showexceptions) was left enabled in production, causing it to display the secret token used for cookie signing.

Impact

An attacker could use the leaked secret token to forge signed cookies and potentially achieve remote code execution, though the text does not provide a full exploit chain.

What the attacker needed

Rails app with showexceptions enabled; Public-facing site

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

When a web application shows detailed error pages, it can accidentally reveal sensitive information. Here, the error page included a secret code that the app uses to sign cookies. If an attacker gets that code, they can create fake cookies that the app trusts, which might let them run their own code on the server.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More by Harsh Jaiswal

View all

4 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.