Menganalisis Kerentanan Rails Debug Mode pada Ruby on Rails
A Ruby on Rails application left debug mode enabled in production, so its error pages exposed full stack traces, file names, code lines and running variables. An attacker could use this internal information to learn about the server's paths, libraries and environment configuration.
medium.com
Published on medium.com
Dalam proses pengembangan aplikasi web menggunakan Ruby on Rails, fitur debug mode sering kali menjadi alat bantu penting bagi developer untuk melakukan troubleshooting secara cepat. Namun, ketika fitur ini tidak dinonaktifkan saat aplikasi masuk ke lingkungan produksi, ia dapat menjadi celah keamanan serius yang…
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 application was deployed with Rails debug settings left on, so detailed error pages were shown to the public instead of a generic message.
Impact
An attacker could obtain sensitive details such as directory paths, file names, libraries and environment configuration, and the text notes the debug page could in some cases be used for remote code execution if additional access is available.
What the attacker needed
None
The fix
Debug mode should be turned off in production so that generic error pages are shown instead of detailed traces.
How it was found
- Fingerprint the framework from URL structure, HTTP headers and the style of error pages.
- Request a non-existent endpoint to trigger the error handler.
- Inspect the error response for stack trace, file names, code lines and variables.
- Confirm debug mode is active from the internal information shown.
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 app crashes, it usually shows a short error message. In debug mode it instead shows a long technical page with the code that failed and details about the server. That page is meant for developers only, so leaving it on in a live site hands useful clues to anyone who triggers an error.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.