pdfmake Server-Side Request Forgery via Unvalidated Document URLs (CVE-2026-26801)
by mariopepe · 2026-07-05
- Severity
- High
- CVE
- CVE-2026-26801
- Category
- web
- Affected product
- pdfmake (Node.js PDF generation library), src/URLResolver.js
- Affected versions
- >= 0.3.0-beta.2, <= 0.3.5 (fixed in 0.3.6)
- Disclosed
- 2026-07-05
- Patch status
- patched
Archive entry
intelseclab/poc-archiveMetadata
| Field | Value |
|---|---|
| Date Added | 2026-07-05 |
| Last Updated | 2026-03 |
| Author / Researcher | mariopepe |
| CVE / Advisory | CVE-2026-26801 |
| Category | web |
| Severity | High |
| CVSS Score | Not specified in source (repository labels severity “HIGH” without a numeric score) |
| Status | Weaponized |
| Tags | ssrf, pdfmake, node-js, cloud-metadata, aws-imds, cwe-918, credential-theft, data-exfiltration |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | pdfmake (Node.js PDF generation library), src/URLResolver.js |
| Versions Affected | >= 0.3.0-beta.2, <= 0.3.5 (fixed in 0.3.6) |
| Language / Platform | JavaScript / Node.js (Express-based demo server) |
| Authentication Required | No |
| Network Access Required | Yes (attacker submits a document definition to a server embedding pdfmake; server-side fetch reaches attacker/internal targets) |
Summary
CVE-2026-26801 is a Server-Side Request Forgery vulnerability in pdfmake, a popular Node.js PDF generation library. When a document definition (docDefinition) references remote resources in fields such as images, attachments, or files, pdfmake’s URLResolver.js fetches the given URL with fetch(url, { headers }) without any validation — no domain allowlist/blocklist, no protection against internal or link-local IP ranges (e.g. 127.0.0.1, 169.254.169.254, 10.x.x.x), and it even honors attacker-supplied custom headers (enabling auth-bypass style requests). This lets an attacker who controls document content submitted to any server-side pdfmake integration force that server to make arbitrary outbound HTTP requests, including to cloud instance metadata services. The repository includes a full working lab: a mock AWS metadata server, a vulnerable PDF-generation server, and both a “blind” SSRF attack script and a “full read” exfiltration script that embeds the stolen metadata response directly inside the generated PDF as an attachment.
Vulnerability Details
Root Cause
URLResolver.js calls fetch(url, { headers }) on any URL supplied inside a document definition’s images/attachments/files fields with no validation of the destination host or scheme, and forwards attacker-controlled custom headers unmodified.
Attack Vector
- Attacker identifies (or hosts) an application that accepts user-influenced document definitions and passes them to pdfmake for server-side PDF generation.
- Attacker submits a
docDefinitionwhoseimages(orattachments/files) field points to an internal/cloud-metadata URL, e.g.http://169.254.169.254/latest/meta-data/iam/security-credentials/<role>. - The vulnerable server’s pdfmake instance fetches the URL server-side with no restriction, reaching the internal metadata endpoint that the attacker cannot reach directly.
- For “blind” SSRF, the attacker observes the outbound request hit their own listener (proving the fetch occurred); for “full read” SSRF, the fetched response body (e.g. IAM credentials JSON) is embedded as a file attachment inside the generated PDF, which the attacker then retrieves and opens to read the exfiltrated data.
Impact
Full read/blind SSRF from any server embedding vulnerable pdfmake versions, enabling theft of cloud IAM credentials (AWS/GCP/Azure metadata), internal network reconnaissance/port scanning, and authentication bypass against internal services via attacker-controlled request headers.
Environment / Lab Setup
Target: Node.js server using pdfmake >= 0.3.0-beta.2, <= 0.3.5 (vulnerable-server.js in this lab)
Attacker: Node.js, npm install (express, pdfmake), mock-metadata-server.js to simulate a cloud metadata endpoint
Proof of Concept
PoC Script
See
vulnerable-server.js,mock-metadata-server.js,attack.js,attack-exfiltration.js, andtest-minimal.jsin this folder.
| |
attack.js submits document definitions whose images fields point at the mock metadata server’s IAM credential and instance-metadata endpoints, proving the vulnerable server makes the outbound requests server-side. attack-exfiltration.js goes further, generating an exfiltrated.pdf file that embeds the actual fetched metadata JSON as an attachment, demonstrating full data exfiltration rather than just blind SSRF confirmation.
Detection & Indicators of Compromise
Signs of compromise:
- Application/PDF-generation server logs showing outbound requests to cloud metadata IPs (
169.254.169.254) or internal-only hosts - Generated PDF files containing unexpected file attachments (e.g.
metadata.json) not part of the intended document content - Unusual custom HTTP headers present in server-originated requests correlating with user-submitted document definitions
Remediation
| Action | Detail |
|---|---|
| Primary fix | Upgrade to pdfmake 0.3.6 or later, which addresses the unvalidated URL fetch in URLResolver.js |
| Interim mitigation | Validate/allowlist any URLs accepted in document definitions before passing them to pdfmake; block outbound requests to link-local/metadata and RFC1918 ranges from the PDF-generation service; strip/ignore attacker-controlled custom headers |
References
Notes
Mirrored from https://github.com/mariopepe/CVE-2026-26801-pdfmake-ssrf on 2026-07-05.
| |