Skip to content

fix(deps): migrate xlsx to the SheetJS-maintained CDN tarball - #1855

Merged
yannickmonney merged 1 commit into
fix/cve-high-backlog-lockfilefrom
feat/xlsx-sheetjs-cdn-migration
Jun 10, 2026
Merged

yannickmonney merged 1 commit into
fix/cve-high-backlog-lockfilefrom
feat/xlsx-sheetjs-cdn-migration

Conversation

@yannickmonney

Copy link
Copy Markdown
Contributor

What / why

Part of #1803 (security epic) · Part of #1498 (CVE gate ratchet). Stacked on #1854.

Removes the last prod-tree HIGH advisories: npm's xlsx is frozen at 0.18.5 with two open HIGHs (GHSA-4r6h-8v6p-xvw6 prototype pollution, GHSA-5pgg-2g8v-p4x9 ReDoS). SheetJS ships fixed releases off-registry, so the dependency now pins the maintained CDN tarball:

  • services/platform/package.json: xlsx: 0.18.5 → https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz. bun.lock records the tarball integrity hash (the supply-chain control for the off-registry source). Import specifier and all call-site APIs are unchanged (read, write, sheet_to_json, sheet_to_html, aoa_to_sheet, book_new, book_append_sheet).
  • services/platform/convex.json: xlsx removed from node.externalPackages — Convex installs externals from the npm registry by version, which cannot resolve a URL dep; esbuild now bundles the CDN build into the node action (~960 KB, verified to bundle and load).
  • .trivyignore.yaml: the three xlsx accept-risk entries are deleted — the advisories are fixed, not suppressed.
  • Renovate/OSV cannot track URL deps; the pin is bumped manually when cdn.sheetjs.com announces a release (noted at both import sites).

Decision-gate recommendations baked in

  • xlsx remediation: SheetJS CDN tarball pin (recommended) over switching libraries (exceljs) or keeping 0.18.5 with suppressions + compensating controls.

Coordination with #1522

The DOCX/XLSX "Index failed" fix (#1522) touches the same attachment parse path (process_attachments.ts → parseExcel). This migration may independently improve XLSX indexing (0.20.x contains parse fixes absent from 0.18.5) — whichever lands second should re-validate the chat-attachment XLSX path, and the #1522 repro file should be re-run against this build.

Verification

Performed:

  • Round-trip of every call-site API on the CDN build (generate → parse, incl. sheet_to_html for document preview).
  • Full bun audit --audit-level=high → 0 advisories.
  • Platform production build (vite build) emits the vendor-xlsx chunk from the CDN build.
  • esbuild bundle of convex/node_only/documents/internal_actions.ts with xlsx inlined builds (~960 KB) and loads, exporting generateExcel/parseExcel.
  • Targeted tests: file-parsing, use-file-import, process_attachments (39 tests) pass; platform typecheck green.
  • bun run check green at the head of this PR chain.

Manual verification required:

  • Deploy to a dev Convex deployment to confirm the node-action bundle within deploy limits and cold-start is acceptable (xlsx no longer external).
  • Platform Docker image build: bun install --production (Dockerfile line 134) must reach cdn.sheetjs.com from the builder — confirm egress.
  • Live-stack spreadsheet pass: chat-attach .xlsx (attachment indexing), customer/vendor/product import dialogs, agent Excel generation; re-run the Bug: File Upload Shows “Index Failed” for Supported Formats (DOCX, XLSX) #1522 repro file.

Pre-PR checklist

  • Ran bun run check (format, lint, typecheck, all tests).
  • No hand-rolled skeletons — N/A.
  • Updated services/platform/messages/{en,de,fr}.json — N/A.
  • Updated /docs/{en,de,fr}/ — N/A (no user-visible behaviour change; parser version swap).
  • Docs opening/closing bar — N/A.
  • Ran bun run --filter @tale/docs lint and test — N/A.
  • Updated READMEs — N/A.

The npm xlsx release line is frozen at 0.18.5 with two open HIGH
advisories (GHSA-4r6h-8v6p-xvw6 prototype pollution, GHSA-5pgg-2g8v-p4x9
ReDoS) — the last prod-tree blocker for ratcheting the CVE gates to
HIGH (#1498). SheetJS distributes fixed releases via cdn.sheetjs.com,
so the dependency now pins the 0.20.3 CDN tarball; bun.lock records the
integrity hash as the supply-chain control. The import specifier and
all call-site APIs (read, write, sheet_to_json, sheet_to_html,
aoa_to_sheet, book_new, book_append_sheet) are unchanged.

xlsx leaves convex.json node.externalPackages because Convex installs
externals from the npm registry by version, which cannot resolve a URL
dependency — esbuild now bundles the CDN build into the node action
(~960 KB, verified to bundle and load).

The three xlsx accept-risk entries in .trivyignore.yaml are removed:
the advisories are fixed, not suppressed. Renovate/OSV cannot track URL
deps, so the pin is bumped manually when cdn.sheetjs.com announces a
release (noted at the import sites).

Validated: full audit clean at --audit-level=high; parse/generate
round-trip on the CDN build; platform production build emits the
vendor-xlsx chunk; targeted tests for file-parsing, use-file-import and
process_attachments pass.
@yannickmonney
yannickmonney merged commit 913cdb3 into fix/cve-high-backlog-lockfile Jun 10, 2026
@yannickmonney
yannickmonney deleted the feat/xlsx-sheetjs-cdn-migration branch June 10, 2026 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant