Skip to content

Upgrade jspdf to clear ten critical advisories - #117

Merged
dcruzb merged 1 commit into
v2from
fix/jspdf-advisories
Sep 16, 2026
Merged

dcruzb merged 1 commit into
v2from
fix/jspdf-advisories

Conversation

@dcruzb

@dcruzb dcruzb commented Sep 16, 2026

Copy link
Copy Markdown
Member

jspdf@3.0.1 carries ten critical advisories, including arbitrary JavaScript execution through PDF injection (AcroForm and addJS), local file inclusion / path traversal, and denial of service via malformed GIF and BMP dimensions.

It is a runtime dependency, so it reaches every consumer of the package. This blocks the 2.0.0 release: npm audit would flag the new major on day one.

npm audit --omit=dev
  before   10 critical
  after    found 0 vulnerabilities

Why the major bump is safe

  • jspdf-autotable@5.0.8 declares a peer range of ^2 || ^3 || ^4, so there is no peer conflict.
  • src/lib/tableExport.ts is the only consumer and uses just new jsPDF(), autoTable(doc, { head, body }) and doc.save(). None of them changed in 4.x.

Verified locally

tsc clean, 14 tests passing, build:lib and build-storybook both succeeding with jspdf@4.2.1 installed.

Not in this PR

The 22 advisories left in the full npm audit are all in the dev toolchain (vitest, vite and their trees) and never reach consumers, which is why the CI audit job scopes itself to --omit=dev.

Also unchanged: jspdf, jspdf-autotable, html-to-image and @tanstack/react-table are declared as runtime dependencies, but dist references none of them — Table and tableExport are used only by stories and are not exported. While that holds, moving the four to devDependencies would stop every consumer from installing them. That touches how the table feature is meant to ship, so it is left to whoever owns it.

jspdf 3.0.1 carries ten critical advisories, among them arbitrary
JavaScript execution through PDF injection in the AcroForm and addJS
paths, local file inclusion, and denial of service via malformed GIF and
BMP dimensions. npm audit --omit=dev goes from ten of them to none.

The major bump is safe here: jspdf-autotable 5.0.8 declares a peer range
of ^2 || ^3 || ^4, and tableExport.ts only uses new jsPDF(),
autoTable(doc, ...) and doc.save(), which are unchanged in 4.x.
@sonarqubecloud

Copy link
Copy Markdown

@dcruzb
dcruzb merged commit 7da3231 into v2 Sep 16, 2026
6 checks passed
dcruzb added a commit that referenced this pull request Sep 16, 2026
Upgrade jspdf to clear ten critical advisories
@dcruzb
dcruzb deleted the fix/jspdf-advisories branch September 16, 2026 11:59
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