Race Condition Affecting jspdf package, versions <4.1.0


Severity

Recommended
0.0
low
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.01% (2nd percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Race Condition vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-JSPDF-15182647
  • published3 Feb 2026
  • disclosed2 Feb 2026
  • creditKarimTantawey

Introduced: 2 Feb 2026

NewCVE-2026-24040  (opens in a new tab)
CWE-362  (opens in a new tab)

How to fix?

Upgrade jspdf to version 4.1.0 or higher.

Overview

jspdf is a PDF Document creation from JavaScript

Affected versions of this package are vulnerable to Race Condition in the addJS function due to the use of a shared module-scoped variable for storing JavaScript content. An attacker can cause sensitive data intended for one user to be included in another user's PDF by making concurrent requests that exploit the shared state.

Note: This is only exploitable when used in a concurrent environment, e.g., on a Node.js web server.

Workaround

This vulnerability can be mitigated by avoiding the use of the addJS method in concurrent server-side environments or by ensuring requests are processed sequentially, such as with a queue.

References

CVSS Base Scores

version 4.0
version 3.1