Home › CVE › Vulnerabilities
CVE-2017-5946
Research article
rubyzip path traversal (CVE-2017-5946) lets crafted ZIP archives overwrite files outside the extraction directory
| CVE | CVE-2017-5946 |
|---|---|
| Published | December 02, 2026 00:25 UTC |
| Research cut-off | December 02, 2026 00:20 UTC |
| Sources reviewed | 4: NVD record (last modified 2026-06-17); CISA KEV catalog; vendor advisory page (ubuntu.com); FIRST EPSS (2026-12-01) |
Executive summary
CVE-2017-5946 is a path traversal flaw (CWE-22) in the rubyzip library, which does not properly validate file paths stored in ZIP archives, so extracted entries can overwrite files outside the intended destination [1, 3]. NVD scores it CVSS 3.1 9.8 Critical with vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H, scored by NVD as Primary [1]. NVD lists rubyzip versions below 1.2.1 as affected and 1.2.1 as the fix, and lists Debian linux 8.0 and 9.0 as affected [1]. The vendor describes exploitation as requiring a vulnerable system to extract a crafted archive, which may happen when a user or automated process is deceived into extracting it [3]. The CISA KEV catalog did not list the CVE as of 2026-12-02, which does not prove it has not been exploited [2]. FIRST EPSS gives a 30-day exploitation-activity probability of 3.44 percent, a statistical estimate and not evidence of exploitation [4]. The most important immediate action is to inventory every rubyzip copy and every system or package that extracts untrusted archives, then upgrade rubyzip to 1.2.1 or later and apply the Ubuntu and Debian package updates [1, 3].
Key points
- CVE-2017-5946 is a CWE-22 path traversal in rubyzip that lets crafted ZIP archives overwrite files outside the extraction directory [1, 3].
- NVD scores it CVSS 3.1 9.8 Critical, vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H [1].
- NVD lists rubyzip below 1.2.1 as affected and 1.2.1 as fixed; Debian linux 8.0 and 9.0 are also listed [1].
- Not in the CISA KEV catalog as of 2026-12-02, and the FIRST EPSS 30-day probability is 3.44 percent; neither proves exploitation status [2, 4].
- Immediate action: find every rubyzip copy and archive-extraction workflow, then upgrade to 1.2.1 or apply the Ubuntu and Debian package updates [1, 3].
Vulnerability identification
| Field | Value |
|---|---|
| CVE ID | CVE-2017-5946 [1] |
| Vendor and product | rubyzip project, rubyzip library [1] |
| Component | ZIP archive extraction, file path handling [3] |
| Other CPE entry in NVD | debian linux, versions 8.0 and 9.0 [1] |
| Published | 2017-02-27T07:59:00 [1] |
| Last modified | 2026-06-17T01:21:29 [1] |
| Record status | Modified [1] |
| CWE | CWE-22, Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') [1] |
| CVSS 3.1 base score | 9.8, Critical; vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H; scorer NVD (Primary) [1] |
| Other CVSS scores | None listed in the evidence pack [1] |
| Related references | Debian advisory DSA-3801, a securityfocus vulnerability database entry, rubyzip GitHub issue 315 and the rubyzip releases page, all listed in NVD [1]; Ubuntu notice USN-9364-1 [3] |
CWE-22 describes software that fails to keep a file path inside the directory it is supposed to be confined to, so path segments supplied by untrusted input can point elsewhere on the file system [1]. Here the untrusted input is the names stored inside a ZIP archive [3].
Vulnerability description
The rubyzip library does not validate the paths of entries inside a ZIP archive well enough before writing them to disk. According to the Ubuntu bulletin, a crafted archive can therefore write files beyond the destination directory that the caller specified [3]. The security property violated is the integrity of files outside the extraction boundary, and the flawed component is the path handling during archive extraction [1, 3].
For the flaw to matter, a system must extract a crafted archive using a vulnerable rubyzip version. The vendor says this can happen when a user or automated process is deceived into extracting the file [3]. What the sources do not establish: whether the overwrite can be used to run code, read data, or disrupt a service. The NVD vector rates confidentiality, integrity and availability as High, but the vendor text describes only file overwrites [1, 3].
Attack surface and exploitation prerequisites
| Factor | Status from the evidence | Source |
|---|---|---|
| Access path | Network attack vector per the vector string; the evidence pack does not describe how archives reach a target | S1 |
| Adjacent, local or physical access | Not stated beyond the vector | S1 |
| Authentication | None required, per the vector (PR:N) | S1 |
| User interaction | The vector says none (UI:N), but the vendor says extraction must be triggered by a user or automated process that was deceived into it. The extraction step is therefore the interaction point (analyst assessment) | S1, S3 |
| Scope | Unchanged, per the vector (S:U) | S1 |
| Required configuration | Software that uses rubyzip to extract archives that an attacker can supply. The evidence pack does not name any such product | S3 |
| Vulnerable versions | rubyzip below 1.2.1 | S1 |
The network and no-privilege values come only from the CVSS vector, so they describe the scorer's assessment and not a demonstrated attack path. Whether an attacker can deliver an archive to a given system depends on that system's upload, email, or import functions, which the evidence does not describe.
Impact analysis
| Area | Demonstrated by the sources | Vector-only or plausible | Source |
|---|---|---|---|
| Confidentiality | Not described | Scored High in the vector | S1 |
| Integrity | Overwriting files outside the destination directory | Scored High in the vector | S3, S1 |
| Availability | Not described | Scored High in the vector | S1 |
| Authentication and authorization | Not described | None stated | S1 |
| Privilege boundaries | The extraction boundary is crossed (analyst assessment) | Which files are reachable depends on the permissions of the extracting process (analyst assessment) | S3 |
| Data, privacy and regulatory | Not established by the sources | Not established by the sources | None |
An overwrite is limited to the files that the extracting process is permitted to write. A process running with broad write permissions could therefore reach more files than one with a narrow account (analyst assessment).
Affected products and versions
| Vendor | Product or component | Affected versions | Fixed version | Source and qualification |
|---|---|---|---|---|
| rubyzip project | rubyzip library | Below 1.2.1; no lower bound stated | 1.2.1 | NVD CPE configuration [1] |
| Debian | linux (package containing rubyzip not named) | 8.0 and 9.0 | Not given in the evidence pack | NVD CPE entry only [1] |
| Canonical Ubuntu | rubyzip package (name not given in the pack) | Not stated | Not given; the notice refers to specific package versions | Vendor bulletin paraphrase [3] |
The only fixed version that a source gives is rubyzip 1.2.1 [1]. For Debian and Ubuntu the evidence pack does not give the fixed package versions, so administrators must read the advisories' package lists to confirm what is fixed. The NVD listing for Debian is a platform entry and does not say which package ships the vulnerable code [1].
Exploitation and threat intelligence status
- Confirmed exploitation in the wild: none is documented in the evidence pack.
- CISA KEV: not listed as of 2026-12-02. The catalog check does not show that exploitation has not occurred [2].
- FIRST EPSS: 0.0344 (3.44 percent) probability of exploitation activity in the next 30 days, percentile 0.8928, dated 2026-12-01. The percentile places the CVE above roughly 89 percent of scored CVEs, and the score is a model estimate, not observed activity [4].
- Public proof of concept: NVD lists a GitHub issue and a releases page for rubyzip, but the evidence pack does not show exploit code or confirm its contents [1].
- Threat actors, campaigns and targeted sectors: none are named in the evidence pack.
No public evidence in the pack is not proof that exploitation has not occurred. The KEV listing and EPSS score should be rechecked before a decision is made.
Detection and exposure assessment
- Find rubyzip in Ruby projects. Check each application's Gemfile.lock and vendored gem directories for a rubyzip entry below 1.2.1 [1]. On a host with RubyGems, run the read-only command gem list rubyzip; it lists installed rubyzip versions. Limitation: it does not see bundled copies inside application directories or container images.
- Find packaged copies on Debian or Ubuntu hosts. Run the read-only command dpkg -l | grep -i zip and compare the installed package versions with the package versions in the Ubuntu notice and the Debian advisory [3, 1]. The package names and versions are not in the evidence pack, so the comparison cannot be completed from this pack.
- Find applications that extract archives. Search application source code for calls into rubyzip's extraction functions, and identify whether the archive input can come from users, email, uploads or external feeds (analyst assessment; the pack gives no code-level detail).
- Run authenticated vulnerability scans, if the scanner supports rubyzip or Debian and Ubuntu package checks. The evidence pack contains no vendor-provided scanner signature.
- Review logs for unexpected file writes by extraction processes. The pack names no log sources, event IDs or fields for this CVE, so any log query must be designed from local logging.
A version match shows that the vulnerable code is present. It does not show that an attacker has reached the vulnerable path.
Remediation
Immediate mitigation (analyst assessment, following from the CWE-22 behaviour; the sources give no workaround):
- Stop extracting archives from untrusted sources with a vulnerable rubyzip until the library is updated. Verify by reviewing scheduled jobs and application configuration. Side effect: loss of the import function.
- Run extraction under an account whose write permissions cover only the intended destination directory. Verify with the file permissions on the target and the service account. This limits which files an overwrite can reach but does not stop the flaw.
Permanent fix:
- Upgrade the rubyzip library to 1.2.1 or later [1]. Update the version constraint in the Gemfile and the lock file, redeploy, and confirm with gem list rubyzip or the lock file. Restart the application so the new code is loaded (analyst assessment).
- On Debian systems, apply the package fix referenced in the Debian advisory listed in NVD [1]. Verify with dpkg and the package versions named in that advisory, which the pack does not include.
- On Ubuntu systems, apply the standard update that the vendor notice describes [3]. Verify the installed version against the package versions listed in USN-9364-1. Ubuntu Pro is mentioned as providing extended support for affected packages [3].
Vendor-confirmed fixes: rubyzip 1.2.1 [1] and the Ubuntu package update [3]. Recommended hardening: validate each archive entry path against the destination directory before writing, and reject entries that resolve outside it (analyst assessment; the sources do not prescribe this code change).
Remediation checklist
- Inventory rubyzip: on each host with RubyGems, run gem list rubyzip; in each application, check Gemfile.lock and vendored gem directories for rubyzip versions below 1.2.1 [1].
- Inventory Debian and Ubuntu packages with dpkg -l | grep -i zip and compare against the Ubuntu notice USN-9364-1 and the Debian advisory referenced in NVD; the fixed package versions are not in the evidence pack [3, 1].
- Identify applications that extract ZIP archives from users, uploads, email or external feeds, and list them as priority targets (analyst assessment).
- Immediately stop extraction of untrusted archives by any application that uses a vulnerable rubyzip until it is upgraded (analyst assessment; no vendor workaround in the pack).
- Restrict the service account that runs extraction so it can write only to the intended destination directory; verify with ls -ld on the destination and the account's permissions (analyst assessment).
- Upgrade rubyzip to 1.2.1 or later in the Gemfile and Gemfile.lock, redeploy, and confirm with gem list rubyzip [1].
- Restart each application after the upgrade so the new library is loaded (analyst assessment).
- On Ubuntu, apply the standard system update described in USN-9364-1, then confirm the installed package versions against the notice [3].
- On Debian, apply the package fix from the Debian advisory listed in NVD, then confirm the installed versions with dpkg [1].
- Add a code-level check that rejects archive entries whose resolved path falls outside the destination directory, and test it with harmless sample archives in a non-production environment (analyst assessment).
- Rerun authenticated vulnerability scans and the inventory checks after the changes, and record the results against the version targets above [1, 3].
- Recheck the CISA KEV catalog and the FIRST EPSS score for CVE-2017-5946 at each review cycle, since exploitation status can change [2, 4].
Evidence gaps
- Not established by the reviewed sources: the root cause in the rubyzip code, including the function and validation step that fails; the NVD and vendor texts do not give code-level detail.
- Not established by the reviewed sources: a complete affected range for rubyzip, since NVD states only below 1.2.1 with no lower bound; the vendor's version history would settle this.
- Not established by the reviewed sources: fixed package versions for Debian (linked advisory DSA-3801 not in the pack) and for Ubuntu (USN-9364-1 refers to specific package versions not listed); the advisory package tables would settle this.
- Not established by the reviewed sources: which Debian and Ubuntu packages ship rubyzip, and which releases are affected, since NVD lists the Debian platform only at the product level.
- Not established by the reviewed sources: confidentiality and availability impact, which the vector rates High but no source describes.
- Not established by the reviewed sources: any confirmed in-the-wild exploitation, threat actor, campaign or sector targeting; the KEV listing is absent and the EPSS score is a model estimate.
- Not established by the reviewed sources: public proof-of-concept code; NVD lists a GitHub issue and releases page, but their contents are not in the pack.
- Not established by the reviewed sources: indicators of compromise, log sources, event IDs or file-write patterns; none are given.
- Not established by the reviewed sources: the publication date of the Ubuntu notice, which the pack lists as not stated.
- Not established by the reviewed sources: whether vendor-supplied workarounds exist; the only vendor-confirmed remedy in the pack is updating the packages.
References
- CVE-2017-5946 record. NIST National Vulnerability Database (NVD), 2026-06-17. https://nvd.nist.gov/vuln/detail/CVE-2017-5946. Accessed 2026-12-02.
- Known Exploited Vulnerabilities Catalog. Cybersecurity and Infrastructure Security Agency (CISA), 2026-12-02. https://www.cisa.gov/known-exploited-vulnerabilities-catalog. Accessed 2026-12-02.
- Vendor bulletin page (ubuntu.com). ubuntu.com. https://ubuntu.com/security/notices/USN-9364-1. Accessed 2026-12-02.
- EPSS score for CVE-2017-5946. FIRST, 2026-12-01. https://api.first.org/data/v1/epss?cve=CVE-2017-5946. Accessed 2026-12-02.
Summary
It was discovered that rubyzip did not properly validate file paths in ZIP archives. If a user or automated system were tricked into extracting a specially crafted ZIP archive, an attacker could possibly use this issue to write arbitrary files outside the destination directory. (CVE-2017-5946) It was discovered that rubyzip did not properly handle symbolic links and absolute paths in ZIP archives…
Severity breakdown
Critical · 9.8
An attacker without an account can exploit this over the network, without any user action.
- Attack from
- the network (remotely)
- Attack complexity
- low (no special conditions)
- Login needed
- no
- User action needed
- no
- Scope
- stays within the vulnerable component
- Impact
- high on confidentiality, integrity and availability
Weakness
- CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected and fixed versions
| Product | Affected versions | Fixed in |
|---|---|---|
| rubyzip project rubyzip | < 1.2.1 | 1.2.1 |
| debian linux | 8.0, 9.0 | — |
References by type
Other references
Frequently asked questions
What is CVE-2017-5946?
CVE-2017-5946 is a path traversal flaw (CWE-22) in the rubyzip library, which does not properly validate file paths stored in ZIP archives, so extracted entries can overwrite files outside the intended destination. NVD scores it CVSS 3.1 9.8 Critical with vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H, scored by NVD as Primary. Weakness type: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (CWE-22).
How severe is CVE-2017-5946?
CVE-2017-5946 has a CVSS 3.1 base score of 9.8 (critical), from NVD. An attacker without an account can exploit this over the network, without any user action.
Is CVE-2017-5946 being exploited?
Not as far as is known: CVE-2017-5946 is not in CISA's Known Exploited Vulnerabilities catalog as of December 2, 2026. EPSS estimates a 3.4% chance that it is exploited in the next 30 days.
Which versions are affected by CVE-2017-5946?
rubyzip project rubyzip < 1.2.1 (fixed in 1.2.1); debian linux 8.0, 9.0.
How do I fix CVE-2017-5946?
Inventory rubyzip: on each host with RubyGems, run gem list rubyzip; in each application, check Gemfile.lock and vendored gem directories for rubyzip versions below 1.2.1. Inventory Debian and Ubuntu packages with dpkg -l | grep -i zip and compare against the Ubuntu notice USN-9364-1 and the Debian advisory referenced in NVD; the fixed package versions are not in the evidence pack. Identify applications that extract ZIP archives from users, uploads, email or external feeds, and list them as priority targets (analyst assessment).