CVE-2021-23484: Zip local Remote Code Execution Vulnerability

CRITICAL
Advisory Identifier: GHSA-wxj7-97fp-j53j
CVSS 9.8
CWE-668 CWE-29
Published
Advisory Summary

CVE-2021-23484 is a CRITICAL (CVSS 9.8) remote code execution vulnerability (CWE-668: Exposure of Resource to Wrong Sphere) affecting Zip local libraries in the npm ecosystem. The issue involves exposure of resource to wrong sphere in zip-local. Remediation is available by upgrading affected packages to version 0.3.5.

CVE-2021-23484 at a Glance

CVE Identifier CVE-2021-23484
GHSA Identifier GHSA-wxj7-97fp-j53j
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-668: Exposure of Resource to Wrong Sphere
Affected Product Zip local
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 9.8

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

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 High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2021-23484

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

zip-local fixed: 0.3.5
npm install zip-local@0.3.5
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 zip-local

How to Check if You Are Affected

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

npm ls zip-local

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

Note: The npm ls zip-local 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-668: Exposure of Resource to Wrong Sphere, where the product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource. In Zip local, 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

The package zip-local before 0.3.5 are vulnerable to Arbitrary File Write via Archive Extraction (Zip Slip) which can lead to an extraction of a crafted file outside the intended extraction directory.

CVE-2021-23484 Affected Zip local Versions

1 component(s)
Fixed Versions:
0.3.5
Product / Package Ecosystem Affected Versions Fixed Version
zip-local
npm
< 0.3.5
0.3.5

References

Frequently Asked Questions

What is CVE-2021-23484?
CVE-2021-23484 is a security vulnerability in Zip local involving Exposure of Resource to Wrong Sphere in Zip-Local under CWE-668: Exposure of Resource to Wrong Sphere.
Which Zip local versions are affected?
Affected versions include releases prior to 0.3.5 across affected packages: zip-local.
What version fixes CVE-2021-23484?
Upgrading to 0.3.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is zip-local affected?
Yes, zip-local is affected in releases prior to 0.3.5. Upgrade your dependency to 0.3.5 or later.
What is the CVSS score of CVE-2021-23484?
CVE-2021-23484 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2021-23484?
CVE-2021-23484 is classified under CWE-668: Exposure of Resource to Wrong Sphere (The product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource.).
How can I check npm dependencies for CVE-2021-23484?
Run the dependency tree command: 'npm ls zip-local'. 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-wxj7-97fp-j53j",
  "modified" : "2022-02-07T21:20:28Z",
  "published" : "2022-02-01T00:46:01Z",
  "aliases" : [ "CVE-2021-23484" ],
  "summary" : "Exposure of Resource to Wrong Sphere in Zip-Local",
  "details" : "The package zip-local before 0.3.5 are vulnerable to Arbitrary File Write via Archive Extraction (Zip Slip) which can lead to an extraction of a crafted file outside the intended extraction directory.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "zip-local"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.3.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-23484"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Mostafa-Samir/zip-local/commit/6bb9b59733df379ac168aa705790bd8339b4bf9b"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Mostafa-Samir/zip-local/commit/949446a95a660c0752b1db0c654f0fd619ae6085"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Mostafa-Samir/zip-local"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Mostafa-Samir/zip-local/blob/master/main.js%23L365"
  }, {
    "type" : "WEB",
    "url" : "https://snyk.io/vuln/SNYK-JS-ZIPLOCAL-2327477"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-29", "CWE-668" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-01-31T19:55:36Z",
    "nvd_published_at" : "2022-01-28T22:15:00Z"
  }
}