LiveActive security incident?Get immediate response
CVE Record

CVE-2026-31898: jsPDF has a PDF Object Injection via FreeText color

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.

HighCVSS 8.1Not KEV-listedUpdated
Glexia's TakeAutomated analysishigh

Security readout for executives and security teams

Plain-English summary

Applications using vulnerable jsPDF versions may let an attacker turn an unsanitized annotation color into malicious PDF content, including JavaScript actions. The action might run when a recipient opens or interacts with the generated PDF. This creates serious confidentiality and integrity risk, but requires a vulnerable application flow and user interaction.

Executive priority

Treat as a prompt remediation item for systems generating PDFs from external input. Prioritize confirmation of reachable createAnnotation flows, then upgrade to 4.2.1 or later. Urgency is high because potential impacts are severe, although the available sources do not establish active exploitation or universal exposure.

Technical view

Before jsPDF 4.2.1, createAnnotation does not safely neutralize attacker-controlled color input, permitting arbitrary PDF object injection. The advisory identifies JavaScript actions as one possible injected object. CVSS 3.1 scores it 8.1: network-reachable, low complexity, no privileges required, user interaction required, with high confidentiality and integrity impact.

Likely exposure

Exposure exists where jsPDF earlier than 4.2.1 is deployed and untrusted data can reach createAnnotation's color parameter without effective sanitization. Internet-facing PDF-generation workflows and applications producing PDFs later opened by employees, customers, or partners deserve priority. Merely having jsPDF installed does not establish an exploitable path.

Exploitation context

The supplied record does not identify known active exploitation, and the CVE is not listed as KEV. Exploitation requires attacker control over the relevant input and a recipient opening or interacting with the resulting PDF. Whether an injected action triggers may depend on the PDF viewer and its security settings.

Researcher notes

The issue maps to CWE-116 and CWE-94 and concerns PDF syntax/object injection through the FreeText annotation color value. Review the linked vulnerable code and fixing commit when assessing custom forks or backports. Validate data flow and output structure without assuming every jsPDF installation calls the affected API or every viewer executes injected actions.

Mitigation direction

  • Upgrade jsPDF to version 4.2.1 or later.
  • Sanitize untrusted values before passing them to createAnnotation.
  • Restrict annotation color inputs to an explicit, validated format.
  • Prioritize services that generate PDFs from unauthenticated or externally supplied data.
  • Consult the jsPDF advisory and release notes before deploying the update.

Validation and detection

  • Inventory direct and transitive jsPDF versions across build and deployment artifacts.
  • Search application code for createAnnotation calls and trace the color argument's origin.
  • Confirm untrusted input cannot reach the color parameter without strict validation.
  • Verify production artifacts resolve jsPDF 4.2.1 or later.
  • Run regression tests confirming rejected inputs cannot alter generated PDF object structure.
Prepared
Confidence
high
Sources
5

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cwe · medium confidence lookup

CWE-116: User-session and phishing behavior lookup

Client-side and session-facing weaknesses should be reviewed alongside initial-access and user-execution behaviors. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
cwe · medium confidence lookup

CWE-94: Code execution behavior lookup

Code execution and unsafe deserialization weaknesses often justify reviewing execution behavior and process telemetry. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2026-31898 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
High
CVSS
8.1 (3.1)
Known Exploited
No
Published

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

2CVSS vectors
5Timeline events
2ADP providers
10Source links

SSVC decision data

CISA-ADPCISA Coordinator
Timestamp
Version
2.0.3
Exploitation: noneAutomatable: noTechnical Impact: total

CVSS vector scores

2 official scores

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
8.1CVSS 3.1HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N2.85.2GitHub_M
8.1CVSS 3.1HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N2.85.2redhat-SADP

Vulnerability scoring details

Base CVSS 3.1 score

8.1High
CVSS 3.1 vector shape for CVE-2026-31898Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Privileges Required
NoneLowHigh
User Interaction
NoneRequired
Scope
ChangedUnchanged
Confidentiality Impact
HighLowNone
Integrity Impact
HighLowNone
Availability Impact
HighLowNone

Vulnerability timeline

Timeline events are normalized from CVE metadata, CNA source timelines, ADP timelines, and KEV metadata when present.

  1. CVE reservedCVE Program

    The CVE ID was reserved by the assigning CNA.

  2. ADP timelineredhat-SADP

    Made public.

  3. CVE publishedCVE Program

    The CVE record was published.

  4. ADP timelineredhat-SADP

    Reported to Red Hat.

  5. CVE updatedCVE Program

    The CVE record metadata indicates this as the latest update time.

ADP provider summaries

CISA-ADPCISA ADP Vulnrichment
other:ssvc
redhat-SADPjspdf: jsPDF: Arbitrary code execution via unsanitized input in createAnnotation method
other:Red Hat severity ratingcvssV3_1
  • 2026-03-18T04:02:12.103Z: Reported to Red Hat.
  • 2026-03-18T03:03:43.469Z: Made public.

Source materials

Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
parallaxjsPDF< 4.2.1Listed
Weakness

CWE details

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.

CWE-116 · source CWE mapping

Improper Encoding or Escaping of Output

Improper Encoding or Escaping of Output represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.

CWE-94 · source CWE mapping

Improper Control of Generation of Code ('Code Injection')

Improper Control of Generation of Code ('Code Injection') represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.