Exploited now
Vulnerability WatchVulnerabilities, exploits & advisories — updated every 15 minutes
Alerts

Home › CVE › Vulnerabilities

CVE-2017-5946

Critical · CVSS 9.8EPSS 3.4% First seen December 01, 2026
Vulnerabilities

Research article

rubyzip path traversal (CVE-2017-5946) lets crafted ZIP archives overwrite files outside the extraction directory

CVECVE-2017-5946
PublishedDecember 02, 2026 00:25 UTC
Research cut-offDecember 02, 2026 00:20 UTC
Sources reviewed4: 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

FieldValue
CVE IDCVE-2017-5946 [1]
Vendor and productrubyzip project, rubyzip library [1]
ComponentZIP archive extraction, file path handling [3]
Other CPE entry in NVDdebian linux, versions 8.0 and 9.0 [1]
Published2017-02-27T07:59:00 [1]
Last modified2026-06-17T01:21:29 [1]
Record statusModified [1]
CWECWE-22, Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') [1]
CVSS 3.1 base score9.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 scoresNone listed in the evidence pack [1]
Related referencesDebian 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

FactorStatus from the evidenceSource
Access pathNetwork attack vector per the vector string; the evidence pack does not describe how archives reach a targetS1
Adjacent, local or physical accessNot stated beyond the vectorS1
AuthenticationNone required, per the vector (PR:N)S1
User interactionThe 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
ScopeUnchanged, per the vector (S:U)S1
Required configurationSoftware that uses rubyzip to extract archives that an attacker can supply. The evidence pack does not name any such productS3
Vulnerable versionsrubyzip below 1.2.1S1

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

AreaDemonstrated by the sourcesVector-only or plausibleSource
ConfidentialityNot describedScored High in the vectorS1
IntegrityOverwriting files outside the destination directoryScored High in the vectorS3, S1
AvailabilityNot describedScored High in the vectorS1
Authentication and authorizationNot describedNone statedS1
Privilege boundariesThe extraction boundary is crossed (analyst assessment)Which files are reachable depends on the permissions of the extracting process (analyst assessment)S3
Data, privacy and regulatoryNot established by the sourcesNot established by the sourcesNone

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

VendorProduct or componentAffected versionsFixed versionSource and qualification
rubyzip projectrubyzip libraryBelow 1.2.1; no lower bound stated1.2.1NVD CPE configuration [1]
Debianlinux (package containing rubyzip not named)8.0 and 9.0Not given in the evidence packNVD CPE entry only [1]
Canonical Ubunturubyzip package (name not given in the pack)Not statedNot given; the notice refers to specific package versionsVendor 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

  1. 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.
  2. 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.
  3. 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).
  4. Run authenticated vulnerability scans, if the scanner supports rubyzip or Debian and Ubuntu package checks. The evidence pack contains no vendor-provided scanner signature.
  5. 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

  1. 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].
  2. 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].
  3. Identify applications that extract ZIP archives from users, uploads, email or external feeds, and list them as priority targets (analyst assessment).
  4. 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).
  5. 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).
  6. Upgrade rubyzip to 1.2.1 or later in the Gemfile and Gemfile.lock, redeploy, and confirm with gem list rubyzip [1].
  7. Restart each application after the upgrade so the new library is loaded (analyst assessment).
  8. On Ubuntu, apply the standard system update described in USN-9364-1, then confirm the installed package versions against the notice [3].
  9. On Debian, apply the package fix from the Debian advisory listed in NVD, then confirm the installed versions with dpkg [1].
  10. 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).
  11. Rerun authenticated vulnerability scans and the inventory checks after the changes, and record the results against the version targets above [1, 3].
  12. 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

  1. 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. CVE identity, record status and dates, CVSS 3.1 score, vector and scorer, CWE-22 mapping, NVD CPE entries for rubyzip below 1.2.1 (fixed 1.2.1) and Debian linux 8.0 and 9.0, and the listed references.
  2. 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. CISA KEV status: CVE-2017-5946 not listed as of 2026-12-02, with the caveat that absence does not show it was not exploited.
  3. Vendor bulletin page (ubuntu.com). ubuntu.com. https://ubuntu.com/security/notices/USN-9364-1. Accessed 2026-12-02. Vendor bulletin facts: path validation failure in rubyzip, file overwrites outside the destination directory via crafted archives, the user or automated extraction trigger, and the Ubuntu package update and Ubuntu Pro statements.
  4. 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. FIRST EPSS value of 0.0344 with percentile 0.8928 dated 2026-12-01, and its interpretation as a statistical estimate.

Written with AI assistance from the 4 sources listed above, as of the research cut-off; each fact is cited to its source. Check the vendor's advisory before acting.

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…

Excerpt from Ubuntu USN. No official description has been published yet.

Severity breakdown

Critical · 9.8 CVSS 3.1 base score from NVD

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

Vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Weakness

  • CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Affected and fixed versions

ProductAffected versionsFixed in
rubyzip project rubyzip< 1.2.11.2.1
debian linux8.0, 9.0—

From NVD's CPE data; confirm with the vendor advisory before relying on a version number.

References by type

Other references

Details from NVD (public domain).

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

Timeline & sources

References