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
The vulnerability in jsPDF (CVE-2026-31898) arises from improper encoding or escaping of output in the createAnnotation method prior to version 4.2.1. This allows an attacker who can control the method's arguments, such as the color parameter, to inject arbitrary PDF objects including JavaScript actions. Such injected JavaScript can execute when the PDF is opened or interacted with, potentially leading to high impact on confidentiality and integrity. The vulnerability is classified under CWE-116 (Improper Encoding or Escaping of Output) and CWE-94 (Improper Control of Generation of Code). The issue has been addressed in jsPDF version 4.2.1.
Potential Impact
Successful exploitation allows injection of arbitrary PDF objects, including JavaScript actions, which may execute upon opening or interaction with the PDF. This can lead to high confidentiality and integrity impact, such as executing malicious code in the context of the PDF viewer. Availability is not affected. There are no known exploits in the wild at this time.
Mitigation Recommendations
A fix is available in jsPDF version 4.2.1. Users should upgrade to version 4.2.1 or later to remediate this vulnerability. As a workaround, sanitize all user inputs before passing them to the createAnnotation method or any other vulnerable API members to prevent injection of arbitrary PDF objects.
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
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
The vulnerability in jsPDF (CVE-2026-31898) arises from improper encoding or escaping of output in the createAnnotation method prior to version 4.2.1. This allows an attacker who can control the method's arguments, such as the color parameter, to inject arbitrary PDF objects including JavaScript actions. Such injected JavaScript can execute when the PDF is opened or interacted with, potentially leading to high impact on confidentiality and integrity. The vulnerability is classified under CWE-116 (Improper Encoding or Escaping of Output) and CWE-94 (Improper Control of Generation of Code). The issue has been addressed in jsPDF version 4.2.1.
Potential Impact
Successful exploitation allows injection of arbitrary PDF objects, including JavaScript actions, which may execute upon opening or interaction with the PDF. This can lead to high confidentiality and integrity impact, such as executing malicious code in the context of the PDF viewer. Availability is not affected. There are no known exploits in the wild at this time.
Mitigation Recommendations
A fix is available in jsPDF version 4.2.1. Users should upgrade to version 4.2.1 or later to remediate this vulnerability. As a workaround, sanitize all user inputs before passing them to the createAnnotation method or any other vulnerable API members to prevent injection of arbitrary PDF objects.
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: 07/22/2026, 22:43:59 UTC
Last updated: 07/31/2026, 19:22:58 UTC
Views: 162
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.