{"id":"CVE-2026-24040","aliases":["CLSA-2026-1773447392","CLSA-2026-1773620212","CLSA-2026-1780534264","CLSA-2026-1780966320","EUVD-2026-5292","GHSA-cjw8-79x6-5cj4"],"status":"published","title":"jsPDF has a Shared State Race Condition in addJS Plugin","description":"jsPDF is a library to generate PDFs in JavaScript. Prior to 4.1.0, the addJS method in the jspdf Node.js build utilizes a shared module-scoped variable (text) to store JavaScript content. When used in a concurrent environment (e.g., a Node.js web server), this variable is shared across all requests. If multiple requests generate PDFs simultaneously, the JavaScript content intended for one user may be overwritten by a subsequent request before the document is generated. This results in Cross-User Data Leakage, where the PDF generated for User A contains the JavaScript payload (and any embedded sensitive data) intended for User B. Typically, this only affects server-side environments, although the same race conditions might occur if jsPDF runs client-side. The vulnerability has been fixed in jsPDF@4.1.0.","severity":{"version":"4.0","score":6.3,"vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-10","score":0.00278,"percentile":0.20386,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-200","CWE-362"],"published":"2026-02-02T18:20:02Z","modified":"2026-10-28T02:30:45Z","fixes":[{"ecosystem":"npm","package":"jspdf","fixed_in":["4.1.0"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"jspdf","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"4.0.0"},{"fixed":"4.1.0"}]}]},{"source":"osv","ecosystem":"TuxCare:npm","package":"jspdf","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.0.4-tuxcare.0"},{"fixed":"3.0.4-tuxcare.4"}]}],"versions":["3.0.4","3.0.4-tuxcare.1","3.0.4-tuxcare.2","3.0.4-tuxcare.3"],"bundled":4},{"source":"osv","ecosystem":"TuxCare:npm","package":"jspdf","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.5.2-tuxcare.0"},{"fixed":"2.5.2-tuxcare.6"}]}],"versions":["2.5.2","2.5.2-tuxcare.1","2.5.2-tuxcare.2","2.5.2-tuxcare.3","2.5.2-tuxcare.4","2.5.2-tuxcare.5"],"bundled":4},{"source":"osv","ecosystem":"TuxCare:npm","package":"jspdf","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.5.1-tuxcare.0"},{"fixed":"2.5.1-tuxcare.1"}]}],"versions":["2.5.1"],"bundled":12},{"source":"osv","ecosystem":"TuxCare:npm","package":"jspdf","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"1.4.1-tuxcare.0"},{"fixed":"1.4.1-tuxcare.2"}]}],"versions":["1.4.1","1.4.1-tuxcare.1"],"bundled":9},{"source":"osv","ecosystem":"npm","package":"jspdf","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"4.1.0"}]}]}],"products":[{"vendor":"parall","product":"jspdf"},{"vendor":"parallax","product":"jspdf"}],"references":[{"url":"https://github.com/parallax/jsPDF/security/advisories/GHSA-cjw8-79x6-5cj4","tags":["x_refsource_CONFIRM","Exploit","Vendor Advisory","advisory","web"]},{"url":"https://github.com/parallax/jsPDF/commit/2863e5c26afef211a545e8c174ab4d5fce3b8c0e","tags":["x_refsource_MISC","Patch","fix","web"]},{"url":"https://github.com/parallax/jsPDF/releases/tag/v4.1.0","tags":["x_refsource_MISC","Release Notes","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-24040","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-cjw8-79x6-5cj4"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/24xxx/CVE-2026-24040.json","tags":["advisory"]},{"url":"https://github.com/parallax/jsPDF","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2026-24040","title":"jsPDF has a Shared State Race Condition in addJS Plugin","description":"jsPDF is a library to generate PDFs in JavaScript. Prior to 4.1.0, the addJS method in the jspdf Node.js build utilizes a shared module-scoped variable (text) to store JavaScript content. When used in a concurrent environment (e.g., a Node.js web server), this variable is shared across all requests. If multiple requests generate PDFs simultaneously, the JavaScript content intended for one user may be overwritten by a subsequent request before the document is generated. This results in Cross-User Data Leakage, where the PDF generated for User A contains the JavaScript payload (and any embedded sensitive data) intended for User B. Typically, this only affects server-side environments, although the same race conditions might occur if jsPDF runs client-side. The vulnerability has been fixed in jsPDF@4.1.0.","status":"published","published":"2026-02-02T20:38:24.732Z","modified":"2026-02-03T15:30:05.465Z","cvss":[{"version":"4.0","score":6.3,"vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N","level":"medium","assessor":"cna"}],"cwes":["CWE-362"],"updated_at":"2026-11-02T14:19:50.24628Z"}],"euvd":[{"id":"EUVD-2026-5292","description":"jsPDF is a library to generate PDFs in JavaScript. Prior to 4.1.0, the addJS method in the jspdf Node.js build utilizes a shared module-scoped variable (text) to store JavaScript content. When used in a concurrent environment (e.g., a Node.js web server), this variable is shared across all requests. If multiple requests generate PDFs simultaneously, the JavaScript content intended for one user may be overwritten by a subsequent request before the document is generated. This results in Cross-User Data Leakage, where the PDF generated for User A contains the JavaScript payload (and any embedded sensitive data) intended for User B. Typically, this only affects server-side environments, although the same race conditions might occur if jsPDF runs client-side. The vulnerability has been fixed in jsPDF@4.1.0.","status":"published","published":"2026-02-02T20:38:24Z","modified":"2026-02-03T15:30:05Z","cvss":[{"version":"4.0","score":6.3,"vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N","level":"medium"}],"updated_at":"2026-11-02T19:48:45.084164Z"}],"ghsa":[{"id":"GHSA-cjw8-79x6-5cj4","title":"jsPDF has Shared State Race Condition in addJS Plugin","description":"### Impact\n\nThe addJS method in the jspdf Node.js build utilizes a shared module-scoped variable (text) to store JavaScript content. When used in a concurrent environment (e.g., a Node.js web server), this variable is shared across all requests.\n\nIf multiple requests generate PDFs simultaneously, the JavaScript content intended for one user may be overwritten by a subsequent request before the document is generated. This results in Cross-User Data Leakage, where the PDF generated for User A contains the JavaScript payload (and any embedded sensitive data) intended for User B.\n\nTypically, this only affects server-side environments, although the same race conditions might occur if jsPDF runs client-side.\n\n```js\nimport { jsPDF } from \"jspdf\";\n\nconst docA = new jsPDF();\nconst docB = new jsPDF();\n\n// 1. User A sets their script (stored in shared 'text' variable)\ndocA.addJS('console.log(\"Secret A\");');\n\n// 2. User B sets their script (overwrites shared 'text' variable)\ndocB.addJS('console.log(\"Secret B\");');\n\n// 3. User A saves their PDF (reads current 'text' variable)\ndocA.save(\"userA.pdf\");\n\n// Result: userA.pdf contains \"Secret B\" instead of \"Secret A\"\n```\n\n### Patches\nThe vulnerability has been fixed in jspdf@4.0.1. The fix moves the shared variable into the function scope, ensuring isolation between instances.\n\n### Workarounds\nAvoid using the addJS method in concurrent server-side environments. If usage is required, ensure requests are processed sequentially (e.g., using a queue) rather than in parallel.","status":"published","published":"2026-02-02T18:20:02Z","modified":"2026-02-03T16:12:27Z","cvss":[{"version":"4.0","score":6.3,"vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N","level":"medium"}],"cwes":["CWE-200","CWE-362"],"updated_at":"2026-11-02T14:39:21.558748Z"}],"nvd":[{"id":"CVE-2026-24040","description":"jsPDF is a library to generate PDFs in JavaScript. Prior to 4.1.0, the addJS method in the jspdf Node.js build utilizes a shared module-scoped variable (text) to store JavaScript content. When used in a concurrent environment (e.g., a Node.js web server), this variable is shared across all requests. If multiple requests generate PDFs simultaneously, the JavaScript content intended for one user may be overwritten by a subsequent request before the document is generated. This results in Cross-User Data Leakage, where the PDF generated for User A contains the JavaScript payload (and any embedded sensitive data) intended for User B. Typically, this only affects server-side environments, although the same race conditions might occur if jsPDF runs client-side. The vulnerability has been fixed in jsPDF@4.1.0.","status":"published","published":"2026-02-02T23:16:07.66Z","modified":"2026-06-17T10:22:30.403Z","cvss":[{"version":"4.0","score":6.3,"vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","level":"medium","assessor":"secondary"},{"version":"3.1","score":4.8,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N","level":"medium","assessor":"primary"}],"cwes":["CWE-362"],"updated_at":"2026-11-02T14:12:05.149641Z"}],"osv":[{"id":"CVE-2026-24040","title":"jsPDF has a Shared State Race Condition in addJS Plugin","description":"jsPDF is a library to generate PDFs in JavaScript. Prior to 4.1.0, the addJS method in the jspdf Node.js build utilizes a shared module-scoped variable (text) to store JavaScript content. When used in a concurrent environment (e.g., a Node.js web server), this variable is shared across all requests. If multiple requests generate PDFs simultaneously, the JavaScript content intended for one user may be overwritten by a subsequent request before the document is generated. This results in Cross-User Data Leakage, where the PDF generated for User A contains the JavaScript payload (and any embedded sensitive data) intended for User B. Typically, this only affects server-side environments, although the same race conditions might occur if jsPDF runs client-side. The vulnerability has been fixed in jsPDF@4.1.0.","status":"published","published":"2026-02-02T20:38:24.732Z","modified":"2026-10-28T02:30:45.817693989Z","cvss":[{"version":"4.0","score":6.3,"vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N","level":"medium"}],"cwes":["CWE-362"],"updated_at":"2026-11-02T15:44:59.079784Z"},{"id":"GHSA-cjw8-79x6-5cj4","title":"jsPDF has Shared State Race Condition in addJS Plugin","description":"### Impact\n\nThe addJS method in the jspdf Node.js build utilizes a shared module-scoped variable (text) to store JavaScript content. When used in a concurrent environment (e.g., a Node.js web server), this variable is shared across all requests.\n\nIf multiple requests generate PDFs simultaneously, the JavaScript content intended for one user may be overwritten by a subsequent request before the document is generated. This results in Cross-User Data Leakage, where the PDF generated for User A contains the JavaScript payload (and any embedded sensitive data) intended for User B.\n\nTypically, this only affects server-side environments, although the same race conditions might occur if jsPDF runs client-side.\n\n```js\nimport { jsPDF } from \"jspdf\";\n\nconst docA = new jsPDF();\nconst docB = new jsPDF();\n\n// 1. User A sets their script (stored in shared 'text' variable)\ndocA.addJS('console.log(\"Secret A\");');\n\n// 2. User B sets their script (overwrites shared 'text' variable)\ndocB.addJS('console.log(\"Secret B\");');\n\n// 3. User A saves their PDF (reads current 'text' variable)\ndocA.save(\"userA.pdf\");\n\n// Result: userA.pdf contains \"Secret B\" instead of \"Secret A\"\n```\n\n### Patches\nThe vulnerability has been fixed in jspdf@4.0.1. The fix moves the shared variable into the function scope, ensuring isolation between instances.\n\n### Workarounds\nAvoid using the addJS method in concurrent server-side environments. If usage is required, ensure requests are processed sequentially (e.g., using a queue) rather than in parallel.","status":"published","published":"2026-02-02T18:20:02Z","modified":"2026-09-10T03:50:59.42239007Z","cvss":[{"version":"4.0","score":6.3,"vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N","level":"medium"}],"cwes":["CWE-200","CWE-362"],"updated_at":"2026-11-02T15:46:45.28161Z"},{"id":"CLSA-2026-1773447392","title":"TuxCare security update for jspdf (4 CVEs)","description":"TuxCare rebuilt jspdf to address 4 CVEs. Fixed in 3.0.4-tuxcare.4.","status":"published","published":"2026-08-04T14:52:12Z","modified":"2026-10-15T09:47:28.16494207Z","updated_at":"2026-11-02T15:43:43.621843Z"},{"id":"CLSA-2026-1773620212","title":"TuxCare security update for jspdf (4 CVEs)","description":"TuxCare rebuilt jspdf to address 4 CVEs. Fixed in 2.5.2-tuxcare.6.","status":"published","published":"2026-08-04T14:52:12Z","modified":"2026-10-15T09:47:47.199377827Z","updated_at":"2026-11-02T15:43:43.621843Z"},{"id":"CLSA-2026-1780534264","title":"TuxCare security update for jspdf (12 CVEs)","description":"TuxCare rebuilt jspdf to address 12 CVEs. Fixed in 2.5.1-tuxcare.1.","status":"published","published":"2026-08-04T14:52:35Z","modified":"2026-10-15T09:47:50.75648635Z","updated_at":"2026-11-02T15:43:45.445699Z"},{"id":"CLSA-2026-1780966320","title":"TuxCare security update for jspdf (9 CVEs)","description":"TuxCare rebuilt jspdf to address 9 CVEs. Fixed in 1.4.1-tuxcare.2.","status":"published","published":"2026-08-04T14:52:35Z","modified":"2026-10-15T09:47:50.242378425Z","updated_at":"2026-11-02T15:43:45.445699Z"}]}}
