Vulnerabilities in pkg:npm/unzip-stream
PACKAGEGHSA-6jrj-vc65-c983 is a HIGH (CVSS 7.5) unzip-stream allows arbitrary file write vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Unzip stream libraries in the npm ecosystem. The issue involves unzip-stream allows arbitrary file write via artifact extraction. Remediation is available by upgrading affected packages to version 0.3.2.
pkg:npm/unzip-stream
Vulnerability advisories affecting package pkg:npm/unzip-stream. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-6jrj-vc65-c983 | - | HIGH | unzip-stream allows Arbitrary File Write via artifact extraction |
GHSA-6jrj-vc65-c983 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N).
How to Fix GHSA-6jrj-vc65-c983
To remediate this vulnerability, upgrade all affected Unzip stream dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install unzip-stream@0.3.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls unzip-stream
How to Check if You Are Affected
To determine whether your Node.js application is affected by GHSA-6jrj-vc65-c983, inspect your project dependencies using npm:
npm ls unzip-stream
Analyze the terminal output to locate any version of Unzip stream in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.3.2), your application is affected.
Note: The npm ls unzip-stream command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Unzip stream, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-6jrj-vc65-c983 Affected Unzip stream Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
unzip-stream
|
npm |
< 0.3.2
|
0.3.2
|
References
Frequently Asked Questions
What is GHSA-6jrj-vc65-c983?
Which Unzip stream versions are affected?
What version fixes GHSA-6jrj-vc65-c983?
Is unzip-stream affected?
What is the CVSS score of GHSA-6jrj-vc65-c983?
What CWE is associated with GHSA-6jrj-vc65-c983?
How can I check npm dependencies for GHSA-6jrj-vc65-c983?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-6jrj-vc65-c983",
"modified" : "2024-08-26T15:17:40Z",
"published" : "2024-08-26T15:17:40Z",
"aliases" : [ ],
"summary" : "unzip-stream allows Arbitrary File Write via artifact extraction",
"details" : "### Impact\n\nWhen using the `Extract()` method of unzip-stream, malicious zip files were able to write to paths they shouldn't be allowed to.\n\n### Patches\n\nFixed in 0.3.2\n\n### References\n\n- https://snyk.io/research/zip-slip-vulnerability\n- https://github.com/mhr3/unzip-stream/compare/v0.3.1...v0.3.2\n\n### Credits\n\nJustin Taft from Google",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
}, {
"type" : "CVSS_V4",
"score" : "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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "unzip-stream"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.3.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/mhr3/unzip-stream/security/advisories/GHSA-6jrj-vc65-c983"
}, {
"type" : "WEB",
"url" : "https://github.com/mhr3/unzip-stream/commit/ab67989719abb4dcc774d02de266151905b8d45a"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/mhr3/unzip-stream"
}, {
"type" : "WEB",
"url" : "https://github.com/mhr3/unzip-stream/compare/v0.3.1...v0.3.2"
}, {
"type" : "WEB",
"url" : "https://snyk.io/research/zip-slip-vulnerability"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-08-26T15:17:40Z",
"nvd_published_at" : null
}
}