Raw vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:NSummary
CVE-2026-31898 is a high-severity Improper Encoding or Escaping of Output (CWE-116) vulnerability in Parall Jspdf. Its CVSS base score is 8.1 (High).
Operationally, exploitation aligns with the MITRE ATT&CK technique Content Injection (T1659); ranked at the 29th percentile by exploit likelihood (below the median); it is not currently listed in the CISA KEV catalog.
The strongest mitigations our analysis identified map to SA-11 (Developer Testing and Evaluation) and SI-10 (Information Input Validation) — see the control section below for these in your framework.
Deeper analysis AI-assisted summary
Synthesised by an AI model from the NVD description and linked references — a reading aid, not an authoritative source.
CVE-2026-31898 is an improper input validation vulnerability in the jsPDF JavaScript library, which generates PDFs in browser or Node.js environments. Versions prior to 4.2.1 are affected, specifically in the `createAnnotation` method where user-controlled arguments, such as the `color` parameter, enable injection of arbitrary PDF objects including JavaScript actions. This stems from CWE-116 (Improper Encoding or Escaping of Output) and carries a CVSS v3.1 base score of 8.1 (AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N). The issue was published on 2026-03-18.
An attacker can exploit this vulnerability by providing malicious, unsanitized input to the `createAnnotation` method during PDF generation. No privileges are required, and exploitation is network-accessible with low complexity, but it demands user interaction, such as a developer or end-user processing the tainted input. Successful injection embeds JavaScript actions in the resulting PDF, which can execute upon opening or interacting with the document, potentially compromising confidentiality and integrity through actions like data exfiltration or unauthorized modifications.
The vulnerability is fixed in jsPDF version 4.2.1, as detailed in the project's release notes, fix commit, and security advisory (GHSA-7x6v-j9x4-qf24). Mitigation involves updating to the patched version; as a workaround, sanitize all user input before passing it to the `createAnnotation` method or related APIs. Source code affected areas are in `src/modules/annotations.js` lines 193-208.
OWASP Top 10 for Web (2025)
EU & UK References
- 🇪🇺 ENISA EUVD: EUVD-2026-12753
Vulnerability Data
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…
more
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.
- CWE(s)
Related Threats
MITRE ATT&CK Enterprise Techniques
CVEs Like This One
Affected Assets
Mitigating Controls
Control response
—
—
—
V1.1.2V1.2.1V1.2.3V1.3.1
Mitigating Controls (NIST 800-53 r5) AI
Developer testing and evaluation finds code paths that accept and execute externally influenced strings.
Input validation directly stops untrusted data from being used to construct executable code without neutralization.
Least privilege limits the damage an injected code fragment can perform once executed.
Requiring documented secure development standards and tools enforces use of safe code-generation APIs and escaping.
Mitigating Controls (NIST CSF 2.0) AI
Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→CSF cross-walk (authority under review) — links open the control.
Secure SDLC practices directly require proper output encoding to prevent injection and message malformation.
PR.DS-10 protects runtime data confidentiality/integrity but has no bearing on neutralizing externally influenced input during code generation, so neither direction shows any preventive effect.
Mitigating Controls (ISO/IEC 27001:2022 Annex A) AI
Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→ISO cross-walk (authority under review) — links open the control.
Secure coding standards explicitly require correct output encoding and escaping to preserve message structure.
Security testing can detect missing or incorrect encoding but does not itself implement the control.
Secure development life cycle mandates output encoding/escaping practices that directly prevent improper encoding.
Application security requirements include explicit rules for safe output handling and encoding.
Secure architecture principles reduce the likelihood of missing encoding but do not prescribe the actual technique.
Controls that restrict unauthorized or malicious code from being introduced via external networks or removable media limit opportunities for an attacker to inject and execute arbitrary code.