CVE-2026-31898: CWE-116: Improper Encoding or Escaping of Output in parallax jsPDF
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.
AI Analysis
Technical Summary
jsPDF versions before 4.2.1 contain an improper encoding or escaping vulnerability (CWE-116) in the createAnnotation method. Unsanitized user input passed to the color parameter can be used to inject arbitrary PDF objects such as JavaScript actions. These injected actions may execute upon opening or interacting with the PDF, potentially resulting in arbitrary code execution or sensitive information disclosure. The vulnerability is tracked as CVE-2026-31898 and has a CVSS 3.1 score of 8.1 (high severity). The issue has been fixed in jsPDF version 4.2.1. Vendor advisories note that mitigation options other than upgrading do not meet criteria for ease of use or stability.
Potential Impact
Successful exploitation allows remote attackers to inject and execute arbitrary JavaScript code within generated PDFs, potentially leading to arbitrary code execution or disclosure of sensitive information. The vulnerability requires user interaction (opening or interacting with the PDF) but does not require privileges or authentication. The integrity and confidentiality of affected systems may be compromised.
Mitigation Recommendations
Upgrade to jsPDF version 4.2.1 or later, which contains the official fix for this vulnerability. As a workaround, sanitize all user input before passing it to the createAnnotation method, especially the color parameter. Vendor advisories indicate that other mitigations do not meet criteria for broad applicability or stability, so upgrading is strongly recommended.
CVE-2026-31898: CWE-116: Improper Encoding or Escaping of Output in parallax jsPDF
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.
CVSS v3.1
Score 8.1high
Affected software
parallax
jsPDF
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
jsPDF versions before 4.2.1 contain an improper encoding or escaping vulnerability (CWE-116) in the createAnnotation method. Unsanitized user input passed to the color parameter can be used to inject arbitrary PDF objects such as JavaScript actions. These injected actions may execute upon opening or interacting with the PDF, potentially resulting in arbitrary code execution or sensitive information disclosure. The vulnerability is tracked as CVE-2026-31898 and has a CVSS 3.1 score of 8.1 (high severity). The issue has been fixed in jsPDF version 4.2.1. Vendor advisories note that mitigation options other than upgrading do not meet criteria for ease of use or stability.
Potential Impact
Successful exploitation allows remote attackers to inject and execute arbitrary JavaScript code within generated PDFs, potentially leading to arbitrary code execution or disclosure of sensitive information. The vulnerability requires user interaction (opening or interacting with the PDF) but does not require privileges or authentication. The integrity and confidentiality of affected systems may be compromised.
Mitigation Recommendations
Upgrade to jsPDF version 4.2.1 or later, which contains the official fix for this vulnerability. As a workaround, sanitize all user input before passing it to the createAnnotation method, especially the color parameter. Vendor advisories indicate that other mitigations do not meet criteria for broad applicability or stability, so upgrading is strongly recommended.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-03-09T21:59:02.689Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Vendor Advisory Urls
- [{"url":"https://access.redhat.com/security/cve/CVE-2026-31898","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:7110","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:7128","vendor":"Red Hat"}]
Threat ID: 69ba1bd6771bdb17491a1d5b
Added to database: 03/18/2026, 03:28:22 UTC
Last enriched: 08/17/2026, 13:15:10 UTC
Last updated: 09/13/2026, 22:18:34 UTC
Views: 190
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.