CVE-2014-7818: Actionpack Path Traversal Vulnerability

MODERATE
Advisory Identifier: GHSA-29gr-w57f-rpfw
CWE-22
Published
Advisory Summary

CVE-2014-7818 is a MODERATE path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Actionpack libraries in the RubyGems ecosystem. The issue involves actionpack vulnerable to path traversal. Remediation is available by upgrading affected packages to version 3.2.20, 4.0.11, 4.1.7, 4.2.0.beta3.

CVE-2014-7818 at a Glance

CVE Identifier CVE-2014-7818
GHSA Identifier GHSA-29gr-w57f-rpfw
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Actionpack
Package Ecosystem RubyGems
Published Date
Last Updated

How to Fix CVE-2014-7818

To remediate this vulnerability, upgrade all affected Actionpack dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

actionpack fixed: 3.2.20
Upgrade actionpack to 3.2.20
actionpack fixed: 4.0.11
Upgrade actionpack to 4.0.11
actionpack fixed: 4.1.7
Upgrade actionpack to 4.1.7
actionpack fixed: 4.2.0.beta3
Upgrade actionpack to 4.2.0.beta3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for actionpack

How to Check if You Are Affected

To determine whether your application is affected by CVE-2014-7818, inspect your project dependencies for Actionpack:

inspect dependencies for actionpack

Analyze the terminal output to locate any version of Actionpack in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.2.20), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Actionpack, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Directory traversal vulnerability in `actionpack/lib/action_dispatch/middleware/static.rb` in Action Pack in Ruby on Rails 3.x before 3.2.20, 4.0.x before 4.0.11, 4.1.x before 4.1.7, and 4.2.x before 4.2.0.beta3, when `serve_static_assets` is enabled, allows remote attackers to determine the existence of files outside the application root via a `/..%2F` sequence.

CVE-2014-7818 Affected Actionpack Versions

4 component(s)
Fixed Versions:
3.2.204.0.114.1.74.2.0.beta3
Product / Package Ecosystem Affected Versions Fixed Version
actionpack
RubyGems
≥ 3.0.0
< 3.2.20
3.2.20
actionpack
RubyGems
≥ 4.0.0
< 4.0.11
4.0.11
actionpack
RubyGems
≥ 4.1.0
< 4.1.7
4.1.7
actionpack
RubyGems
≥ 4.2.0.beta1
< 4.2.0.beta3
4.2.0.beta3

References

Frequently Asked Questions

What is CVE-2014-7818?
CVE-2014-7818 is a security vulnerability in Actionpack involving actionpack vulnerable to Path Traversal under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Actionpack versions are affected?
Affected versions include releases prior to 3.2.20, 4.0.11, 4.1.7, 4.2.0.beta3 across affected packages: actionpack.
What version fixes CVE-2014-7818?
Upgrading to 3.2.20, 4.0.11, 4.1.7, 4.2.0.beta3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is actionpack affected?
Yes, actionpack is affected in releases prior to 3.2.20, 4.0.11, 4.1.7, 4.2.0.beta3. Upgrade your dependency to 3.2.20, 4.0.11, 4.1.7, 4.2.0.beta3 or later.
What CWE is associated with CVE-2014-7818?
CVE-2014-7818 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check RubyGems dependencies for CVE-2014-7818?
Run the dependency tree command: 'inspect dependencies for actionpack'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-29gr-w57f-rpfw",
  "modified" : "2023-08-25T19:41:02Z",
  "published" : "2017-10-24T18:33:36Z",
  "aliases" : [ "CVE-2014-7818" ],
  "summary" : "actionpack vulnerable to Path Traversal",
  "details" : "Directory traversal vulnerability in `actionpack/lib/action_dispatch/middleware/static.rb` in Action Pack in Ruby on Rails 3.x before 3.2.20, 4.0.x before 4.0.11, 4.1.x before 4.1.7, and 4.2.x before 4.2.0.beta3, when `serve_static_assets` is enabled, allows remote attackers to determine the existence of files outside the application root via a `/..%2F` sequence.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "actionpack"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0"
      }, {
        "fixed" : "3.2.20"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "actionpack"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0"
      }, {
        "fixed" : "4.0.11"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "actionpack"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.1.0"
      }, {
        "fixed" : "4.1.7"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "actionpack"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.2.0.beta1"
      }, {
        "fixed" : "4.2.0.beta3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2014-7818"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-29gr-w57f-rpfw"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/actionpack/CVE-2014-7818.yml"
  }, {
    "type" : "WEB",
    "url" : "https://groups.google.com/forum/#!topic/rubyonrails-security/dCp7duBiQgo"
  }, {
    "type" : "WEB",
    "url" : "https://groups.google.com/forum/message/raw?msg=rubyonrails-security/dCp7duBiQgo/v_R_8PFs5IwJ"
  }, {
    "type" : "WEB",
    "url" : "https://puppet.com/security/cve/cve-2014-7829"
  }, {
    "type" : "WEB",
    "url" : "http://lists.opensuse.org/opensuse-updates/2014-11/msg00112.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T20:51:48Z",
    "nvd_published_at" : "2014-11-08T11:55:00Z"
  }
}