Description
rubyzip versions before 3.4.0 contain a path traversal vulnerability in Zip::Entry#extract that fails to properly validate extraction paths using prefix comparison without trailing separators. Attackers can craft archive entries with names like ../upload_backup/owned.sh to write files outside the intended extraction directory into sibling paths sharing the destination prefix.
Published: 2026-09-03
Score: 8.7 High
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The flaw in rubyzip versions prior to 3.4.0 allows a carefully crafted ZIP entry to bypass path validation and extract files outside the intended destination. This results in the ability for an attacker to create or overwrite files at arbitrary locations within a directory that shares the same prefix, effectively granting write permission to the filesystem. Because the vulnerability stems from CWE‑22, it can compromise confidentiality, integrity, or availability when critical files are altered or introduced.

Affected Systems

Ruby applications that depend on rubyzip and use Zip::Entry#extract, including any installations that have not upgraded beyond version 3.3.x. The affected versions are any before 3.4.0; the vendor is rubyzip, and the product is commonly referred to as the rubyzip gem. Systems that load untrusted ZIP archives from external sources are at risk.

Risk and Exploitability

The CVSS score of 8.7 indicates a high severity of this vulnerability. EPSS is currently not available, and the vulnerability is not listed in the CISA KEV catalog. Likely, exploitation requires that an attacker provide a malicious ZIP file that the vulnerable application will extract. If the application performs extraction on user‑supplied input or from remote locations, the attacker can place arbitrary files beneath the extraction directory by leveraging the sibling‑directory prefix bypass.

Generated by OpenCVE AI on September 3, 2026 at 21:13 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade the rubyzip gem to version 3.4.0 or later, which removes the path validation flaw.
  • If an upgrade is not yet possible, limit the extraction directory to a secure, non‑exploitable location and validate or sanitize entry names before calling Zip::Entry#extract, ensuring that no '..' components reach outside the intended path.
  • As a temporary measure, manually patch the extraction method in rubyzip to enforce strict prefix comparison with trailing separators or replace Zip::Entry#extract with a third‑party safe extraction helper that performs comprehensive path checks.

Generated by OpenCVE AI on September 3, 2026 at 21:13 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Thu, 03 Sep 2026 19:00:00 +0000

Type Values Removed Values Added
Description rubyzip versions before 3.4.0 contain a path traversal vulnerability in Zip::Entry#extract that fails to properly validate extraction paths using prefix comparison without trailing separators. Attackers can craft archive entries with names like ../upload_backup/owned.sh to write files outside the intended extraction directory into sibling paths sharing the destination prefix.
Title rubyzip before 3.4.0 Path Traversal in Zip::Entry#extract via Sibling-Directory Prefix
First Time appeared Rubyzip Project
Rubyzip Project rubyzip
Weaknesses CWE-22
CPEs cpe:2.3:a:rubyzip_project:rubyzip:*:*:*:*:*:*:*:*
Vendors & Products Rubyzip Project
Rubyzip Project rubyzip
References
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N'}

cvssV4_0

{'score': 8.7, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N'}


Subscriptions

Rubyzip Project Rubyzip
cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-09-03T19:00:09.867Z

Reserved: 2026-09-03T18:10:59.168Z

Link: CVE-2026-85396

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-09-03T19:17:31.527

Modified: 2026-09-03T19:17:31.527

Link: CVE-2026-85396

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-09-03T21:15:04Z

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')