CVE-2013-0162: Ruby parser Ruby_parser Allows Local Users To Vulnerability

LOW
Advisory Identifier: GHSA-8mvw-22r7-w6fq
CWE-377
Published
Advisory Summary

CVE-2013-0162 is a LOW ruby_parser allows local users to vulnerability (CWE-377: Insecure Temporary File) affecting Ruby parser libraries in the RubyGems ecosystem. The issue involves ruby_parser allows local users to overwrite arbitrary files via symlink attack on temporary file with predictable name. Remediation is available by upgrading affected packages to version 3.1.2.

CVE-2013-0162 at a Glance

CVE Identifier CVE-2013-0162
GHSA Identifier GHSA-8mvw-22r7-w6fq
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-377: Insecure Temporary File
Affected Product Ruby parser
Package Ecosystem RubyGems
Published Date
Last Updated

How to Fix CVE-2013-0162

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

ruby_parser fixed: 3.1.2
Upgrade ruby_parser to 3.1.2
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 ruby_parser

How to Check if You Are Affected

To determine whether your application is affected by CVE-2013-0162, inspect your project dependencies for Ruby parser:

inspect dependencies for ruby_parser

Analyze the terminal output to locate any version of Ruby parser in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.1.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-377: Insecure Temporary File, where creating and using insecure temporary files can leave application and system data vulnerable to attack. In Ruby parser, 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

The `diff_pp` function in `lib/gauntlet_rubyparser.rb` in the ruby_parser gem 3.1.1 and earlier for Ruby allows local users to overwrite arbitrary files via a symlink attack on a temporary file with a predictable name in `/tmp`.

CVE-2013-0162 Affected Ruby parser Versions

1 component(s)
Fixed Versions:
3.1.2
Product / Package Ecosystem Affected Versions Fixed Version
ruby_parser
RubyGems
≥ 2.0.2
< 3.1.2
3.1.2

References

Frequently Asked Questions

What is CVE-2013-0162?
CVE-2013-0162 is a security vulnerability in Ruby parser involving ruby_parser allows local users to overwrite arbitrary files via symlink attack on temporary file with predictable name under CWE-377: Insecure Temporary File.
Which Ruby parser versions are affected?
Affected versions include releases prior to 3.1.2 across affected packages: ruby_parser.
What version fixes CVE-2013-0162?
Upgrading to 3.1.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is ruby_parser affected?
Yes, ruby_parser is affected in releases prior to 3.1.2. Upgrade your dependency to 3.1.2 or later.
What CWE is associated with CVE-2013-0162?
CVE-2013-0162 is classified under CWE-377: Insecure Temporary File (Creating and using insecure temporary files can leave application and system data vulnerable to attack.).
How can I check RubyGems dependencies for CVE-2013-0162?
Run the dependency tree command: 'inspect dependencies for ruby_parser'. 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-8mvw-22r7-w6fq",
  "modified" : "2023-03-08T19:28:01Z",
  "published" : "2022-05-05T02:48:30Z",
  "aliases" : [ "CVE-2013-0162" ],
  "summary" : "ruby_parser allows local users to overwrite arbitrary files via symlink attack on temporary file with predictable name",
  "details" : "The `diff_pp` function in `lib/gauntlet_rubyparser.rb` in the ruby_parser gem 3.1.1 and earlier for Ruby allows local users to overwrite arbitrary files via a symlink attack on a temporary file with a predictable name in `/tmp`.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "ruby_parser"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.2"
      }, {
        "fixed" : "3.1.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2013-0162"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/seattlerb/ruby_parser/commit/506c7e13cff6f8715385fa8488b621028b4ad280"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/seattlerb/ruby_parser/commit/c35acd878d50a8e4ea35933e3fbdc493421d422c"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2013:0544"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2013:0582"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/security/cve/CVE-2013-0162"
  }, {
    "type" : "WEB",
    "url" : "https://bugzilla.redhat.com/show_bug.cgi?id=892806"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/ruby_parser/CVE-2013-0162.yml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/seattlerb/ruby_parser"
  }, {
    "type" : "WEB",
    "url" : "http://rhn.redhat.com/errata/RHSA-2013-0544.html"
  }, {
    "type" : "WEB",
    "url" : "http://rhn.redhat.com/errata/RHSA-2013-0548.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-377" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-03-08T19:28:01Z",
    "nvd_published_at" : "2013-03-01T05:40:00Z"
  }
}