Skip to content

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

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

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

Conversation

@renovate
Copy link
Copy Markdown
Contributor

@renovate renovate bot commented Mar 18, 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


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 18, 2025

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report

@renovate renovate bot changed the title fix(deps): update dependency jspdf to v3 [security] fix(deps): update dependency jspdf to v3 [security] - autoclosed Mar 19, 2025
@renovate renovate bot closed this Mar 19, 2025
@renovate renovate bot deleted the renovate/npm-jspdf-vulnerability branch March 19, 2025 00:57
@renovate renovate bot changed the title fix(deps): update dependency jspdf to v3 [security] - autoclosed fix(deps): update dependency jspdf to v3 [security] Mar 24, 2025
@renovate renovate bot reopened this Mar 24, 2025
@renovate renovate bot force-pushed the renovate/npm-jspdf-vulnerability branch from 4c9fdb5 to 9b3b17b Compare March 24, 2025 15:34
@renovate renovate bot force-pushed the renovate/npm-jspdf-vulnerability branch from 9b3b17b to 3e3d5cc Compare March 28, 2025 11:23
@sonarqubecloud
Copy link
Copy Markdown

@renovate renovate bot force-pushed the renovate/npm-jspdf-vulnerability branch from 3e3d5cc to 3322f73 Compare April 30, 2025 08:25
@renovate renovate bot force-pushed the renovate/npm-jspdf-vulnerability branch from 3322f73 to cb43d41 Compare May 13, 2025 13:27
@renovate renovate bot force-pushed the renovate/npm-jspdf-vulnerability branch from cb43d41 to e365820 Compare May 16, 2025 07:43
@renovate renovate bot force-pushed the renovate/npm-jspdf-vulnerability branch from e365820 to e5a8394 Compare May 28, 2025 22:02
@renovate renovate bot force-pushed the renovate/npm-jspdf-vulnerability branch from e5a8394 to 4d3ac78 Compare June 3, 2025 11:54
@renovate renovate bot force-pushed the renovate/npm-jspdf-vulnerability branch from 4d3ac78 to 8f6bc83 Compare June 16, 2025 20:21
@renovate renovate bot force-pushed the renovate/npm-jspdf-vulnerability branch from 8f6bc83 to 2606d37 Compare June 27, 2025 14:02
@sonarqubecloud
Copy link
Copy Markdown

@renovate renovate bot force-pushed the renovate/npm-jspdf-vulnerability branch from 2606d37 to ba6c023 Compare August 10, 2025 15:56
@renovate renovate bot force-pushed the renovate/npm-jspdf-vulnerability branch from d672f76 to b370a86 Compare August 26, 2025 21:58
@renovate renovate bot force-pushed the renovate/npm-jspdf-vulnerability branch from b370a86 to e8ac1b3 Compare August 31, 2025 12:22
@renovate
Copy link
Copy Markdown
Contributor Author

renovate bot commented Sep 2, 2025

⚠️ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: package-lock.json
npm warn Unknown env config "store". This will stop working in the next major version of npm.
npm warn ERESOLVE overriding peer dependency
npm warn While resolving: enfants-du-spectacle@1.125.0
npm warn Found: jspdf@2.5.2
npm warn node_modules/jspdf
npm warn   jspdf@"^3.0.0" from the root project
npm warn   1 more (jspdf-autotable)
npm warn
npm warn Could not resolve dependency:
npm warn peer jspdf@"^2.5.1" from jspdf-autotable@3.8.4
npm warn node_modules/jspdf-autotable
npm warn   jspdf-autotable@"^3.5.23" from the root project
npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: @socialgouv/eslint-config-typescript@1.131.0
npm error Found: typescript@5.8.3
npm error node_modules/typescript
npm error   dev typescript@"latest" from the root project
npm error   peerOptional typescript@">=5.1.0" from @prisma/client@6.10.1
npm error   node_modules/@prisma/client
npm error     @prisma/client@"^6.6.0" from the root project
npm error     peer @prisma/client@">=2.26.0 || >=3" from @next-auth/prisma-adapter@1.0.7
npm error     node_modules/@next-auth/prisma-adapter
npm error       @next-auth/prisma-adapter@"^1.0.5" from the root project
npm error   15 more (@typescript-eslint/project-service, ...)
npm error
npm error Could not resolve dependency:
npm error peer typescript@"4" from @socialgouv/eslint-config-typescript@1.131.0
npm error node_modules/@socialgouv/eslint-config-typescript
npm error   dev @socialgouv/eslint-config-typescript@"^1.100.0" from the root project
npm error
npm error Conflicting peer dependency: typescript@4.9.5
npm error node_modules/typescript
npm error   peer typescript@"4" from @socialgouv/eslint-config-typescript@1.131.0
npm error   node_modules/@socialgouv/eslint-config-typescript
npm error     dev @socialgouv/eslint-config-typescript@"^1.100.0" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error /runner/cache/others/npm/_logs/2025-11-18T17_32_38_934Z-eresolve-report.txt
npm error A complete log of this run can be found in: /runner/cache/others/npm/_logs/2025-11-18T17_32_38_934Z-debug-0.log

@renovate renovate bot force-pushed the renovate/npm-jspdf-vulnerability branch from e8ac1b3 to 489c670 Compare September 2, 2025 13:32
@renovate renovate bot force-pushed the renovate/npm-jspdf-vulnerability branch from 489c670 to 483df8d Compare September 25, 2025 17:45
@renovate renovate bot force-pushed the renovate/npm-jspdf-vulnerability branch from 483df8d to 165fe43 Compare October 21, 2025 18:45
@renovate renovate bot force-pushed the renovate/npm-jspdf-vulnerability branch from 165fe43 to afcbfd4 Compare November 10, 2025 23:02
@socket-security
Copy link
Copy Markdown

socket-security bot commented Nov 10, 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.2 ⏵ 3.0.398 +1100 +40100 +182100

View full report

@renovate renovate bot force-pushed the renovate/npm-jspdf-vulnerability branch from afcbfd4 to 1f270cd Compare November 18, 2025 17:33
@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