What Is Ruby on Rails Action View?
Ruby on Rails is one of the world's most popular web application frameworks, widely used for building web applications across startups, enterprises, and government services. Action View is the Rails component responsible for rendering templates and generating HTML responses. The render method in Action View allows controllers to specify which view template to render — including render :file for rendering arbitrary files from the filesystem.
The render :file functionality, when combined with insufficient path sanitization, provides a path traversal attack vector: if user-supplied input can influence the file path passed to render :file, an attacker may be able to read arbitrary files from the server's filesystem.
Overview
CVE-2016-0752 is a directory traversal vulnerability in Ruby on Rails Action View that allows remote attackers to read arbitrary files from the Rails application server's filesystem. The vulnerability exists in how Action View handles file paths when the render :file option is used — insufficient path sanitization allows path traversal sequences (../) to escape the intended views directory and reference files outside it. An attacker who can influence the rendered file path can read sensitive files including application secrets, database configuration, and system files. Rails released patches in January 2016 across all maintained versions.
Affected Versions
| Ruby on Rails | Status |
|---|---|
| 3.x before 3.2.22.2 | Vulnerable |
| 4.0.x before 4.0.13.1 | Vulnerable |
| 4.1.x before 4.1.14.1 | Vulnerable |
| 4.2.x before 4.2.5.1 | Vulnerable |
| 5.0.0.beta1 (pre-release) | Vulnerable |
| 3.2.22.2 | Fixed |
| 4.0.13.1 | Fixed |
| 4.1.14.1 | Fixed |
| 4.2.5.1 | Fixed |
Technical Details
Root Cause: Insufficient Path Sanitization in Action View
CVE-2016-0752 involves insufficient path validation (CWE-22) in Rails Action View's file rendering code. When a Rails controller calls render :file => params[:some_param] (or equivalent) with unsanitized user input, and the Action View code does not properly strip path traversal sequences from the provided path, an attacker can specify:
render :file => "../../../../../../etc/passwd"
Action View constructs the full path by combining the views directory with the provided path — but if traversal sequences are not stripped, the resulting path escapes the views directory and resolves to an arbitrary filesystem location. The rendered "view" returns the file's contents in the HTTP response.
High-Value Targets for Rails File Read
Sensitive files accessible via CVE-2016-0752 on a typical Rails application server:
config/database.yml— database connection credentials (username, password, host, database name)config/secrets.ymlorconfig/credentials.yml.enc— Rails secret key base (enables session forgery), API keys.envfiles — environment variable files containing API credentials, service keys/etc/passwd— system user list- Application source code — business logic, internal API implementations
- Private keys — SSH keys, TLS certificates stored on the server
Attack Characteristics
| Attribute | Detail |
|---|---|
| Attack Vector | Network — HTTP request with traversal path |
| Authentication | None required (depends on application code) |
| Impact | Arbitrary file read — database credentials, secrets, source code |
| Root Cause | render :file with unsanitized user input |
| Complexity | Low — straightforward traversal |
Discovery
Reported to the Rails security team by Joernchen of Phenoelit. Rails released security patches on January 25, 2016 as part of a coordinated disclosure.
Exploitation Context
- Credential theft and lateral movement: Attackers exploit CVE-2016-0752 to retrieve database credentials from
config/database.yml, enabling direct database access for data theft; the Rails secret key base fromconfig/secrets.ymlenables forging authenticated session cookies, potentially allowing admin account impersonation - Reconnaissance for further attacks: File read vulnerabilities are often the first step in a multi-stage attack — reading application configuration reveals the internal architecture, connected services, and credential stores for further exploitation
- Rails widespread deployment: Ruby on Rails powers a large percentage of the web; CVE-2016-0752 affected all maintained Rails versions simultaneously, creating a very wide exposure surface across all Rails applications that included
render :filewith user-influenced input - CISA KEV (2022): Added March 2022, confirming continued exploitation against unpatched Rails applications years after the patch
Remediation
-
Update Rails — upgrade to Rails 3.2.22.2, 4.0.13.1, 4.1.14.1, 4.2.5.1 or later. Any current Rails LTS version is patched against CVE-2016-0752.
-
Avoid
render :filewith user input — audit Rails controllers for any use ofrender :file,render :template, or similar with user-supplied values; replace with explicit template name lookups or allowlists of permitted templates. -
Rotate exposed credentials — if the application may have been vulnerable, rotate: database credentials, Rails secret key base (this invalidates all existing sessions), API keys, and any other secrets stored in
config/files. -
Input validation — for any Rails application feature that renders or serves files, validate that the requested path is within an explicitly permitted directory and does not contain traversal sequences.
-
Application security audit — review the application codebase for any patterns where user-controlled input influences file paths, template names, or file operations.
Key Details
| Property | Value |
|---|---|
| CVE ID | CVE-2016-0752 |
| Vendor / Product | Rails — Ruby on Rails |
| NVD Published | 2016-02-16 |
| NVD Last Modified | 2025-10-22 |
| 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 — Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') find similar ↗ |
| CISA KEV Added | 2022-03-25 |
| CISA KEV Deadline | 2022-04-15 |
| Known Ransomware Use | No |
CVSS 3.1 Breakdown
Required Action
Timeline
| Date | Event |
|---|---|
| 2016-01-25 | Rails security patch released: Rails 3.2.22.2, 4.0.13.1, 4.1.14.1, 4.2.5.1, and 5.0.0.beta1.1 addressing CVE-2016-0752 |
| 2016-02-16 | CVE-2016-0752 published by NVD |
| 2022-03-25 | Added to CISA Known Exploited Vulnerabilities catalog |
| 2022-04-15 | CISA BOD 22-01 remediation deadline |
References
| Resource | Type |
|---|---|
| NVD — CVE-2016-0752 | Vulnerability Database |
| CISA KEV Catalog Entry | US Government |
| Rails Security Advisory — CVE-2016-0752 Action View Information Disclosure | Vendor Advisory |