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): triage XML/node CVEs + remove SQLi false positive (#7978–#7991) (#4768)

LearningCircuit670aa97cc750
diff --git a/.grype.yaml b/.grype.yaml
index ef01d7a2d7..9bb5fc9919 100644
--- a/.grype.yaml
+++ b/.grype.yaml
@@ -118,28 +118,22 @@ ignore:
reason: "Heap overflow in Media. Playwright 1.58 bundles pre-fix Chromium. Headless scraping only."
# ==========================================================================
- # NODE.JS (patchright-bundled Node 24.13.0 at patchright/driver/node)
- # Fixed in Node 24.14.1 (2026-03-24 security release). Patchright 1.58.2
- # was released 2026-03-07 (pre-fix). Patchright is a transitive dep of
- # crawl4ai; our Python code never invokes patchright's driver/node. The
- # production image does not install Playwright browsers (see Dockerfile
- # note at the ldr stage), so the bundled driver/node is dead weight.
- # Auto-resolves when patchright ships a rebuild with Node 24.14.1+.
+ # NODE.JS (patchright-bundled Node 24.15.0 at patchright/driver/node)
+ # Fixed in Node 24.17.0 (2026-06-18 security release). patchright 1.60.0
+ # (latest on PyPI, 2026-06-03) predates the fix and still bundles Node
+ # 24.15.0. patchright is a transitive dep of crawl4ai; our Python code never
+ # invokes patchright's driver/node, and the production image does not install
+ # Playwright/patchright browsers (see Dockerfile note at the ldr stage), so
+ # the bundled driver/node is dead weight. Auto-resolves when patchright ships
+ # a rebuild with Node 24.17.0+.
+ # (The earlier Node 24.13.0 entries — CVE-2026-21710 / -21712..-21717 — were
+ # fixed in Node 24.14.1, which the bundled 24.15.0 supersedes, so they no
+ # longer match and were removed.)
# ==========================================================================
- - vulnerability: CVE-2026-21710
- reason: "High CVE in Node 24.13.0 (headersDistinct proto-pollution DoS). Fixed in Node 24.14.1. Patchright-bundled driver/node; never invoked in prod."
- - vulnerability: CVE-2026-21712
- reason: "Medium CVE in Node 24.13.0. Fixed in Node 24.14.1. Patchright-bundled driver/node; never invoked in prod."
- - vulnerability: CVE-2026-21713
- reason: "Medium CVE in Node 24.13.0. Fixed in Node 24.14.1. Patchright-bundled driver/node; never invoked in prod."
- - vulnerability: CVE-2026-21714
- reason: "Medium CVE in Node 24.13.0. Fixed in Node 24.14.1. Patchright-bundled driver/node; never invoked in prod."
- - vulnerability: CVE-2026-21717
- reason: "Medium CVE in Node 24.13.0. Fixed in Node 24.14.1. Patchright-bundled driver/node; never invoked in prod."
- - vulnerability: CVE-2026-21715
- reason: "Low CVE in Node 24.13.0. Fixed in Node 24.14.1. Patchright-bundled driver/node; never invoked in prod."
- - vulnerability: CVE-2026-21716
- reason: "Low CVE in Node 24.13.0. Fixed in Node 24.14.1. Patchright-bundled driver/node; never invoked in prod."
+ - vulnerability: CVE-2026-48937
+ reason: "Medium HTTP/2 server DoS (server keeps accepting data after GOAWAY/RST) in Node <24.17.0. Exploitable only against a running Node.js HTTP/2 server; patchright's browser-driver node never starts one. Patchright-bundled driver/node 24.15.0; never invoked in prod."
+ - vulnerability: CVE-2026-48617
+ reason: "Low Permission Model bypass via process.report.writeReport() in Node <24.17.0. Requires the process to opt into Node's experimental --permission model; the browser-driver node is never launched with it. Patchright-bundled driver/node 24.15.0; never invoked in prod."
# ==========================================================================
# NO FIX AVAILABLE IN DEBIAN TRIXIE
@@ -217,6 +211,39 @@ ignore:
reason: "NULL deref in setContext after OOM. Needs expat 2.7.5, not in Trixie or sid. CNA CVSS 2.9 Low / NIST CVSS 5.5 Medium. Requires OOM precondition."
- vulnerability: CVE-2026-50219
reason: "UAF via reentrant parser calls from handlers in expat <2.8.2. Unfixed upstream and in sid (Debian bug 1138862). API XML uses defusedxml; XML upload uses lxml/libxml2 (not expat)."
+ # libexpat <2.8.2 integer-overflow batch. Fixed upstream in expat 2.8.2
+ # (released 2026-06-25) but not yet packaged in Debian trixie (2.7.1-2) or
+ # sid (2.8.1-1) — both still vulnerable, nothing to apt-upgrade to. These
+ # overflows fire during normal attribute/namespace/CDATA parsing, so
+ # defusedxml's entity/DTD hardening does NOT mitigate them; the real
+ # mitigation is that expat only parses TLS-fetched XML from hardcoded trusted
+ # upstreams — arXiv (export.arxiv.org, via the `arxiv` lib's feedparser ->
+ # xml.sax -> expat) and PubMed/NCBI (eutils.ncbi.nlm.nih.gov, via
+ # defusedxml). No attacker-controlled XML reaches expat; document uploads
+ # use lxml/libxml2, not expat. NVD: AV:L, medium.
+ - vulnerability: CVE-2026-56403
+ reason: "Integer overflow in storeAtts (attribute parsing), expat <2.8.2. Trixie 2.7.1-2 / sid 2.8.1-1 vulnerable; expat 2.8.2 (2026-06-25) not yet in Debian. Expat parses only TLS-fetched trusted arXiv/PubMed XML; uploads use lxml not expat. AV:L medium."
+ - vulnerability: CVE-2026-56404
+ reason: "Integer overflow in addBinding (namespace binding), expat <2.8.2. Trixie 2.7.1-2 / sid 2.8.1-1 vulnerable; expat 2.8.2 (2026-06-25) not yet in Debian. Expat parses only TLS-fetched trusted arXiv/PubMed XML; uploads use lxml not expat. AV:L medium."
+ - vulnerability: CVE-2026-56405
+ reason: "Integer overflow in getAttributeId, expat <2.8.2. Trixie 2.7.1-2 / sid 2.8.1-1 vulnerable; expat 2.8.2 (2026-06-25) not yet in Debian. Expat parses only TLS-fetched trusted arXiv/PubMed XML; uploads use lxml not expat. AV:L medium."
+ - vulnerability: CVE-2026-56406
+ reason: "Integer overflow in XML_ParseBuffer (missing length check), expat <2.8.2. Trixie 2.7.1-2 / sid 2.8.1-1 vulnerable; expat 2.8.2 (2026-06-25) not yet in Debian. Expat parses only TLS-fetched trusted arXiv/PubMed XML; uploads use lxml not expat. AV:L medium."
+ - vulnerability: CVE-2026-56407
+ reason: "Integer overflow in doProlog (storeEntityValue), expat <2.8.2. Trixie 2.7.1-2 / sid 2.8.1-1 vulnerable; expat 2.8.2 (2026-06-25) not yet in Debian. Expat parses only TLS-fetched trusted arXiv/PubMed XML; uploads use lxml not expat. AV:L medium."
+ - vulnerability: CVE-2026-56408
+ reason: "Integer overflow in copyString, expat <2.8.2. Trixie 2.7.1-2 / sid 2.8.1-1 vulnerable; expat 2.8.2 (2026-06-25) not yet in Debian. Expat parses only TLS-fetched trusted arXiv/PubMed XML; uploads use lxml not expat. AV:L medium."
+ - vulnerability: CVE-2026-56412
+ reason: "UAF in doCdataSection (missing XML_TOK_DATA_CHARS check; incomplete fix for CVE-2026-50219), expat <2.8.2. Trixie 2.7.1-2 / sid 2.8.1-1 vulnerable; expat 2.8.2 (2026-06-25) not yet in Debian. Expat parses only TLS-fetched trusted arXiv/PubMed XML; uploads use lxml not expat. AV:L medium."
+ # CVE-2026-56409/-56410/-56411 are in the xmlwf CLI tool, which ships in the
+ # `expat` package (not the installed libexpat1 runtime) and is never invoked
+ # in this container — no runtime attack surface.
+ - vulnerability: CVE-2026-56409
+ reason: "Integer overflow in the xmlwf CLI tool (-d outputDir output filename), expat <2.8.2. Bug is in the xmlwf binary, not the libexpat1 runtime, and xmlwf is never invoked in this container. Trixie/sid vulnerable; expat 2.8.2 (2026-06-25) not yet in Debian."
+ - vulnerability: CVE-2026-56410
+ reason: "Integer overflow in the xmlwf CLI tool (resolveSystemId), expat <2.8.2. Bug is in the xmlwf binary, not the libexpat1 runtime, and xmlwf is never invoked in this container. Trixie/sid vulnerable; expat 2.8.2 (2026-06-25) not yet in Debian."
+ - vulnerability: CVE-2026-56411
+ reason: "Integer overflow in the xmlwf CLI tool (endDoctypeDecl via NOTATION declarations), expat <2.8.2. Bug is in the xmlwf binary, not the libexpat1 runtime, and xmlwf is never invoked in this container. Trixie/sid vulnerable; expat 2.8.2 (2026-06-25) not yet in Debian."
# --- libgraphite2-3 (font shaping, transitive via harfbuzz for WeasyPrint) ---
- vulnerability: CVE-2026-50593
@@ -227,6 +254,17 @@ ignore:
reason: "CRLF header injection in HTTP::Tiny <0.093. Fixed in perl 5.40.1-8 (sid only); Trixie 5.40.1-6 no-dsa. perl-base is a dpkg essential package; container runs no perl HTTP clients."
# --- libxml2 ---
+ # CVE-2026-6653 (high): UAF in xmlParseInternalSubset (XML internal-DTD
+ # parameter entities), affects 2.9.11-2.11.0. Trixie's 2.9.14 base is
+ # vulnerable with no backport (fixed only in sid/forky 2.15.x) — nothing to
+ # apt-upgrade to. The vulnerable XML parser is reached only by authenticated
+ # per-user document uploads: .xml via unstructured/lxml and Office formats
+ # (.docx/.odt/.pptx/.xlsx) via python-docx/python-pptx/openpyxl/lxml.
+ # Untrusted scraped web HTML uses libxml2's HTML parser, which never calls
+ # xmlParseInternalSubset; arXiv/PubMed XML is TLS-fetched from trusted
+ # upstreams. DoS-primary (crash), CVSS 4.0 7.0, AC:H.
+ - vulnerability: CVE-2026-6653
+ reason: "High UAF in xmlParseInternalSubset (XML internal-DTD param entities); affects 2.9.11-2.11.0. Trixie 2.9.14-base vulnerable, no backport (fixed only in sid/forky 2.15.x). libxml2's XML parser is reached only by authenticated per-user uploads (.xml + Office .docx/.odt/.pptx/.xlsx via lxml); scraped HTML uses the HTML parser, not xmlParseInternalSubset. DoS-primary, CVSS 4.0 7.0, AC:H."
- vulnerability: CVE-2026-1757
reason: "Memory leak in xmllint CLI shell. Negligible impact. Debian: unimportant. No xmllint usage."
- vulnerability: CVE-2025-8732
diff --git a/src/local_deep_research/database/migrations/versions/0018_remove_mcp_strategy.py b/src/local_deep_research/database/migrations/versions/0018_remove_mcp_strategy.py
index d7dd1074e1..35c1e536d1 100644
--- a/src/local_deep_research/database/migrations/versions/0018_remove_mcp_strategy.py
+++ b/src/local_deep_research/database/migrations/versions/0018_remove_mcp_strategy.py
@@ -69,6 +69,16 @@ _news = sa.table("news_subscriptions", sa.column("search_strategy"))
_queued = sa.table(
"queued_researches", sa.column("id"), sa.column("settings_snapshot")
)
+# The two benchmark tables share the same shape. They are declared here with
+# literal names (rather than building ``sa.table(table_name, ...)`` from a
+# passed-in string) so the migration never constructs a SQL identifier from a
+# variable — there is no dynamic-table-name flow for a static analyzer to flag.
+_benchmark_runs = sa.table(
+ "benchmark_runs", sa.column("id"), sa.column("search_config")
+)
+_benchmark_configs = sa.table(
+ "benchmark_configs", sa.column("id"), sa.column("search_config")
+)
def _rewrite_search_strategy_setting(conn) -> None:
@@ -170,9 +180,14 @@ def _rewrite_queued_research_snapshots(conn) -> None:
)
-def _rewrite_benchmark_search_configs(conn, table: str) -> None:
- t = sa.table(table, sa.column("id"), sa.column("search_config"))
- rows = conn.execute(sa.select(t.c.id, t.c.search_config)).fetchall()
+def _rewrite_benchmark_search_configs(conn, table) -> None:
+ """Rewrite removed strategies in a benchmark table's ``search_config`` JSON.
+
+ ``table`` is one of the module-level literal ``sa.table`` objects
+ (``_benchmark_runs`` / ``_benchmark_configs``) — never a string — so the
+ query below contains no dynamically-built SQL identifier.
+ """
+ rows = conn.execute(sa.select(table.c.id, table.c.search_config)).fetchall()
rewritten = 0
for row_id, raw in rows:
@@ -184,8 +199,8 @@ def _rewrite_benchmark_search_configs(conn, table: str) -> None:
if config.get("search_strategy") in REMOVED_STRATEGIES:
config["search_strategy"] = REPLACEMENT_STRATEGY
conn.execute(
- sa.update(t)
- .where(t.c.id == row_id)
+ sa.update(table)
+ .where(table.c.id == row_id)
.values(search_config=json.dumps(config))
)
rewritten += 1
@@ -194,7 +209,7 @@ def _rewrite_benchmark_search_configs(conn, table: str) -> None:
logger.info(
"Rewrote a removed strategy in {} {} row(s).",
rewritten,
- table,
+ table.name,
)
@@ -212,8 +227,8 @@ def upgrade() -> None:
if inspector.has_table("queued_researches"):
_rewrite_queued_research_snapshots(conn)
- for table in ("benchmark_runs", "benchmark_configs"):
- if inspector.has_table(table):
+ for table in (_benchmark_runs, _benchmark_configs):
+ if inspector.has_table(table.name):
_rewrite_benchmark_search_configs(conn, table)