CVE-2026-31898
published high CVSS 3.1 · 8.1jsPDF has a PDF Object Injection via FreeText color
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| parallax | — | jsPDF< 4.2.1 | Affected | Not stated | GitHub_M |
| Red Hat | — | advanced-cluster-security/rhacs-main-rhel8Red Hat Advanced Cluster Security 4.8 · 1775594119 and later · Other versions: affected | Unaffected | Not stated | redhat-SADP |
| Red Hat | — | advanced-cluster-security/rhacs-main-rhel8Red Hat Advanced Cluster Security 4.9 · 1775594284 and later · Other versions: affected | Unaffected | Not stated | redhat-SADP |
Description
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 [email protected]. As a workaround, sanitize user input before passing it to the vulnerable API members.
A flaw was found in jsPDF, a JavaScript library used for generating PDF documents. This vulnerability allows a remote attacker to inject arbitrary PDF objects, including JavaScript actions, into a generated PDF. This can occur if unsanitized user input is provided to the `createAnnotation` method's `color` parameter. When a user opens or interacts with the specially crafted PDF, these injected actions may execute, potentially leading to arbitrary code execution or sensitive information disclosure.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 8.1 / 10
- Severity
- high
- Provider
- GitHub_M · cna
- Vector string
- CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N
Additional Assessments
| Version | Score | Severity | Provider | Vector | Scenarios |
|---|---|---|---|---|---|
| 3.1 | 8.1 | high | redhat-SADP · adp | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N | — |
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| parallax | jsPDF | < 4.2.1 (affected) | GitHub_M · cna |
| Red Hat | Red Hat Advanced Cluster Security 4.8 | 1775594119 and later (unaffected · rpm)Default: affected | redhat-SADP · adp |
| Red Hat | Red Hat Advanced Cluster Security 4.9 | 1775594284 and later (unaffected · rpm)Default: affected | redhat-SADP · adp |
Weaknesses
2- CWE-116 CWE-116: Improper Encoding or Escaping of Output
- CWE-94 Improper Control of Generation of Code ('Code Injection')
References
9- 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
- RHBZ#2448547 https://bugzilla.redhat.com/show_bug.cgi?id=2448547
- https://github.com/parallax/jsPDF/blob/b1607a9391d4cd65ea7ade25998aea8345ae1be3/src/modules/annotations.js#L193-L208
- https://github.com/parallax/jsPDF/commit/4155c4819d5eca284168e51e0e1e81126b4f14b8
- https://github.com/parallax/jsPDF/releases/tag/v4.2.1
- https://github.com/parallax/jsPDF/security/advisories/GHSA-7x6v-j9x4-qf24
- https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-31898.json
Provider assertions
3GitHub_M · cna
jsPDF has a PDF Object Injection via FreeText color
redhat-SADP · adp
jspdf: jsPDF: Arbitrary code execution via unsanitized input in createAnnotation method
CISA-ADP · adp
CISA ADP Vulnrichment
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- ace57d3de99c9a1d558b77fbf5fd6ab42f74b6fe55739684a9fcaf3627a0bf20
- Ingested
- 23 Sep 2026, 09:09:43 UTC
- Source record
- Official CVE record