The xlsx npm vulnerability: why npm audit fix can't fix it

If your project depends on xlsx (SheetJS), npm audit reports two high-severity advisories, CVE-2023-30533 and CVE-2024-22363, and says “No fix available”. Both are fixed, just not on npm. This page explains what the advisories cover, who is exposed, and how to clear them.

Last checked against the npm registry and the GitHub Advisory Database on 2026-10-29.

Short answer

  • For most projects the right fix is to install the current SheetJS (0.20.3) from the SheetJS CDN. It keeps the same API and clears both advisories. Option A.
  • If you need the package to come from the npm registry, a community republish (@e965/xlsx) exists. Option B.
  • If you only read spreadsheets, you can replace SheetJS with a read-only parser such as TabularJS. Option C.

What npm audit reports

A fresh install of xlsx from npm, audited with npm 11 on Node.js 24:

terminalbash
$ npm install xlsx
$ npm audit
# npm audit report

xlsx  *
Severity: high
Prototype Pollution in sheetJS - https://github.com/advisories/GHSA-4r6h-8v6p-xvw6
SheetJS Regular Expression Denial of Service (ReDoS) - https://github.com/advisories/GHSA-5pgg-2g8v-p4x9
No fix available
node_modules/xlsx

1 high severity vulnerability

Some issues need review, and may require choosing
a different dependency.

npm audit fix prints the same report and changes nothing. So doesnpm audit fix --force. The reason:

If xlsx comes in through another package, find out which one and which version you actually have:

terminalbash
$ npm ls xlsx
[email protected]
`-- [email protected]

What each advisory means in practice

AdvisoryTypeAffectedFixed inGitHub rating
CVE-2023-30533
GHSA-4r6h-8v6p-xvw6
Prototype pollution (CWE-1321)< 0.19.30.19.3 (CDN only)High, CVSS 7.8
CVE-2024-22363
GHSA-5pgg-2g8v-p4x9
Regular expression denial of service (CWE-1333)< 0.20.20.20.2 (CDN only)High, CVSS 7.5

CVE-2023-30533: prototype pollution

SheetJS CE up to 0.19.2 is vulnerable to prototype pollution “when reading specially crafted files”. A crafted spreadsheet can add properties toObject.prototype in the process that parses it, so every object in that process appears to have them. What an attacker can do with that depends on your code: it matters most where code checks for a property that is normally absent (anisAdmin flag, an options object, a template setting).

The 0.19.3 changelog lists the fix next to “XLSX Ensure comment address is valid”, and the code change adds that check where cell comments are read. We confirmed the path locally: an XLSX file with a crafted comment cell reference added a property to Object.prototype when read with 0.18.5, and did not with 0.20.2.

SheetJS's own advisory states that workflows that do not read arbitrary files, such as exporting data to spreadsheet files, are unaffected. It also scores the issue lower than GitHub does (CVSS 5.3, Medium, versus 7.8).

CVE-2024-22363: ReDoS

SheetJS CE before 0.20.2 uses regular expressions that can take a very long time on crafted input. Neither the GitHub advisory nor the SheetJS advisory names the exact function. The 0.20.2 changelog says “Reworked parsing methods to avoid slow regexes (CVE-2024-22363)”, and the changed code is in the file readers (XML tag, shared string, style and document property parsing). The effect is availability only: parsing one malicious file can keep the CPU busy, which blocks the Node.js event loop for every other request on that process, or freezes the browser tab.

Who is exposed

Even if you are in the low-risk group, an audit that never goes clean hides new findings. Upgrading is cheap, so most teams should do it anyway.

Option A: install the patched SheetJS from its CDN

This is what SheetJS recommends, and it is the best fit if you write spreadsheets, use formula results, or rely on SheetJS-specific APIs. The current release is0.20.3. Check theSheetJS installation docsfor newer versions.

terminalbash
# npm
npm rm --save xlsx
npm i --save https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz

# pnpm
pnpm rm xlsx
pnpm install --save https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz

# Yarn (newer Yarn releases need the xlsx@ prefix)
yarn remove xlsx
yarn add xlsx@https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz

After the install, the audit is clean:

terminalbash
$ npm audit
found 0 vulnerabilities

$ npm ls xlsx
[email protected]
`-- [email protected]

npm audit does check CDN installs: in our test an install of 0.19.3 from the CDN still reported the ReDoS advisory. The clean result above comes from the version, not from the URL.

What changes in package.json and the lockfile

package.jsonjson
{
  "dependencies": {
    "xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz"
  }
}

Vendoring the tarball

SheetJS recommends keeping a local copy so your builds do not depend on its infrastructure:

terminalbash
mkdir -p vendor
curl -L -o vendor/xlsx-0.20.3.tgz https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz
npm i --save file:vendor/xlsx-0.20.3.tgz
git add vendor/xlsx-0.20.3.tgz

When xlsx is a dependency of a dependency

Upgrade the package that pulls it in first. For example, node-xlsx 0.24.0 already depends on SheetJS 0.20.2 from the CDN and is affected by neither advisory, while 0.22.0 and earlier pull xlsx from npm and 0.23.0 pulls 0.19.3 (still affected by the ReDoS advisory). If the parent package has no fixed release, force the version with npm overrides:

package.jsonjson
{
  "overrides": {
    "xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz"
  }
}

pnpm uses pnpm.overrides and Yarn uses resolutions for the same purpose. Make sure the parent package works with the newer SheetJS before you ship.

Option B: a republished fork on npm (@e965/xlsx)

@e965/xlsx(about 1.5 million downloads a week) is not a code fork. It is a republish of SheetJS by an independent maintainer. A GitHub Actions workflow ine965/sheetjs-npm-publishertakes new releases from the SheetJS CDN and publishes them to npm. Its current version is 0.20.3, and we checked that its xlsx.js and xlsx.mjs are byte-identical to the CDN tarball. Only README.md andpackage.json differ.

terminalbash
# Keep "xlsx" as the import name with an npm alias
npm i xlsx@npm:@e965/xlsx

# package.json now contains:
#   "xlsx": "npm:@e965/xlsx@^0.20.3"

Pros

  • A normal registry package: semver ranges, registry mirrors and update bots work.
  • Same SheetJS code and API, so no other code changes.

Cons

  • Not published or endorsed by SheetJS. You are trusting one more publisher with code that runs in your app.
  • The advisories are filed against the package name xlsx, so a clean npm audit says nothing about @e965/xlsx. Check the version yourself.
  • It only updates when the workflow runs and SheetJS releases.

Option C: if you only read spreadsheets, use TabularJS

Many projects use SheetJS for one thing: turning an uploaded file into rows. If that is you, a read-only parser can replace it. TabularJSis MIT-licensed and published on npm (tabularjs, currently 2.2.0). It has no writer. It reads XLSX, XLS, ODS, CSV, HTML tables and more than ten other formats in Node.js and the browser. It is built to parse untrusted uploads: decompressed XLSX, ODS and Numbers entries are capped against zip bombs, memory allocation for .xlsfiles is limited to the size of the container, and formulas are never evaluated. SeeSecurity and limits.

Switching libraries does not make any parser free of bugs. Choose this option because a smaller, read-only dependency fits your use case, not as a security guarantee.

Node.js

before.jsjs
import * as XLSX from 'xlsx';
import fs from 'fs';

const workbook = XLSX.read(fs.readFileSync('./upload.xlsx'));
const sheet = workbook.Sheets[workbook.SheetNames[0]];
const rows = XLSX.utils.sheet_to_json(sheet, { header: 1 });
after.jsjs
import tabularjs from 'tabularjs';

// A path, a Buffer, a Uint8Array or an ArrayBuffer
const result = await tabularjs('./upload.xlsx');
const rows = result.worksheets[0].data; // rows[row][col]

for (const sheet of result.worksheets) {
    console.log(sheet.worksheetName, sheet.data.length);
}

Browser upload

before.jsjs
input.addEventListener('change', async (e) => {
    const workbook = XLSX.read(await e.target.files[0].arrayBuffer());
    const sheet = workbook.Sheets[workbook.SheetNames[0]];
    render(XLSX.utils.sheet_to_json(sheet, { header: 1 }));
});
after.jsjs
import tabularjs from 'tabularjs';

input.addEventListener('change', async (e) => {
    const result = await tabularjs(e.target.files[0]);
    render(result.worksheets[0].data);
});

Rows as objects

records.jsjs
// SheetJS: XLSX.utils.sheet_to_json(sheet) returns one object per row,
// keyed by the first row. With TabularJS, build the objects yourself:
const [header, ...rows] = result.worksheets[0].data;
const records = rows.map((row) =>
    Object.fromEntries(header.map((name, i) => [name, row[i]]))
);

Differences to check before you switch

FAQ

Why does npm audit fix not fix the xlsx vulnerability?

The fixed SheetJS releases (0.19.3 and later, 0.20.2 and later) were never published to the npm registry. The newest xlsx on npm is 0.18.5, from March 2022, and both advisories list no patched version on npm. npm audit fix, with or without --force, only installs versions from the registry, so it has nothing to upgrade to and reports "No fix available".

Which xlsx version fixes CVE-2023-30533 and CVE-2024-22363?

CVE-2023-30533 (prototype pollution) is fixed in SheetJS 0.19.3 and CVE-2024-22363 (ReDoS) in 0.20.2. Both are distributed from the SheetJS CDN at cdn.sheetjs.com. At the time of writing the current version is 0.20.3, installed with npm i https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz.

Is xlsx 0.18.5 safe to use?

Both advisories are about reading crafted files. SheetJS states that workflows that do not read arbitrary files, such as exporting data to spreadsheets, are not affected by CVE-2023-30533. If your application parses spreadsheets that come from users or other outside sources, you are in the affected group and should upgrade. Upgrading from the SheetJS CDN also clears the npm audit report.

Is node-xlsx affected?

It depends on the node-xlsx version. node-xlsx 0.22.0 and earlier depend on xlsx from the npm registry (0.18.5 or older), so they are affected by both advisories. node-xlsx 0.23.0 depends on SheetJS 0.19.3 from the CDN, which is still affected by CVE-2024-22363. node-xlsx 0.24.0 depends on SheetJS 0.20.2 from the CDN, which is affected by neither. Upgrading node-xlsx to 0.24.0 is enough.

Is @e965/xlsx an official SheetJS package?

No. @e965/xlsx is published by an independent maintainer. A GitHub Actions workflow in the e965/sheetjs-npm-publisher repository takes new SheetJS releases from the SheetJS CDN and republishes them to npm. Its 0.20.3 release ships the same xlsx.js and xlsx.mjs files as the CDN tarball. It is convenient, but it adds a third-party publisher to your supply chain.

Can TabularJS replace SheetJS?

Only if you read spreadsheets and never write them. TabularJS is a read-only, MIT-licensed parser on npm that returns each worksheet as a 2D array. It has no writer, and it returns formulas as text such as "=SUM(A1:A3)" instead of computed values. If you export spreadsheets or need calculated results, upgrade SheetJS from its CDN instead.

Sources

Only reading files?

Compare TabularJS and SheetJS feature by feature, or go straight to the docs.