Details
#3082 (merged 2026-03-29, shipped in v1.5.0+) — closes the HTML-injection sinks:
html.escape()now wraps thetitlevalue in<title>…</title>- Same for metadata keys/values in
<meta name="…" content="…"> - Regression tests added in
tests/web/services/test_pdf_service.py
#3613 (merged 2026-04-24, shipped in v1.6.0) — implements the url_fetcher recommendation from the Remediation section:
- New
_safe_url_fetcherinpdf_service.pydelegates toweasyprint.default_url_fetcheronly aftersecurity.ssrf_validator.validate_urlaccepts the URL - Blocks AWS metadata (169.254.169.254), RFC1918, loopback, and non-http(s) schemes
- Covers the chained SSRF path through any URL reaching the rendered HTML — markdown body, citations, raw-HTML passthrough via Python-Markdown
- Blocked URLs raise
UnsafePDFResourceURLError(aValueErrorsubclass) so WeasyPrint skips the resource and the render continues - 8 regression tests, including an end-to-end render with
<img src="http://169.254.169.254/…">embedded in the body
Advisory metadata: CVSS CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:N/A:N (5.0 Moderate), CWEs CWE-79 + CWE-918. Patched in v1.6.0 — upgrade to v1.6.0 or later to receive both fixes.