CVE-2026-31898
March 18, 2026
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.
Affected Packages
https://github.com/parallax/jsPDF.git (GITHUB):
Affected version(s) =v4.2.0 <v4.2.1Fix Suggestion:
Update to version v4.2.1jspdf (NPM):
Affected version(s) >=1.0.272 <4.2.1Fix Suggestion:
Update to version 4.2.1Related Resources (6)
Do you need more information?
Contact UsCVSS v4
Base Score:
8.6
Attack Vector
NETWORK
Attack Complexity
LOW
Attack Requirements
NONE
Privileges Required
NONE
User Interaction
PASSIVE
Vulnerable System Confidentiality
HIGH
Vulnerable System Integrity
HIGH
Vulnerable System Availability
NONE
Subsequent System Confidentiality
NONE
Subsequent System Integrity
NONE
Subsequent System Availability
NONE
CVSS v3
Base Score:
8.1
Attack Vector
NETWORK
Attack Complexity
LOW
Privileges Required
NONE
User Interaction
REQUIRED
Scope
UNCHANGED
Confidentiality
HIGH
Integrity
HIGH
Availability
NONE
Weakness Type (CWE)
Improper Encoding or Escaping of Output
EPSS
Base Score:
0.04