Skip to main content
EPSS 0.4%top 71%

CVE-2026-31898: CWE-116: Improper Encoding or Escaping of Output in parallax jsPDF

0
High
VulnerabilityCVE-2026-31898cvecve-2026-31898cwe-116gcvecwe-94
Published: 03/18/2026 (03/18/2026, 03:03:43 UTC)
Source: CVE Database V5
Vendor/Project: parallax
Product: 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

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
None
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N

Affected software

parallax

jsPDF

Affected versions
<4.2.1
jspdf
pkg:npm/jspdf
Affected versions
<4.2.1

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

AILast updated: 08/17/2026, 13:15:10 UTC

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses