CVE-2018-3760: Sprockets Path Traversal Vulnerability

HIGH
Advisory Identifier: GHSA-pr3h-jjhj-573x
CVSS 7.5
CWE-200 CWE-22
Published
Advisory Summary

CVE-2018-3760 is a HIGH (CVSS 7.5) path traversal vulnerability (CWE-200: Exposure of Sensitive Information to an Unauthorized Actor) affecting Sprockets libraries in the RubyGems ecosystem. The issue involves sprockets path traversal leads to information leak. Remediation is available by upgrading affected packages to version 3.7.2, 4.0.0.beta8, 2.12.5.

CVE-2018-3760 at a Glance

CVE Identifier CVE-2018-3760
GHSA Identifier GHSA-pr3h-jjhj-573x
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
Affected Product Sprockets
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2018-3760

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

sprockets fixed: 3.7.2
Upgrade sprockets to 3.7.2
sprockets fixed: 4.0.0.beta8
Upgrade sprockets to 4.0.0.beta8
sprockets fixed: 2.12.5
Upgrade sprockets to 2.12.5
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 sprockets

How to Check if You Are Affected

To determine whether your application is affected by CVE-2018-3760, inspect your project dependencies for Sprockets:

inspect dependencies for sprockets

Analyze the terminal output to locate any version of Sprockets in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.7.2), 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-200: Exposure of Sensitive Information to an Unauthorized Actor, where the product exposes sensitive information to an actor that is not explicitly authorized to have access to that information. In Sprockets, 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

Specially crafted requests can be used to access files that exist on the filesystem that is outside an application's root directory, when the Sprockets server is used in production. All users running an affected release should either upgrade or use one of the work arounds immediately. ### Workaround: In Rails applications, work around this issue, set `config.assets.compile = false` and `config.public_file_server.enabled = true` in an initializer and precompile the assets. This work around will not be possible in all hosting environments and upgrading is advised.

CVE-2018-3760 Affected Sprockets Versions

3 component(s)
Fixed Versions:
3.7.24.0.0.beta82.12.5
Product / Package Ecosystem Affected Versions Fixed Version
sprockets
RubyGems
≥ 3.0.0
< 3.7.2
3.7.2
sprockets
RubyGems
≥ 4.0.0.beta1
< 4.0.0.beta8
4.0.0.beta8
sprockets
RubyGems
< 2.12.5
2.12.5

References

Frequently Asked Questions

What is CVE-2018-3760?
CVE-2018-3760 is a security vulnerability in Sprockets involving Sprockets path traversal leads to information leak under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor.
Which Sprockets versions are affected?
Affected versions include releases prior to 3.7.2, 4.0.0.beta8, 2.12.5 across affected packages: sprockets.
What version fixes CVE-2018-3760?
Upgrading to 3.7.2, 4.0.0.beta8, 2.12.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is sprockets affected?
Yes, sprockets is affected in releases prior to 3.7.2, 4.0.0.beta8, 2.12.5. Upgrade your dependency to 3.7.2, 4.0.0.beta8, 2.12.5 or later.
What is the CVSS score of CVE-2018-3760?
CVE-2018-3760 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2018-3760?
CVE-2018-3760 is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor (The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.).
How can I check RubyGems dependencies for CVE-2018-3760?
Run the dependency tree command: 'inspect dependencies for sprockets'. 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-pr3h-jjhj-573x",
  "modified" : "2023-09-05T21:05:18Z",
  "published" : "2018-06-20T22:18:58Z",
  "aliases" : [ "CVE-2018-3760" ],
  "summary" : "Sprockets path traversal leads to information leak",
  "details" : "Specially crafted requests can be used to access files that exist on the filesystem that is outside an application's root directory, when the Sprockets server is used in production.\n  \nAll users running an affected release should either upgrade or use one of the work arounds immediately.\n  \n### Workaround:\n  \nIn Rails applications, work around this issue, set `config.assets.compile = false` and `config.public_file_server.enabled = true` in an initializer and precompile the assets.\n\nThis work around will not be possible in all hosting environments and upgrading is advised.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "sprockets"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0"
      }, {
        "fixed" : "3.7.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "sprockets"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0.beta1"
      }, {
        "fixed" : "4.0.0.beta8"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 4.0.0.beta7"
    }
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "sprockets"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.12.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2018-3760"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rails/sprockets/commit/18b8a7f07a50c245e9aee7854ecdbe606bbd8bb5"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rails/sprockets/commit/9c34fa05900b968d74f08ccf40917848a7be9441"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rails/sprockets/commit/c09131cf5b2c479263939c8582e22b98ed616c5f"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:2244"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:2245"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:2561"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:2745"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/rails/sprockets"
  }, {
    "type" : "WEB",
    "url" : "https://groups.google.com/d/msg/rubyonrails-security/ft_J--l55fM/7roDfQ50BwAJ"
  }, {
    "type" : "WEB",
    "url" : "https://www.debian.org/security/2018/dsa-4242"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200", "CWE-22" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:49:53Z",
    "nvd_published_at" : null
  }
}