CVE-2026-119343: Stirling-PDF: AI create-pdf-from-html-agent skips HTML sanitization enabling WeasyPrint SSRF and local file read
Stirling-PDF is a locally hosted web application that facilitates various operations on PDF files. Prior to 3.0.0, POST /api/v1/ai/tools/create-pdf-from-html-agent accepts attacker-controlled htmlContent and passes it to WeasyPrint without CustomHtmlSanitizer, unlike the sanitized /api/v1/convert/html/pdf control path. HTTP and HTTPS resource references can make server-side requests to internal or cloud-metadata destinations, while file references can embed local content readable by the Stirling-PDF process into the generated PDF. The endpoint is reachable without credentials when security.enableLogin is false, and the flaw is distinct from earlier Stirling-PDF WeasyPrint vulnerabilities in older conversion paths. This issue is fixed in version 3.0.0.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Stirling-PDFto a version that resolves this vulnerability.Fixed in 3.0.0
Event History
Frequently Asked Questions
Which deployments are most exposed to unauthenticated exploitation?
Deployments with security.enableLogin set to false expose the affected endpoint without credentials. An unauthenticated attacker can submit HTML to POST /api/v1/ai/tools/create-pdf-from-html-agent.
What can an attacker access through the vulnerable endpoint?
HTTP or HTTPS references in supplied HTML can cause server-side requests to internal services or cloud-metadata destinations. File references can place local content readable by the Stirling-PDF process into the generated PDF.
Are standard HTML-to-PDF conversions affected in the same way?
The described issue is specific to the AI create-pdf-from-html-agent endpoint. The /api/v1/convert/html/pdf path uses CustomHtmlSanitizer and is identified as the sanitized control path.
What remediation is available?
Upgrade Stirling-PDF to version 3.0.0, which fixes this issue. If upgrading cannot happen immediately, enabling security.enableLogin prevents the endpoint from being reachable without credentials.