Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

fix(security): bump WeasyPrint to 70.0 for GHSA-jf6q-chmf-3h3v (url_fetcher bypass) (#6625)

LearningCircuit5b80d92fa408
diff --git a/changelog.d/6625.security.md b/changelog.d/6625.security.md
new file mode 100644
index 0000000000..59190116dd
--- /dev/null
+++ b/changelog.d/6625.security.md
@@ -0,0 +1 @@
+Bumped WeasyPrint to ~=70.0, the only release fixing GHSA-jf6q-chmf-3h3v (CVE-2026-55073): `write_pdf(stylesheets=[url])` and `xmp_metadata=[url])` bypassed a restrictive `url_fetcher`, defeating the PDF renderer's SSRF guard. Added the `_fail_on_errors` attribute WeasyPrint 70's fetch contract reads off the url_fetcher so blocked URLs still degrade to skipped resources.
diff --git a/pdm.lock b/pdm.lock
index bfaa986ef9..5f6ab004c4 100644
--- a/pdm.lock
+++ b/pdm.lock
@@ -5,7 +5,7 @@
groups = ["default", "dev", "mcp"]
strategy = ["inherit_metadata"]
lock_version = "4.5.1"
-content_hash = "sha256:33d64d3bf0a76f2b1373be6fd4be7e1c29e6403e238f7a24de1374988ddacf35"
+content_hash = "sha256:f7a5088e95ffe8ff8bbce3afa888ca168dbc5cf602bb9d2ac8e9ee6d669acdf3"
[[metadata.targets]]
requires_python = ">=3.12,<3.15"
@@ -6474,7 +6474,7 @@ version = "2026.3"
requires_python = ">=2"
summary = "Provider of IANA time zone data"
groups = ["default", "dev"]
-marker = "platform_system == \"Windows\" or sys_platform == \"win32\" or sys_platform == \"emscripten\" or python_version >= \"3.9\""
+marker = "platform_system == \"Windows\" or sys_platform == \"emscripten\" or sys_platform == \"win32\" or python_version >= \"3.9\""
files = [
{file = "tzdata-2026.3-py2.py3-none-any.whl", hash = "sha256:dc096730c87af6cab1b171c9d532be840741ff5d459015e7f6947bd7d7e54931"},
{file = "tzdata-2026.3.tar.gz", hash = "sha256:4a1518b8993086a7982523e071643f3c0e5f213e75b21318e78bcabfff9d1415"},
@@ -6848,7 +6848,7 @@ files = [
[[package]]
name = "weasyprint"
-version = "68.1"
+version = "70.0"
requires_python = ">=3.10"
summary = "The Awesome Document Factory"
groups = ["default"]
@@ -6863,8 +6863,8 @@ dependencies = [
"tinyhtml5>=2.0.0b1",
]
files = [
- {file = "weasyprint-68.1-py3-none-any.whl", hash = "sha256:4dc3ba63c68bbbce3e9617cb2226251c372f5ee90a8a484503b1c099da9cf5be"},
- {file = "weasyprint-68.1.tar.gz", hash = "sha256:d3b752049b453a5c95edb27ce78d69e9319af5a34f257fa0f4c738c701b4184e"},
+ {file = "weasyprint-70.0-py3-none-any.whl", hash = "sha256:5043e55e38d2a2af2b2b871e869697b1f65dad5f8b4a3677961d04ceacf9c5fe"},
+ {file = "weasyprint-70.0.tar.gz", hash = "sha256:c263abf0e86c747b12af678b67f85f4abbfb97d18a20503031e7ba94e4b8cf8c"},
]
[[package]]
diff --git a/pyproject.toml b/pyproject.toml
index a87457f960..b35bc1cb60 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -103,7 +103,7 @@ dependencies = [
"sqlcipher3~=0.6; (platform_machine == \"aarch64\" or platform_machine == \"arm64\") and sys_platform == \"linux\"",
"sqlcipher3~=0.6; sys_platform != \"linux\"",
"lxml-html-clean>=0.4.4", # CVE-2026-28350: base tag injection bypass
- "weasyprint~=68.1",
+ "weasyprint~=70.0", # GHSA-jf6q-chmf-3h3v (CVE-2026-55073): url_fetcher bypass via write_pdf(stylesheets=[url])/xmp_metadata=[url]; fixed only in 70.0
"Pillow>=12.1.1", # CVE-2026-25990: out-of-bounds write in PSD
"cryptography>=50.0.0,<51", # GHSA-g6cj-pr64-35w5 (CVE-2026-69247): PKCS#7 EnvelopedData Bleichenbacher oracle; only fix is 50.0.0 (no 48.x/49.x backport). 50.0.0 also subsumes CVE-2026-26007, CVE-2026-39892, GHSA-537c-gmf6-5ccf. Absorbs 49.0.0/50.0.0 breaking changes (removed *_KEY_TYPES aliases, stricter X.509/DER) safely: codebase audit found zero first-party cryptography usage — only pyjwt[crypto] touches it transitively
# notification_validator mirrors Apprise's query parser as a security
diff --git a/src/local_deep_research/web/services/pdf_service.py b/src/local_deep_research/web/services/pdf_service.py
index 2e381c9335..5f7da989e3 100644
--- a/src/local_deep_research/web/services/pdf_service.py
+++ b/src/local_deep_research/web/services/pdf_service.py
@@ -154,6 +154,19 @@ def _skipping_url_fetcher(url):
}
+# WeasyPrint 70's fetch() context manager (weasyprint/urls.py) reads
+# ``_fail_on_errors`` off the *url_fetcher itself* after catching an exception
+# it raised — a bare function without that attribute turns every blocked URL
+# into an ``AttributeError`` mid-render. ``False`` mirrors the
+# ``URLFetcher(fail_on_errors=False)`` default: the refusal surfaces as
+# ``URLFetchingError``, which WeasyPrint's callers warn-and-skip. That keeps
+# the 68.x ValueError-as-skip posture (pinned end-to-end by
+# ``test_render_succeeds_when_body_url_is_blocked``) while the version floor
+# is ~=70.0 for the GHSA-jf6q-chmf-3h3v url_fetcher-bypass fix.
+_safe_url_fetcher._fail_on_errors = False
+_skipping_url_fetcher._fail_on_errors = False
+
+
class MissingPDFDependencyError(RuntimeError):
"""Raised when WeasyPrint system libraries are unavailable.