Junglewise Threat Intelligence

CVE-2026-31938: parallax jsPDF XSS in output function options

CVE-2026-31938 · Severity: critical · CVSS 9.6 · Published 2026-03-18

Executive brief

jsPDF is a popular JavaScript library used by web applications to generate PDF documents directly in the browser. A security flaw allows attackers to inject malicious code into the PDF generation process if the application uses unsanitized user input for certain settings. If a victim generates and opens a PDF under these conditions, the attacker's code could run in their browser, potentially leading to the theft of sensitive data, session hijacking, or unauthorized actions on the user's behalf.

Technical details

A Cross-Site Scripting (XSS) vulnerability exists in jsPDF versions prior to 4.2.1 due to improper neutralization of the 'options' argument in the 'output' function. Specifically, when using method overloads such as 'pdfobjectnewwindow', 'pdfjsnewwindow', or 'dataurlnewwindow', parameters like 'pdfObjectUrl', 'pdfJsUrl', and 'filename' are included in generated HTML strings without sufficient sanitization. An attacker can provide a malicious payload (e.g., breaking out of an iframe or script tag) that executes arbitrary JavaScript in the victim's browser context when the PDF is rendered. This is a client-side vulnerability requiring user interaction (the victim must trigger the PDF generation/opening). The issue is fixed in version 4.2.1 by properly encoding these options.

Affected products

  • parallax jsPDF < 4.2.1
  • Red Hat Red Hat Advanced Cluster Security for Kubernetes 4.8
  • Red Hat Red Hat Advanced Cluster Security for Kubernetes 4.9

Timeline

  • 2026-03-17: patched: Fixes committed and version 4.2.1 released.
  • 2026-03-17: advisory: GitHub Security Advisory GHSA-wfv2-pwc8-crg5 published.
  • 2026-03-18: disclosed: CVE-2026-31938 published to NVD.

References

Related threats