What Is Ruby on Rails?
Ruby on Rails is one of the most widely used web application frameworks, powering everything from startups to large-scale platforms. Action View is the templating/rendering layer of Rails responsible for turning controller data into HTML (or other formats) sent to the browser — a component that, if it can be tricked into rendering the wrong thing, becomes a path to leaking server-side files.
Overview
CVE-2019-5418 is a file content disclosure vulnerability (CWE-22, Path Traversal) in Rails' Action View component. Applications that use render file: with dynamic, unsanitized path segments can be manipulated via a specially crafted Accept HTTP header to have Rails render and return the contents of arbitrary files on the server — including sensitive files such as application source code, credentials files, or configuration containing secrets. CVSS score: 7.5, with impact limited to confidentiality (file read) rather than code execution.
Technical Details
The bug exploits how Rails determines the format/extension to render based on the request's Accept header when combined with certain uses of render file:. By manipulating the Accept header to include unexpected values, an attacker can influence which file extension Rails appends when resolving the file path passed to render file:, and in combination with path traversal sequences, cause Rails to read and return a file outside the intended views directory. Because render file: is a relatively niche, explicit method (not the default render call most Rails views use), the vulnerability primarily affects applications that pass user-influenced or dynamic values into it — a pattern more common in custom or legacy Rails code than in typical scaffolded applications.
Discovery
This vulnerability was disclosed and patched by the Ruby on Rails core team as part of its coordinated security release process on March 13, 2019, alongside other framework security fixes released the same day.
Exploitation Context
CISA added this vulnerability to the KEV catalog in July 2025, more than six years after original disclosure — indicating it is still being actively exploited today, most likely against long-lived, unpatched Rails applications built with vulnerable coding patterns from that era. This reflects a broader trend: web framework path-traversal bugs from years past continue to be scanned for and exploited against applications that were never upgraded past known-vulnerable Rails versions.
Remediation
- Upgrade Rails to the patched versions from the March 2019 security release (Rails 6.0.0.beta3, 5.2.2.1, 5.1.6.2, and 4.2.11, or any later release) — treat any Rails version older than these as vulnerable.
- Audit application code for uses of
render file:with dynamic or user-influenced path segments, and refactor to use safer rendering methods (render template:,render partial:) wherever possible. - Validate and allowlist any values that influence file paths or extensions before passing them into rendering calls.
- Restrict file system permissions for the application process so that even a successful traversal cannot reach highly sensitive files (credentials, private keys) outside the application directory.
- Review application logs for requests with anomalous
Acceptheaders combined with path traversal sequences, which may indicate exploitation attempts.
Key Details
| Property | Value |
|---|---|
| CVE ID | CVE-2019-5418 |
| Vendor / Product | Rails — Ruby on Rails |
| NVD Published | 2019-03-27 |
| NVD Last Modified | 2025-10-30 |
| CVSS 3.1 Score | 7.5 |
| CVSS 3.1 Vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
| Severity | HIGH |
| CWE | CWE-22 find similar ↗ |
| CISA KEV Added | 2025-07-07 |
| CISA KEV Deadline | 2025-07-28 |
| Known Ransomware Use | No |
CVSS 3.1 Breakdown
Required Action
Timeline
| Date | Event |
|---|---|
| 2019-03-13 | Rails core team publishes patched releases and security advisory |
| 2019-03-27 | CVE-2019-5418 published |
| 2025-07-07 | Added to CISA Known Exploited Vulnerabilities catalog |
| 2025-07-28 | CISA BOD 22-01 remediation deadline |
References
| Resource | Type |
|---|---|
| NVD — CVE-2019-5418 | Vulnerability Database |
| CISA KEV Catalog Entry | US Government |
| Rails Security Release Announcement (archived) | Vendor Advisory |