Skip to content

security: upgrade xlsx 0.18.5 → 0.20.3 (prototype pollution + ReDoS) - #568

Open
coderdailyone wants to merge 1 commit into
andrewyng:mainfrom
coderdailyone:security/xlsx-cdn-0.20.3
Open

security: upgrade xlsx 0.18.5 → 0.20.3 (prototype pollution + ReDoS)#568
coderdailyone wants to merge 1 commit into
andrewyng:mainfrom
coderdailyone:security/xlsx-cdn-0.20.3

Conversation

@coderdailyone

Copy link
Copy Markdown

Fixes #516.

The spreadsheet preview (SheetViewer) parses untrusted workspace files with XLSX.read() from xlsx@0.18.5, which is affected by two CVEs:

CVE Advisory Type Fixed in
CVE-2023-30533 GHSA-4r6h-8v6p-xvw6 Prototype pollution in XLSX.read() 0.19.3
CVE-2024-22363 GHSA-5pgg-2g8v-p4x9 ReDoS in XLSX.read() 0.20.2

The npm xlsx package is frozen at 0.18.5 and will never receive the fix — SheetJS distributes current builds only from their CDN, so npm audit can't resolve it. This points the dependency at SheetJS's official CDN tarball (their documented install method) at 0.20.3, which carries both fixes.

Why the CDN URL

It's the vendor's only supported channel for current versions — the registry package is intentionally abandoned upstream. Same package, pinned to an exact immutable tarball with an integrity hash in the lockfile.

No code change

XLSX.read(base64, {type:"base64"}) and XLSX.utils.sheet_to_json(...) are unchanged across these versions. tsc --noEmit passes clean. The lockfile shrinks by ~91 lines because 0.20.x bundles the former transitive deps (cfb, codepage, crc-32, ssf, adler-32, frac, wmf, word) into the main package.

Verification

  • npm ci from the regenerated lockfile succeeds; installed xlsx.version === "0.20.3".
  • tsc --noEmit: clean.
  • No unit test references xlsx; the GUI vitest failures in my sandbox are a local React-testing-library/esbuild env issue, reproduced identically on main with the old dependency (so unrelated to this change).

🤖 Generated with Claude Code

https://claude.ai/code/session_01CLxsdFGXjdztTRNHjNgPXP

The spreadsheet preview parses untrusted workspace files with
XLSX.read() from xlsx@0.18.5, which is affected by:

  CVE-2023-30533 (GHSA-4r6h-8v6p-xvw6)  prototype pollution, fixed 0.19.3
  CVE-2024-22363 (GHSA-5pgg-2g8v-p4x9)  ReDoS,               fixed 0.20.2

The npm 'xlsx' package is frozen at 0.18.5 and will never receive the
fix — SheetJS ships current builds only from their CDN, so npm-audit
workflows can't resolve this. Point the dependency at SheetJS's official
CDN tarball (their documented install method) at 0.20.3, which carries
both fixes.

No code change: XLSX.read + XLSX.utils.sheet_to_json are unchanged across
these versions (tsc --noEmit passes). The lockfile shrinks because 0.20.x
bundles the former transitive deps (cfb, codepage, crc-32, ssf, …).

Fixes andrewyng#516

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CLxsdFGXjdztTRNHjNgPXP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant