Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2026-71270

CVE-2026-71270: Stirling-PDF SSRF Vulnerability

CVE-2026-71270 is an SSRF flaw in Stirling-PDF's URL-to-PDF conversion endpoint that allows attackers to access internal resources and cloud metadata. This post explains its impact, affected versions, and mitigation steps.

Published:

CVE-2026-71270 Overview

CVE-2026-71270 is a Server-Side Request Forgery (SSRF) vulnerability in Stirling-PDF's POST /api/v1/convert/url/pdf endpoint, implemented in ConvertWebsiteToPDF.java. The endpoint was not updated with the CustomHtmlSanitizer and SsrfProtectionService protections applied to three sibling conversion endpoints (html/pdf, file/pdf, markdown/pdf). Attackers can supply a URL that resolves to a public IP, then use the fetched HTML to reference internal resources that WeasyPrint retrieves without filtering. This allows attackers to reach cloud metadata services and internal network endpoints, exfiltrating the responses through the generated PDF [CWE-918].

Critical Impact

Unauthenticated attackers can coerce the server into fetching cloud metadata endpoints such as http://169.254.169.254/ and leak the contents into a downloadable PDF.

Affected Products

  • Stirling-PDF (component: ConvertWebsiteToPDF.java)
  • POST /api/v1/convert/url/pdf API endpoint
  • Deployments relying on WeasyPrint subprocess for HTML-to-PDF rendering

Discovery Timeline

  • 2026-08-05 - CVE-2026-71270 published to NVD
  • 2026-08-05 - Last updated in NVD database

Technical Details for CVE-2026-71270

Vulnerability Analysis

Stirling-PDF exposes several HTML-to-PDF conversion endpoints. Three of them (html/pdf, file/pdf, markdown/pdf) were retrofitted with a CustomHtmlSanitizer and an SsrfProtectionService that filter dangerous URLs during resource resolution. The url/pdf endpoint handled by ConvertWebsiteToPDF.java was not updated with these controls.

The endpoint performs a single validation step: it confirms that the user-supplied URL resolves to a public IP address. After this check, the server fetches the remote HTML and hands the unsanitized markup to a WeasyPrint subprocess for rendering. WeasyPrint then processes embedded resource references such as <img>, <link>, and CSS url() directives by issuing outbound HTTP requests directly.

Because no per-resource SSRF filtering occurs at this stage, an attacker-controlled external page can embed references to internal addresses. The retrieved content is embedded into the generated PDF, which is returned to the caller.

Root Cause

The root cause is inconsistent application of SSRF protection across sibling endpoints. ConvertWebsiteToPDF.java validates the initial URL but does not invoke SsrfProtectionService when WeasyPrint resolves nested resource references. Trust in the initial IP check does not extend to the resources loaded during PDF rendering.

Attack Vector

An unauthenticated attacker hosts an HTML page on a public server. The page contains embedded references to internal addresses, for example <img src="http://169.254.169.254/latest/meta-data/iam/security-credentials/">. The attacker submits the public URL to /api/v1/convert/url/pdf. The server fetches the outer page, passes it to WeasyPrint, and WeasyPrint issues requests to the internal targets. Retrieved data (metadata tokens, internal HTTP responses) is rendered into the PDF and returned to the attacker.

See the Stirling-PDF repository for the affected source code.

Detection Methods for CVE-2026-71270

Indicators of Compromise

  • Outbound requests from the Stirling-PDF host to link-local addresses such as 169.254.169.254, metadata.google.internal, or 100.100.100.200.
  • WeasyPrint subprocess connections to RFC1918 ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) that do not correspond to legitimate internal services.
  • POST requests to /api/v1/convert/url/pdf from external clients followed by anomalous internal traffic from the application host.

Detection Strategies

  • Inspect application access logs for calls to /api/v1/convert/url/pdf and correlate with outbound network flows from the server within the same request window.
  • Monitor DNS resolutions initiated by the Stirling-PDF process for cloud metadata hostnames or unexpected internal FQDNs.
  • Alert on PDF response sizes or content anomalies that correlate with metadata service response patterns.

Monitoring Recommendations

  • Enable egress logging on the container or host running Stirling-PDF and forward flow logs to a centralized analytics platform.
  • Deploy network policies that log or block traffic from application workloads to 169.254.169.254 and other metadata endpoints.
  • Track WeasyPrint subprocess execution and outbound connection counts per conversion request.

How to Mitigate CVE-2026-71270

Immediate Actions Required

  • Restrict access to the /api/v1/convert/url/pdf endpoint through authentication, IP allowlisting, or a reverse proxy rule until a patched build is deployed.
  • Block outbound access from the Stirling-PDF host to cloud metadata endpoints (169.254.169.254, fd00:ec2::254, metadata.google.internal).
  • Enforce IMDSv2 on AWS instances to require session tokens for metadata retrieval.

Patch Information

Monitor the Stirling-PDF GitHub repository for updates that extend CustomHtmlSanitizer and SsrfProtectionService to ConvertWebsiteToPDF.java. Apply the fixed release once available and redeploy the service.

Workarounds

  • Disable the url/pdf conversion route via reverse proxy rules (for example, an Nginx location block returning 403).
  • Run Stirling-PDF in a network namespace or container with egress firewall rules that permit only required destinations.
  • Route WeasyPrint traffic through an outbound proxy that enforces destination allowlists and blocks link-local and RFC1918 ranges.
bash
# Example Nginx block to disable the vulnerable endpoint
location = /api/v1/convert/url/pdf {
    return 403;
}

# Example iptables egress rule to block IMDS access
iptables -A OUTPUT -d 169.254.169.254 -j DROP

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.