CVE-2021-32013: Xlsx Denial of Service Vulnerability

MODERATE
Advisory Identifier: GHSA-8vcr-vxm8-293m
CVSS 5.5
CWE-400
Published
Advisory Summary

CVE-2021-32013 is a MODERATE (CVSS 5.5) denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Xlsx libraries in the npm ecosystem. The issue involves denial of service in sheetsjs pro. Remediation is available by upgrading affected packages to version 0.17.0.

CVE-2021-32013 at a Glance

CVE Identifier CVE-2021-32013
GHSA Identifier GHSA-8vcr-vxm8-293m
Severity MODERATE
CVSS v3.1 Base Score 5.5
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Xlsx
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 5.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H).

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

How to Fix CVE-2021-32013

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

xlsx fixed: 0.17.0
npm install xlsx@0.17.0
org.webjars.npm:xlsx fixed: 0.17.0
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>xlsx</artifactId>
    <version>0.17.0</version>
</dependency>
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 xlsx

How to Check if You Are Affected

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

npm ls xlsx

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

Note: The npm ls xlsx 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-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Xlsx, 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

SheetJS Pro through 0.16.9 allows attackers to cause a denial of service (memory consumption) via a crafted .xlsx document that is mishandled when read by xlsx.js (issue 2 of 2).

CVE-2021-32013 Affected Xlsx Versions

2 component(s)
Fixed Versions:
0.17.0
Product / Package Ecosystem Affected Versions Fixed Version
xlsx
npm
< 0.17.0
0.17.0
org.webjars.npm:xlsx
Maven
< 0.17.0
0.17.0

References

Frequently Asked Questions

What is CVE-2021-32013?
CVE-2021-32013 is a security vulnerability in Xlsx involving Denial of Service in SheetsJS Pro under CWE-400: Uncontrolled Resource Consumption.
Which Xlsx versions are affected?
Affected versions include releases prior to 0.17.0 across affected packages: xlsx, org.webjars.npm:xlsx.
What version fixes CVE-2021-32013?
Upgrading to 0.17.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is xlsx affected?
Yes, xlsx is affected in releases prior to 0.17.0. Upgrade your dependency to 0.17.0 or later.
What is the CVSS score of CVE-2021-32013?
CVE-2021-32013 has a CVSS v3.1 base score of 5.5 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2021-32013?
CVE-2021-32013 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check npm dependencies for CVE-2021-32013?
Run the dependency tree command: 'npm ls xlsx'. 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-8vcr-vxm8-293m",
  "modified" : "2022-02-08T21:02:07Z",
  "published" : "2021-07-22T19:48:13Z",
  "aliases" : [ "CVE-2021-32013" ],
  "summary" : "Denial of Service in SheetsJS Pro",
  "details" : "SheetJS Pro through 0.16.9 allows attackers to cause a denial of service (memory consumption) via a crafted .xlsx document that is mishandled when read by xlsx.js (issue 2 of 2).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "xlsx"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.17.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.webjars.npm:xlsx"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.17.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-32013"
  }, {
    "type" : "WEB",
    "url" : "https://floqast.com/engineering-blog/post/fuzzing-and-parsing-securely"
  }, {
    "type" : "WEB",
    "url" : "https://sheetjs.com/pro"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/package/xlsx/v/0.17.0"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpujan2022.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-07-19T21:41:18Z",
    "nvd_published_at" : "2021-07-19T14:15:00Z"
  }
}