CVE-2026-31898
MEDIUM 6.5CVSS 3.1jsPDF has a PDF Object Injection via FreeText color
jsPDF is a library to generate PDFs in JavaScript. Prior to version 4.2.1, user control of arguments of the createAnnotation method allows users to inject arbitrary PDF objects, such as JavaScript actions. If given the possibility to pass unsanitized input to the following method, a user can inject arbitrary PDF objects, such as JavaScript actions, which might trigger when the PDF is opened or interacted with the createAnnotation: color parameter. The vulnerability has been fixed in jsPDF@4.2.1. As a workaround, sanitize user input before passing it to the vulnerable API members.
- Published
- 18 Mar 2026
- Last modified
- 10 Sep 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Modified
- Weakness
- CWE-116CWE-94
- Also known as
- GHSA-7x6v-j9x4-qf24
- Sources
- NVDJSONOSV GHSA-7x6v-j9x4-qf24JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | security-advisories@github.com (Secondary) | CVSS 3.1 | HIGH 8.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N |
| NVD | 0b0ca135-0b70-47e7-9f44-1890c2a1c46c (Secondary) | CVSS 3.1 | HIGH 8.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N |
| OSV | GitHub | CVSS 3.1 | HIGH 8.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N |
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | MEDIUM 6.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | parall | jspdfcpe:2.3:a:parall:jspdf:*:*:*:*:*:node.js:*:* |
< 4.2.1 | 4.2.1 |
| OSV | npm | jspdf | < 4.2.1 | 4.2.1 |
References
- https://github.com/parallax/jsPDF/blob/b1607a9391d4cd65ea7ade25998aea8345ae1be3/src/modules/annotations.js#L193-L208 · Patch, WEB
- https://github.com/parallax/jsPDF/commit/4155c4819d5eca284168e51e0e1e81126b4f14b8 · Patch, WEB
- https://github.com/parallax/jsPDF/releases/tag/v4.2.1 · Release Notes, WEB
- https://github.com/parallax/jsPDF/security/advisories/GHSA-7x6v-j9x4-qf24 · Mitigation, Vendor Advisory, WEB
- https://access.redhat.com/errata/RHSA-2026:7110
- https://access.redhat.com/errata/RHSA-2026:7128
- https://access.redhat.com/security/cve/CVE-2026-31898
- https://bugzilla.redhat.com/show_bug.cgi?id=2448547
- https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-31898.json
- https://nvd.nist.gov/vuln/detail/CVE-2026-31898 · ADVISORY
- https://github.com/parallax/jsPDF · PACKAGE
History
- 25 Nov 2026 21:01 UTC · NVD: first stored (published 18 Mar 2026)
- 25 Nov 2026 20:10 UTC · OSV: first stored (published 17 Mar 2026)