CVE-2022-48285: Jszip Path Traversal Vulnerability

MODERATE
Advisory Identifier: GHSA-36fh-84j7-cv5h
CVSS 7.3
CWE-22
Published
Advisory Summary

CVE-2022-48285 is a MODERATE (CVSS 7.3) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Jszip libraries in the npm ecosystem. The issue involves jszip contains path traversal via loadasync. Remediation is available by upgrading affected packages to version 3.8.0.

CVE-2022-48285 at a Glance

CVE Identifier CVE-2022-48285
GHSA Identifier GHSA-36fh-84j7-cv5h
Severity MODERATE
CVSS v3.1 Base Score 7.3
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Jszip
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.3

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:L/I:L/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability Low (A:L)

How to Fix CVE-2022-48285

To remediate this vulnerability, upgrade all affected Jszip dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

jszip fixed: 3.8.0
npm install jszip@3.8.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls jszip

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2022-48285, inspect your project dependencies using npm:

npm ls jszip

Analyze the terminal output to locate any version of Jszip in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.8.0), your application is affected.

Note: The npm ls jszip 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 Jszip, 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

loadAsync in JSZip before 3.8.0 allows Directory Traversal via a crafted ZIP archive.

CVE-2022-48285 Affected Jszip Versions

1 component(s)
Fixed Versions:
3.8.0
Product / Package Ecosystem Affected Versions Fixed Version
jszip
npm
< 3.8.0
3.8.0

References

Frequently Asked Questions

What is CVE-2022-48285?
CVE-2022-48285 is a security vulnerability in Jszip involving JSZip contains Path Traversal via loadAsync under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Jszip versions are affected?
Affected versions include releases prior to 3.8.0 across affected packages: jszip.
What version fixes CVE-2022-48285?
Upgrading to 3.8.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is jszip affected?
Yes, jszip is affected in releases prior to 3.8.0. Upgrade your dependency to 3.8.0 or later.
What is the CVSS score of CVE-2022-48285?
CVE-2022-48285 has a CVSS v3.1 base score of 7.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L.
What CWE is associated with CVE-2022-48285?
CVE-2022-48285 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (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.).
How can I check npm dependencies for CVE-2022-48285?
Run the dependency tree command: 'npm ls jszip'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-36fh-84j7-cv5h",
  "modified" : "2024-11-18T16:26:28Z",
  "published" : "2023-01-29T06:30:52Z",
  "aliases" : [ "CVE-2022-48285" ],
  "summary" : "JSZip contains Path Traversal via loadAsync",
  "details" : "loadAsync in JSZip before 3.8.0 allows Directory Traversal via a crafted ZIP archive.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "jszip"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.8.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-48285"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Stuk/jszip/commit/2edab366119c9ee948357c02f1206c28566cdf15"
  }, {
    "type" : "WEB",
    "url" : "https://exchange.xforce.ibmcloud.com/vulnerabilities/244499"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Stuk/jszip"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Stuk/jszip/compare/v3.7.1...v3.8.0"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20240621-0005"
  }, {
    "type" : "WEB",
    "url" : "https://www.mend.io/vulnerability-database/WS-2023-0004"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-02-01T18:08:04Z",
    "nvd_published_at" : "2023-01-29T05:15:00Z"
  }
}