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.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| rubyzip | rubyzip | < 3.4.0 | 3.4.0 |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | ruby-zip | 3.4.0+dfsg-1 | — |
| Debian 13 | ruby-zip | No fix yet | — |
| Debian 12 | ruby-zip | No fix yet | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 26.04 LTS | ruby-zip | No fix yet | — |
| Ubuntu 24.04 LTS | ruby-zip | No fix yet | — |
| Ubuntu 22.04 LTS | ruby-zip | No fix yet | — |
| Ubuntu 20.04 LTS | ruby-zip | No fix yet | — |
| Ubuntu 18.04 LTS | ruby-zip | No fix yet | — |
Show 1 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 16.04 LTS | ruby-zip | No fix yet | — |
Azure Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Azure Linux 3 | rubygem-rubyzip | No fix yet | — |
Wolfi
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Wolfi rolling | cinc-auditor | 7.1.7-r8 | — |
| Wolfi rolling | logstash-9.3 +1 | No fix yet | — |
| Wolfi rolling | logstash-9.4 +1 | 9.4.8-r0 | — |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| RubyGems | rubyzip | < 3.4.0 | 3.4.0 | GHSA-47m2-wp7j-p9vc |
References
- Patch Commit patch
- https://github.com/rubyzip/rubyzip product
- rubyzip v3.4.0 Release Notes release-notes
- https://github.com/rubyzip/rubyzip/blob/v3.3.1/lib/zip/entry.rb technical-description
- https://github.com/geo-chen/oss/blob/main/rubyzip.md technical-description
- VulnCheck Advisory: rubyzip before 3.4.0 Path Traversal in Zip::Entry#extract via Sibling-Directory Prefix third-party-advisory