GHSA-9VJF-QC39-JPRP
Vulnerability from github – Published: 2026-02-19 19:32 – Updated: 2026-02-19 19:32
VLAI?
Summary
jsPDF has a PDF Object Injection via Unsanitized Input in addJS Method
Details
Impact
User control of the argument of the addJS method allows an attacker to inject arbitrary PDF objects into the generated document. By crafting a payload that escapes the JavaScript string delimiter, an attacker can execute malicious actions or alter the document structure, impacting any user who opens the generated PDF.
import { jsPDF } from "jspdf";
const doc = new jsPDF();
// Payload:
// 1. ) closes the JS string.
// 2. > closes the current dictionary.
// 3. /AA ... injects an "Additional Action" that executes on focus/open.
const maliciousPayload = "console.log('test');) >> /AA << /O << /S /JavaScript /JS (app.alert('Hacked!')) >> >>";
doc.addJS(maliciousPayload);
doc.save("vulnerable.pdf");
Patches
The vulnerability has been fixed in jspdf@4.2.0.
Workarounds
Escape parentheses in user-provided JavaScript code before passing them to the addJS method.
References
https://github.com/ZeroXJacks/CVEs/blob/main/2026/CVE-2026-25755.md
Severity ?
8.1 (High)
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "jspdf"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "4.2.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-25755"
],
"database_specific": {
"cwe_ids": [
"CWE-116",
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2026-02-19T19:32:36Z",
"nvd_published_at": "2026-02-19T15:16:12Z",
"severity": "HIGH"
},
"details": "### Impact\n\nUser control of the argument of the `addJS` method allows an attacker to inject arbitrary PDF objects into the generated document. By crafting a payload that escapes the JavaScript string delimiter, an attacker can execute malicious actions or alter the document structure, impacting any user who opens the generated PDF.\n\n```js\nimport { jsPDF } from \"jspdf\";\nconst doc = new jsPDF();\n// Payload:\n// 1. ) closes the JS string.\n// 2. \u003e closes the current dictionary.\n// 3. /AA ... injects an \"Additional Action\" that executes on focus/open.\nconst maliciousPayload = \"console.log(\u0027test\u0027);) \u003e\u003e /AA \u003c\u003c /O \u003c\u003c /S /JavaScript /JS (app.alert(\u0027Hacked!\u0027)) \u003e\u003e \u003e\u003e\";\n\ndoc.addJS(maliciousPayload);\ndoc.save(\"vulnerable.pdf\");\n```\n\n### Patches\nThe vulnerability has been fixed in jspdf@4.2.0.\n\n### Workarounds\nEscape parentheses in user-provided JavaScript code before passing them to the `addJS` method.\n### References\nhttps://github.com/ZeroXJacks/CVEs/blob/main/2026/CVE-2026-25755.md",
"id": "GHSA-9vjf-qc39-jprp",
"modified": "2026-02-19T19:32:36Z",
"published": "2026-02-19T19:32:36Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/parallax/jsPDF/security/advisories/GHSA-9vjf-qc39-jprp"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-25755"
},
{
"type": "WEB",
"url": "https://github.com/parallax/jsPDF/commit/56b46d45b052346f5995b005a34af5dcdddd5437"
},
{
"type": "WEB",
"url": "https://github.com/ZeroXJacks/CVEs/blob/main/2026/CVE-2026-25755.md"
},
{
"type": "PACKAGE",
"url": "https://github.com/parallax/jsPDF"
},
{
"type": "WEB",
"url": "https://github.com/parallax/jsPDF/releases/tag/v4.2.0"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N",
"type": "CVSS_V3"
}
],
"summary": "jsPDF has a PDF Object Injection via Unsanitized Input in addJS Method"
}
Loading…
Loading…
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Loading…
Loading…