CVE-2018-1000544: Rubyzip Path Traversal Vulnerability

CRITICAL
Advisory Identifier: GHSA-vqcq-mrmw-mcmg
CVSS 9.8
CWE-59 CWE-434
Published
Advisory Summary

CVE-2018-1000544 is a CRITICAL (CVSS 9.8) path traversal vulnerability (CWE-59: Improper Link Resolution Before File Access ('Link Following')) affecting Rubyzip libraries in the RubyGems ecosystem. The issue involves rubyzip gem contains a directory traversal vulnerability in zip file component. Remediation is available by upgrading affected packages to version 1.2.2.

CVE-2018-1000544 at a Glance

CVE Identifier CVE-2018-1000544
GHSA Identifier GHSA-vqcq-mrmw-mcmg
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-59: Improper Link Resolution Before File Access ('Link Following')
Affected Product Rubyzip
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 9.8

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

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 High (I:H)
Availability High (A:H)

How to Fix CVE-2018-1000544

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

rubyzip fixed: 1.2.2
Upgrade rubyzip to 1.2.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 rubyzip

How to Check if You Are Affected

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

inspect dependencies for rubyzip

Analyze the terminal output to locate any version of Rubyzip in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.2.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-59: Improper Link Resolution Before File Access ('Link Following'), where the product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource. In Rubyzip, 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

rubyzip gem rubyzip version 1.2.1 and earlier contains a Directory Traversal vulnerability in Zip::File component that can result in write arbitrary files to the filesystem. This attack appear to be exploitable via If a site allows uploading of .zip files , an attacker can upload a malicious file that contains symlinks or files with absolute pathnames "../" to write arbitrary files to the filesystem.. This is similar to CVE-2017-5946 which was patched in 1.2.1 but the fix in that case was incomplete.

CVE-2018-1000544 Affected Rubyzip Versions

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

References

Frequently Asked Questions

What is CVE-2018-1000544?
CVE-2018-1000544 is a security vulnerability in Rubyzip involving Rubyzip gem contains a Directory Traversal vulnerability in zip file component under CWE-59: Improper Link Resolution Before File Access ('Link Following').
Which Rubyzip versions are affected?
Affected versions include releases prior to 1.2.2 across affected packages: rubyzip.
What version fixes CVE-2018-1000544?
Upgrading to 1.2.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is rubyzip affected?
Yes, rubyzip is affected in releases prior to 1.2.2. Upgrade your dependency to 1.2.2 or later.
What is the CVSS score of CVE-2018-1000544?
CVE-2018-1000544 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2018-1000544?
CVE-2018-1000544 is classified under CWE-59: Improper Link Resolution Before File Access ('Link Following') (The product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource.).
How can I check RubyGems dependencies for CVE-2018-1000544?
Run the dependency tree command: 'inspect dependencies for rubyzip'. 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-vqcq-mrmw-mcmg",
  "modified" : "2022-04-26T18:30:20Z",
  "published" : "2018-09-06T03:27:18Z",
  "aliases" : [ "CVE-2018-1000544" ],
  "summary" : "Rubyzip gem contains a Directory Traversal vulnerability in zip file component",
  "details" : "rubyzip gem rubyzip version 1.2.1 and earlier contains a Directory Traversal vulnerability in Zip::File component that can result in write arbitrary files to the filesystem. This attack appear to be exploitable via If a site allows uploading of .zip files , an attacker can upload a malicious file that contains symlinks or files with absolute pathnames \"../\" to write arbitrary files to the filesystem..\n\nThis is similar to CVE-2017-5946 which was patched in 1.2.1 but the fix in that case was incomplete.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "rubyzip"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.2.2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.2.1"
    }
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2018-1000544"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubyzip/rubyzip/issues/369"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:3466"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rubyzip/CVE-2018-1000544.yml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/rubyzip/rubyzip"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2018/08/msg00013.html"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2020/08/msg00002.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-434", "CWE-59" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:58:07Z",
    "nvd_published_at" : null
  }
}