REDHAT-BUG-2440993: High severity jsPDF jsPDF vulnerability
jsPDF is a library to generate PDFs in JavaScript. Prior to 4.2.0, user control of the argument of the addJS method allows an attacker to inject arbitrary PDF objects into the generated document. By crafting a payload that escapes the JavaScript string delimiter, an attacker can execute malicious actions or alter the document structure, impacting any user who opens the generated PDF. The vulnerability has been fixed in jspdf.0. As a workaround, escape parentheses in user-provided JavaScript code before passing them to the addJS method.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
jspdfto a version that resolves this vulnerability.Fixed in 0 - Configuration
As a workaround, escape parentheses in any user-provided JavaScript code before passing it to the jsPDF `addJS` method.
jsPDF addJS input handling = escape parentheses in user-provided JavaScript code before passing to addJS - Compensating control
Do not allow untrusted users to control the argument passed to the jsPDF `addJS` method; only supply JavaScript to `addJS` from trusted sources to prevent PDF object injection (described as possible prior to 4.2.0).
Event History
Frequently Asked Questions
What is the severity of REDHAT-BUG-2440993?
The severity of REDHAT-BUG-2440993 is classified as high, with a score of 7.
How do I fix REDHAT-BUG-2440993?
To fix REDHAT-BUG-2440993, upgrade jsPDF to version 4.2.0 or later.
What causes REDHAT-BUG-2440993?
REDHAT-BUG-2440993 is caused by user control of the arguments in the `addJS` method, allowing for arbitrary PDF object injection.
Who is affected by REDHAT-BUG-2440993?
Developers and users of jsPDF versions prior to 4.2.0 are affected by REDHAT-BUG-2440993.
What potential impact does REDHAT-BUG-2440993 have?
The potential impact of REDHAT-BUG-2440993 includes the ability for attackers to execute malicious code within generated PDF documents.