Skip to main content

rubyzip CVE-2026-85396

| EUVDEUVD-2026-70673 HIGH
Path Traversal (CWE-22)
2026-09-03 VulnCheck GHSA-47m2-wp7j-p9vc
8.7
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Deliver crafted ZIP with traversal entry
  2. Delivery
    Application calls Zip::Entry#extract on archive
  3. Exploit
    Prefix check passes for sibling directory path
  4. Execution
    File written outside intended extraction directory
  5. Persist
    Overwrite script or web-accessible file
  6. Impact
    Attacker achieves code execution

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path canonicalization, traversal prevention
MITRE ATT&CK

2 techniques across 2 tactics: Discovery, Collection

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires that the target application (1) uses rubyzip's Zip::Entry#extract method or any higher-level wrapper that calls it, and (2) processes a ZIP archive supplied or influenced by the attacker. The destination directory used for extraction must have a sibling directory whose name begins with the same string prefix as the destination; since the attacker controls archive entry names, they can craft paths targeting any predictable sibling by naming entries accordingly. No authentication is required at the rubyzip library level; whether unauthenticated users can supply archives depends on the application. Exploitation is limited by: the attacker must be able to deliver a malicious archive to the extraction code path; the write target must be within a directory writable by the application process and actionable (e.g., a web root, cron directory, or SSH authorized_keys location); and the sibling directory must exist or be creatable. Applications that extract archives exclusively from trusted, internal sources are not exposed.

Impact

The provided CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N) scoring 8.7 accurately captures the worst-case scenario: a server that automatically extracts user-supplied archives is exploitable without any authentication or user interaction, with high integrity impact via arbitrary file write. Real-world risk is strongly deployment-dependent - applications that accept archive uploads and extract them automatically into predictable directory structures (common in Rails file-management, backup, and CI/CD tooling) are directly exposed, while deployments that only extract archives from trusted internal sources face negligible risk. No EPSS data was provided in the input and the vulnerability does not appear in the CISA KEV catalog, indicating no confirmed active exploitation at time of analysis. The attack logic is simple and reliable - it requires no memory corruption or timing - so automatable exploitation is plausible against any exposed endpoint, meaning even a moderately sized organization running vulnerable rubyzip versions in a file-processing pipeline should prioritize this patch. The technical impact score is well-supported; no conflicting signals were identified between the CVSS vector and the described mechanism.

Exploit ScenarioDerived

An attacker uploads a ZIP archive containing an entry named ../out_evil/backdoor.sh to a web application that automatically extracts user uploads into a destination directory named out (for example, /var/www/app/uploads/out). When the application calls Zip::Entry#extract, the flawed prefix check accepts the resolved path /var/www/app/uploads/out_evil/backdoor.sh because it begins with the string /var/www/app/uploads/out, writing the attacker-controlled file to the sibling directory. If out_evil is a cron script directory or a web-accessible path, the attacker achieves remote code execution. No public exploit code has been identified at time of analysis, but the attack is trivially reproducible from the commit diff and test fixture.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.4% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Sep 03, 2026

Path traversal in rubyzip before 3.4.0 allows an attacker who supplies a crafted ZIP archive to write files outside the intended extraction directory by exploiting a flawed prefix comparison in Zip::Entry#extract. The root cause is that the path guard checks extract_path.start_with?(dest_dir) without appending a trailing file separator, meaning a sibling directory sharing the destination string prefix - such as out_evil alongside destination out - passes validation and receives the extracted file. The fix is confirmed in v3.4.0; no active exploitation has been identified at time of analysis, but the attack primitive is straightforward to reproduce from the published commit diff.

RemediationAI

Upgrade rubyzip to version 3.4.0 or later, the fix release confirmed by the GitHub release tag at https://github.com/rubyzip/rubyzip/releases/tag/v3.4.0. The patching commit (17edfbf4423b83211b075acc23a7d8640da63449 at https://github.com/rubyzip/rubyzip/commit/17edfbf4423b83211b075acc23a7d8640da63449) is minimal and low-risk: it appends ::File::SEPARATOR to the destination directory in the prefix check, closing the sibling-directory escape. Where immediate upgrade is not feasible, a compensating control is to pre-validate each archive entry name using File.expand_path(entry_name, dest_dir) and reject any result that does not begin with dest_dir + File::SEPARATOR; however, application-level sanitization duplicates logic now fixed in the library and is error-prone, so upgrading is strongly preferred. Additionally, running the extraction process under a restricted OS user that lacks write permissions outside the intended extraction directory limits the blast radius if traversal occurs.

Affected VersionsENISA

rubyzip 0 <3.4.0

Affected Packages

rubygems rubyzip fix: 3.4.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in rubygems

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The vulnerability exists in lib/zip/entry.rb within the Zip::Entry#extract method of rubyzip (CPE: cpe:2.3:a:rubyzip:rubyzip:*:*:*:*:*:*:*:*), a widely-used pure-Ruby library for reading and writing ZIP archives. The root cause is CWE-22 (Path Traversal) expressed as a prefix-comparison pitfall: the guard unless extract_path.start_with?(dest_dir) allows any path that begins with the destination directory string to pass, including sibling directories that happen to share the same prefix characters. For example, with destination /app/uploads/out, an archive entry resolving to /app/uploads/out_evil/backdoor.sh satisfies the check because the string starts with /app/uploads/out. The fix in commit 17edfbf4423b83211b075acc23a7d8640da63449 changes the condition to extract_path.start_with?(dest_dir + ::File::SEPARATOR) || dest_dir == ::File::SEPARATOR, ensuring only paths strictly nested under the destination subtree are permitted. A regression test with a crafted out_evil.zip fixture was added alongside the fix.

Know when Rubyzip gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (VulnCheck) PRIMARY 8.7 HIGH
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
vuln.today AI 7.5 HIGH

Network-delivered archive enables unauthenticated arbitrary file write with no confidentiality or availability impact in the direct vulnerability.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N
SUSE 7.5 HIGH
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Red Hat 7.5 HIGH

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
High
Vulnerable system: Availability
None
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

DescriptionCVE.org

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.

Executive ViewAI

Why It Matters

Ruby applications using rubyzip before 3.4.0 can be compromised via maliciously crafted ZIP archives that bypass extraction safeguards and write files to arbitrary system locations. The vulnerability affects any organization using ZIP file processing for uploads, backups, or data handling and carries high severity (CVSS 8.7). A vendor patch (rubyzip 3.4.0) is available and should be deployed immediately.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.4%
Top 69% exploitable
Prevalence
High
widely used Ruby gem across Rails and Ruby web applications
Threat Intel
1
1 sources
Social Media
2
Sightings
Data Quality
8 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA MSRC Vendor CIRCL GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.4%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
Yes
Human Impact
High
Technical Impact
Partial

Priority Score

44
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +44
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.

Vendor StatusVendor

SUSE

Severity: Important
Product Status
SUSE Linux Enterprise Module for Package Hub 15 SP7 Affected
SUSE Linux Enterprise Module for Package Hub 15 SP5 Affected
SUSE Linux Enterprise Module for Package Hub 15 SP6 Affected
openSUSE Leap 15.3 Affected
openSUSE Leap 15.4 Affected

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy