Looking for the vulnerability index of Invicti's legacy products?
Ruby on Rails directory traversal vulnerability - Vulnerability Database

Ruby on Rails directory traversal vulnerability

Description

Ruby on Rails versions prior to the patched releases contain a directory traversal vulnerability (CVE-2014-0130) in the implicit render functionality. Implicit rendering allows controllers to automatically render views without explicit render calls. When applications use globbing routes (routes with wildcard parameters) in combination with the :action parameter, insufficient input validation enables attackers to craft malicious requests that traverse the file system and access arbitrary files outside the intended template directories. This occurs because globbing routes permit special characters like '/' and '.' in parameters, which are normally used as path separators in file systems.

Remediation

<p>Immediately upgrade Ruby on Rails to a patched version. The following versions contain fixes for CVE-2014-0130:</p><ul><li>Rails 4.0.5 or later for 4.0.x series</li><li>Rails 4.1.1 or later for 4.1.x series</li><li>Rails 3.2.18 or later for 3.2.x series</li></ul><p>If immediate upgrading is not possible, apply the following mitigations:</p><ol><li><strong>Remove globbing routes with :action parameters:</strong> Review your routes.rb file and eliminate any routes that combine glob parameters with :action. Replace patterns like this:<pre>get '*path' => 'controller#:action'</pre>with explicit route definitions for each action.</li><li><strong>Implement explicit rendering:</strong> Use explicit render calls in controllers instead of relying on implicit rendering to maintain better control over template resolution.</li><li><strong>Validate input parameters:</strong> Add strict validation for any action parameters to ensure they contain only expected alphanumeric values without path traversal characters.</li></ol><p>After applying patches, verify the fix by testing that requests with path traversal sequences (e.g., '../') in action parameters are properly rejected.</p>

Related Vulnerabilities