CVE-2026-85396
largePath Traversal File-Write Flaw in rubyzip Gem (Zip::Entry#extract)
rubyzip, a widely used Ruby gem for creating and extracting ZIP archives, contains a path traversal vulnerability (CWE-22) in Zip::Entry#extract in all versions before 3.4.0. Because the extraction path is validated using a prefix comparison without a trailing separator, crafted archive entries such as ../upload_backup/owned.sh pass validation and are written outside the intended extraction directory into sibling paths whose names share the destination prefix. An attacker who can supply a malicious ZIP archive to an application that extracts it gains a write outside the destination folder (high integrity impact per the CVSS 4.0 vector), which can lead to overwriting scripts, configs, or other files depending on the host application. Any Ruby application running an affected rubyzip version and extracting untrusted archives is affected; exploitation requires no privileges or user interaction over the network. There is currently no public proof-of-concept, no CISA KEV listing, and no known exploitation, with EPSS estimating roughly a 0.4% probability of exploitation within 30 days.
What to do: Upgrade to rubyzip 3.4.0 or later and review Gemfile.lock/dependency audits (e.g., bundler-audit) for affected versions. As interim mitigation, validate ZIP entry names before extraction (reject entries containing ../ components or paths resolving into sibling directories of the destination) and identify application code paths that call Zip::File#extract or Entry#extract on user-supplied archives.
| rubyzip project rubyzip (Ruby gem) | all versions before 3.4.0 |
Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.
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.
- Weakness
- CWE-22
- 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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
In the news0 stories
No ingested article mentions this CVE yet.