Vulnerabilities in pkg:gem/rubocop

PACKAGE
Advisory Identifier: GHSA-wmjf-jpjj-9f3j
Advisory Summary

CVE-2017-8418 is a LOW (CVSS 3.3) rubocop gem insecure use of vulnerability (CWE-668: Exposure of Resource to Wrong Sphere) affecting Rubocop libraries in the RubyGems ecosystem. The issue involves rubocop gem insecure use of /tmp. Remediation is available by upgrading affected packages to version 0.49.0.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:gem/rubocop

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:gem/rubocop. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-wmjf-jpjj-9f3j CVE-2017-8418 LOW RuboCop gem Insecure use of /tmp

CVE-2017-8418 at a Glance

CVE Identifier CVE-2017-8418
GHSA Identifier GHSA-wmjf-jpjj-9f3j
Severity LOW
CVSS v3.1 Base Score 3.3
CWE Classification CWE-668: Exposure of Resource to Wrong Sphere
Affected Product Rubocop
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 3.3

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

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

How to Fix CVE-2017-8418

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

rubocop fixed: 0.49.0
Upgrade rubocop to 0.49.0
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 rubocop

How to Check if You Are Affected

To determine whether your application is affected by CVE-2017-8418, inspect your project dependencies for Rubocop:

inspect dependencies for rubocop

Analyze the terminal output to locate any version of Rubocop in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.49.0), 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-668: Exposure of Resource to Wrong Sphere, where the product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource. In Rubocop, 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

RuboCop 0.48.1 and earlier does not use /tmp in safe way, allowing local users to exploit this to tamper with cache files belonging to other users.

CVE-2017-8418 Affected Rubocop Versions

1 component(s)
Fixed Versions:
0.49.0
Product / Package Ecosystem Affected Versions Fixed Version
rubocop
RubyGems
< 0.49.0
0.49.0

References

Frequently Asked Questions

What is CVE-2017-8418?
CVE-2017-8418 is a security vulnerability in Rubocop involving RuboCop gem Insecure use of /tmp under CWE-668: Exposure of Resource to Wrong Sphere.
Which Rubocop versions are affected?
Affected versions include releases prior to 0.49.0 across affected packages: rubocop.
What version fixes CVE-2017-8418?
Upgrading to 0.49.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is rubocop affected?
Yes, rubocop is affected in releases prior to 0.49.0. Upgrade your dependency to 0.49.0 or later.
What is the CVSS score of CVE-2017-8418?
CVE-2017-8418 has a CVSS v3.1 base score of 3.3 (LOW) with vector string CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with CVE-2017-8418?
CVE-2017-8418 is classified under CWE-668: Exposure of Resource to Wrong Sphere (The product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource.).
How can I check RubyGems dependencies for CVE-2017-8418?
Run the dependency tree command: 'inspect dependencies for rubocop'. 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-wmjf-jpjj-9f3j",
  "modified" : "2023-08-28T13:43:41Z",
  "published" : "2017-11-15T20:39:47Z",
  "aliases" : [ "CVE-2017-8418" ],
  "summary" : "RuboCop gem Insecure use of /tmp",
  "details" : "RuboCop 0.48.1 and earlier does not use /tmp in safe way, allowing local users to exploit this to tamper with cache files belonging to other users.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "rubocop"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.49.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2017-8418"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/bbatsov/rubocop/issues/4336"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubocop/rubocop/commit/dcb258fabd5f2624c1ea0e1634763094590c09d7"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/bbatsov/rubocop"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rubocop/CVE-2017-8418.yml"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2017/05/01/14"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-668" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T22:00:50Z",
    "nvd_published_at" : null
  }
}