CVE-2025-57810
📋 TL;DR
CVE-2025-57810 is a denial-of-service vulnerability in jsPDF library where user-controlled input to the addImage method can cause high CPU utilization. Attackers can provide malicious PNG files or URLs to trigger resource exhaustion. This affects any application using vulnerable jsPDF versions to generate PDFs from user-supplied images.
💻 Affected Systems
- jsPDF
📦 What is this software?
Jspdf by Parall
⚠️ Risk & Real-World Impact
Worst Case
Complete service unavailability due to CPU exhaustion, affecting all users of the application until manual intervention.
Likely Case
Degraded performance and intermittent service disruptions for users processing PDFs with images.
If Mitigated
Minimal impact with proper input validation and resource limits in place.
🎯 Exploit Status
Exploitation requires only the ability to provide image data to addImage method, making it simple to weaponize.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 3.0.2
Vendor Advisory: https://github.com/parallax/jsPDF/security/advisories/GHSA-8mvj-3j78-4qmw
Restart Required: No
Instructions:
1. Update jsPDF dependency to version 3.0.2 or later. 2. For npm: 'npm update jspdf'. 3. For yarn: 'yarn upgrade jspdf'. 4. Verify the update in package.json.
🔧 Temporary Workarounds
Input validation and sanitization
allImplement strict validation of image inputs before passing to addImage method
Resource limiting
allImplement CPU timeouts and resource limits for PDF generation processes
🧯 If You Can't Patch
- Implement strict input validation to reject or sanitize all user-provided image data before processing
- Deploy rate limiting and resource quotas to prevent CPU exhaustion from repeated attacks
🔍 How to Verify
Check if Vulnerable:
Check package.json or node_modules/jspdf/package.json for version less than 3.0.2
Check Version:
npm list jspdf | grep jspdf OR cat node_modules/jspdf/package.json | grep version
Verify Fix Applied:
Confirm jsPDF version is 3.0.2 or higher in package.json and verify the application processes test PNG files without CPU spikes
📡 Detection & Monitoring
Log Indicators:
- Unusually high CPU usage during PDF generation
- Multiple failed PDF generation attempts with image processing errors
- Process timeouts or crashes in PDF generation services
Network Indicators:
- Multiple large image uploads to PDF generation endpoints in short timeframes
- Unusual patterns of image file uploads followed by PDF download requests
SIEM Query:
source="application_logs" AND ("PDF generation" OR "addImage") AND (cpu_usage > 90 OR process_timeout = true)
🔗 References
- https://github.com/parallax/jsPDF/commit/4cf3ab619e565d9b88b4b130bff901b91d8688e9
- https://github.com/parallax/jsPDF/pull/3880
- https://github.com/parallax/jsPDF/releases/tag/v3.0.2
- https://github.com/parallax/jsPDF/security/advisories/GHSA-8mvj-3j78-4qmw
- https://github.com/parallax/jsPDF/security/advisories/GHSA-8mvj-3j78-4qmw