Skip to content

fix(deps): update dependency jspdf to v3 [security]#184

Open
renovate[bot] wants to merge 1 commit intomasterfrom
renovate/npm-jspdf-vulnerability
Open

fix(deps): update dependency jspdf to v3 [security]#184
renovate[bot] wants to merge 1 commit intomasterfrom
renovate/npm-jspdf-vulnerability

Conversation

@renovate
Copy link
Copy Markdown
Contributor

@renovate renovate Bot commented Mar 21, 2025

This PR contains the following updates:

Package Change Age Confidence
jspdf ^2.5.1 -> ^3.0.0 age confidence

GitHub Vulnerability Alerts

CVE-2025-29907

Impact

User control of the first argument of the addImage method results in CPU utilization and denial of service.

If given the possibility to pass unsanitized image urls to the addImage method, a user can provide a harmful data-url that results in high CPU utilization and denial of service.

Other affected methods are: html, addSvgAsImage.

Example payload:

import { jsPDF } from "jpsdf" 

const doc = new jsPDF();
const payload = 'data:/charset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=scharset=s\x00base64,undefined';

const startTime = performance.now()

try {
 doc.addImage(payload, "PNG", 10, 40, 180, 180, undefined, "SLOW");
} catch (err) {
  const endTime = performance.now()
  console.log(`Call to doc.addImage took ${endTime - startTime} milliseconds`)
}

doc.save("a4.pdf");

Patches

The vulnerability was fixed in jsPDF 3.0.1. Upgrade to jspdf@>=3.0.1

Workarounds

Sanitize image urls before passing it to the addImage method or one of the other affected methods.

Credits

Researcher: Aleksey Solovev (Positive Technologies)

CVE-2025-57810

Impact

User control of the first argument of the addImage method results in CPU utilization and denial of service.

If given the possibility to pass unsanitized image data or URLs to the addImage method, a user can provide a harmful PNG file that results in high CPU utilization and denial of service.

Other affected methods are: html.

Example payload:

import { jsPDF } from "jspdf" 

const payload = new Uint8Array([117, 171, 90, 253, 166, 154, 105, 166, 154])

const doc = new jsPDF();
const startTime = performance.now();
try {
  doc.addImage(payload, "PNG", 10, 40, 180, 180, undefined, "SLOW");
} finally {
  const endTime = performance.now();
  console.log(`Call to doc.addImage took ${endTime - startTime} milliseconds`);
}

Patches

The vulnerability was fixed in jsPDF 3.0.2. Upgrade to jspdf@>=3.0.2.

In jspdf@>=3.0.2, invalid PNG files throw an Error instead of causing very long running loops.

Workarounds

Sanitize image data or URLs before passing it to the addImage method or one of the other affected methods.

Credits

Researcher: Aleksey Solovev (Positive Technologies)


Release Notes

parallax/jsPDF (jspdf)

v3.0.2

Compare Source

This release fixes a security issue where parsing of corrupt PNG images could lead to long running loops and denial of service.

What's Changed

New Contributors

Full Changelog: parallax/jsPDF@v3.0.1...v3.0.2

v3.0.1

Compare Source

This release fixes two security vulnerabilities:

  • Upgrade optional dependency canvg to 3.0.11
  • Fix a ReDoS vulnerability in the addImage method and the methods html and addSvgAsImage, which depend on addImage

v3.0.0

Compare Source

This major release officially drops support for Internet Explorer and fixes a security vulnerability in the html function by updating the optional dependency dompurify to v3.2.4. There are no other breaking changes.

New Contributors

Full Changelog: parallax/jsPDF@v2.5.2...v3.0.0

v2.5.2

Compare Source

This release upgrades the Dompurify dependency to 2.5.4 with fixes a vulnerability with high severity: GHSA-mmhx-hmjr-r674.

It also upgrades fflate, core-js, and @​babel/runtime to more recent versions.

What's Changed


Configuration

📅 Schedule: Branch creation - "" in timezone Europe/Paris, Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@socket-security
Copy link
Copy Markdown

socket-security Bot commented Mar 21, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedjspdf@​2.5.1 ⏵ 3.0.398 +1100 +40100 +182 -1100

View full report

@renovate renovate Bot force-pushed the renovate/npm-jspdf-vulnerability branch from 0225cd9 to 13062aa Compare April 15, 2025 14:34
@sonarqubecloud
Copy link
Copy Markdown

@renovate renovate Bot force-pushed the renovate/npm-jspdf-vulnerability branch from 13062aa to 58e3d63 Compare August 10, 2025 15:29
@renovate renovate Bot force-pushed the renovate/npm-jspdf-vulnerability branch from 58e3d63 to 064dbdd Compare August 19, 2025 11:57
@renovate renovate Bot force-pushed the renovate/npm-jspdf-vulnerability branch from 064dbdd to f002930 Compare August 26, 2025 20:34
@renovate renovate Bot force-pushed the renovate/npm-jspdf-vulnerability branch from f002930 to d36c1a5 Compare September 25, 2025 17:15
@renovate renovate Bot force-pushed the renovate/npm-jspdf-vulnerability branch from d36c1a5 to f5851d0 Compare October 21, 2025 18:46
@renovate renovate Bot force-pushed the renovate/npm-jspdf-vulnerability branch from f5851d0 to 5867848 Compare November 10, 2025 21:52
@renovate renovate Bot force-pushed the renovate/npm-jspdf-vulnerability branch from 5867848 to d8b6fbd Compare November 18, 2025 23:09
@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants