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.

docs(security): add ::ffff:0:0:0/96 (IPv4-Translated, RFC 2765) to the blocked-prefix enumerations (#6797)

LearningCircuit3cb94d39e1eb
diff --git a/SECURITY.md b/SECURITY.md
index c7fa79cfd9..d655f50723 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -191,7 +191,7 @@ Future contributors must not remove entries from this set. Adding a new cloud pr
### IPv6 Transition Prefix Block List
-`PRIVATE_IP_RANGES` blocks four IPv6 prefixes that can wrap private-IPv4 destinations on hosts with kernel transition routes configured:
+`PRIVATE_IP_RANGES` blocks seven IPv6 transition and special-purpose prefixes. Most of them can wrap private-IPv4 destinations on hosts with kernel transition routes configured. The two NAT64 prefixes are blocked by default and can be allowed with `security.allow_nat64`; the rest are always blocked:
| Prefix | Purpose | RFC |
| --- | --- | --- |
@@ -201,10 +201,11 @@ Future contributors must not remove entries from this set. Adding a new cloud pr
| `2001::/32` | Teredo | RFC 4380 |
| `100::/64` | IPv6 discard prefix | RFC 6666 |
| `::/96` | IPv4-Compatible IPv6 (deprecated) | RFC 4291 §2.5.5.1 |
+| `::ffff:0:0:0/96` | IPv4-Translated (SIIT) | RFC 2765 (obsoleted by RFC 6145) |
Default Linux has no `sit0` / NAT64 routes so this is defensive-only on the typical deployment, but blocking these prefixes closes the IPv6-wrapped SSRF bypass class on hosts where transition tunnels are enabled.
-Operators on IPv6-only deployments using DNS64+NAT64 (AWS / GKE / Azure IPv6-only nodes) reach IPv4 services through `64:ff9b::/96`. They can opt back into NAT64 reachability via the env-only setting `security.allow_nat64` (`LDR_SECURITY_ALLOW_NAT64=true`). The opt-in is scoped strictly to the two NAT64 prefixes — 6to4, Teredo, and discard remain unconditionally blocked because they have no live legitimate use, and the IMDS embedded-IPv4 check above still applies so cloud metadata stays unreachable through any NAT64 wrap.
+Operators on IPv6-only deployments using DNS64+NAT64 (AWS / GKE / Azure IPv6-only nodes) reach IPv4 services through `64:ff9b::/96`. They can opt back into NAT64 reachability via the env-only setting `security.allow_nat64` (`LDR_SECURITY_ALLOW_NAT64=true`). The opt-in is scoped strictly to the two NAT64 prefixes — 6to4, Teredo, discard, IPv4-Compatible IPv6 (`::/96`, except `::1` loopback which follows the loopback/private flags), and IPv4-Translated/SIIT (`::ffff:0:0:0/96`) remain unconditionally blocked because they have no live legitimate use, and the IMDS embedded-IPv4 check above still applies so cloud metadata stays unreachable through any NAT64 wrap.
URL rejection log lines route through `ssrf_validator.redact_url_for_log` to drop userinfo (RFC 3986 §3.2.1 allows credentials in the URL), path, and query — operators see `scheme://host:port` only. Operators with grep/regex tooling on the rejection log lines will see authority-only strings instead of full URLs.
diff --git a/docs/CONFIGURATION.md b/docs/CONFIGURATION.md
index 43e15af9e7..ba7702d35f 100644
--- a/docs/CONFIGURATION.md
+++ b/docs/CONFIGURATION.md
@@ -46,7 +46,7 @@ They are not available in the Web UI because they are needed to start the applic
| `LDR_SEARCH_ALLOW_PRIVATE_ENGINE_URLS` | Boolean | `False` | No | | Allow user-editable PUBLIC search-engine URLs (e.g. the SearXNG instance_url) to point at private / loopback / link-local addresses. Environment-only operator gate so it cannot be flipped through the user-writable settings API. Disabled by default: a public-nature engine (its data source is the public internet) pointed at an internal host lets any authenticated user turn a research run into an internal port scan / service probe, breaking the PUBLIC_ONLY egress promise. Enable only when you self-host SearXNG on localhost/LAN and accept that engine fetches may reach your private network. To approve only specific origins instead of all private addresses, use the finer-grained LDR_SEARCH_PRIVATE_ENGINE_URL_ALLOWLIST. Docker deployments instead pin the URL directly via LDR_SEARCH_ENGINE_WEB_SEARXNG_DEFAULT_PARAMS_INSTANCE_URL, which is trusted as operator-provisioned. Cloud-metadata endpoints (ALWAYS_BLOCKED_METADATA_IPS) stay blocked regardless of this flag. | Security | |
| `LDR_SEARCH_ALLOW_PRIVATE_RESULT_FETCH` | Boolean | `False` | No | | Allow full-content fetching (search.snippets_only off) to follow the RESULT URLs a PUBLIC search engine returns into private / loopback addresses, e.g. an internal wiki that a self-hosted SearXNG instance indexes. Distinct from, and required in addition to, the instance-URL approval (LDR_SEARCH_ALLOW_PRIVATE_ENGINE_URLS, LDR_SEARCH_PRIVATE_ENGINE_URL_ALLOWLIST or an env-locked instance URL): that approval only covers reaching the engine itself, and because a public engine proxies the public web, extending it to the URLs the engine returns would let a poisoned index turn result fetching into a scan of the LDR host's private network. Environment-only operator gate so it cannot be flipped through the user-writable settings API. Disabled by default and not set by the bundled docker-compose.yml. Link-local addresses (169.254.0.0/16, fe80::/10) and the cloud-metadata endpoints in ALWAYS_BLOCKED_METADATA_IPS stay blocked regardless of this flag. | Security | |
| `LDR_SEARCH_PRIVATE_ENGINE_URL_ALLOWLIST` | String | `None` | No | | Comma-separated list of exact URL origins (scheme://host[:port]) that user-editable PUBLIC search-engine URLs (e.g. the SearXNG instance_url) may use even though they are private / loopback / link-local — e.g. 'http://localhost:8080,http://192.168.1.5:8888'. Finer-grained alternative to LDR_SEARCH_ALLOW_PRIVATE_ENGINE_URLS=true: private egress is enabled for an engine only when its configured URL matches a listed origin (the engine's request chain, including redirects, then runs with private access — like the blanket flag, but conditional on the match), rather than for any private URL. Matching is exact scheme + host + port (default ports 80/443 implied, host case-insensitive, path/query ignored); no wildcards or CIDR ranges. Entries that fail to parse are ignored. Environment-only operator setting so it cannot be edited through the user-writable settings API. Cloud-metadata endpoints (ALWAYS_BLOCKED_METADATA_IPS) and non-http(s) schemes stay blocked even if listed. | Security | |
-| `LDR_SECURITY_ALLOW_NAT64` | Boolean | `False` | No | | Allow outbound traffic to NAT64 prefixes (64:ff9b::/96 RFC 6052 well-known and 64:ff9b:1::/48 RFC 8215 local-use). Disabled by default to close the IPv6-wrapped SSRF bypass class — on hosts configured with NAT64 routes, attacker-supplied URLs can wrap cloud-metadata or RFC1918 destinations through these prefixes. Enable only on IPv6-only deployments (DNS64+NAT64) where outbound IPv4 traffic is synthesized through this prefix and the operator has accepted the residual SSRF risk. 6to4 (2002::/16), Teredo (2001::/32), and the discard prefix (100::/64) remain unconditionally blocked because they have no live legitimate use in 2026. The cloud-metadata block (ALWAYS_BLOCKED_METADATA_IPS) still applies via embedded-IPv4 extraction — see SECURITY.md. | Security | |
+| `LDR_SECURITY_ALLOW_NAT64` | Boolean | `False` | No | | Allow outbound traffic to NAT64 prefixes (64:ff9b::/96 RFC 6052 well-known and 64:ff9b:1::/48 RFC 8215 local-use). Disabled by default to close the IPv6-wrapped SSRF bypass class — on hosts configured with NAT64 routes, attacker-supplied URLs can wrap cloud-metadata or RFC1918 destinations through these prefixes. Enable only on IPv6-only deployments (DNS64+NAT64) where outbound IPv4 traffic is synthesized through this prefix and the operator has accepted the residual SSRF risk. 6to4 (2002::/16), Teredo (2001::/32), the discard prefix (100::/64), the deprecated IPv4-Compatible IPv6 form (::/96, except ::1 loopback which follows the loopback/private flags), and the IPv4-Translated/SIIT form (::ffff:0:0:0/96) remain unconditionally blocked because they have no live legitimate use in 2026. The cloud-metadata block (ALWAYS_BLOCKED_METADATA_IPS) still applies via embedded-IPv4 extraction — see SECURITY.md. | Security | |
| `LDR_SECURITY_CORS_ALLOWED_ORIGINS` | String | `None` | No | | Allowed CORS origins for API routes (comma-separated). Use '*' for all origins, empty for same-origin only. Example: 'https://example.com,https://app.example.com' | Security | |
| `LDR_SECURITY_WEBSOCKET_ALLOWED_ORIGINS` | String | `None` | No | | Allowed origins for WebSocket/Socket.IO connections (comma-separated). Unset or empty means same-origin only (default); use '*' to allow all origins. Example: 'https://example.com,https://app.example.com' | Security | |
| `LDR_SERVER_MAX_CONCURRENT_RESEARCH` | Integer | `10` | No | 1..1000 | Server-wide maximum concurrent research operations. Requires restart. | Server | LDR_MAX_GLOBAL_CONCURRENT |
diff --git a/docs/NOTIFICATIONS.md b/docs/NOTIFICATIONS.md
index fb04347461..5e34169efc 100644
--- a/docs/NOTIFICATIONS.md
+++ b/docs/NOTIFICATIONS.md
@@ -298,7 +298,7 @@ The "Test" button in the notifications settings page returns the validator's rea
**"Blocked private/internal IP address: \<host\>"**
- **Cause**: The URL resolves to a loopback (`127.0.0.1`, `::1`), RFC1918 (`10.x`, `172.16-31.x`, `192.168.x`), CGNAT (`100.64.0.0/10`), link-local (`169.254.0.0/16`), or IPv6 private (`fc00::/7`, `fe80::/10`) address. The default SSRF policy blocks these for outbound webhooks.
- **Fix (operator-only, env-only)**: Set `LDR_NOTIFICATIONS_ALLOW_PRIVATE_IPS=true` in the server environment. This is intentionally not exposed in the user-writable settings API. Only enable it if the notification endpoints are on a trusted local network.
-- **Fix (IPv6-only deployments using NAT64)**: If the host wraps IPv4 through `64:ff9b::/96` (RFC 6052 well-known) or `64:ff9b:1::/48` (RFC 8215 local-use), additionally set `LDR_SECURITY_ALLOW_NAT64=true`. The opt-in is scoped strictly to those two prefixes — 6to4 (`2002::/16`), Teredo (`2001::/32`), the discard prefix (`100::/64`), and the deprecated IPv4-Compatible IPv6 form (`::/96`) remain blocked.
+- **Fix (IPv6-only deployments using NAT64)**: If the host wraps IPv4 through `64:ff9b::/96` (RFC 6052 well-known) or `64:ff9b:1::/48` (RFC 8215 local-use), additionally set `LDR_SECURITY_ALLOW_NAT64=true`. The opt-in is scoped strictly to those two prefixes — 6to4 (`2002::/16`), Teredo (`2001::/32`), the discard prefix (`100::/64`), the deprecated IPv4-Compatible IPv6 form (`::/96`, except `::1` loopback which follows the loopback/private-IPs flags), and the IPv4-Translated SIIT form (`::ffff:0:0:0/96`, RFC 2765) remain blocked.
- **Note (cloud-metadata IPs)**: If `\<host\>` is a cloud-metadata IP (see the next bullet), the env-var hint above is intentionally **not** surfaced by the "Test" button — neither flag re-opens metadata, so the hint would mislead. The user-visible error is just the bare `"Blocked private/internal IP address: 169.254.169.254"`.
**"Blocked cloud-metadata IP address: \<host\>"**
diff --git a/docs/SearXNG-Setup.md b/docs/SearXNG-Setup.md
index 2fb1669aea..dd4f4e2322 100644
--- a/docs/SearXNG-Setup.md
+++ b/docs/SearXNG-Setup.md
@@ -251,7 +251,7 @@ The "private IPs allowed" exception above does **not** cover IPv6 transition pre
LDR_SECURITY_ALLOW_NAT64=true
```
-The opt-in is scoped strictly to the two NAT64 prefixes — 6to4 (`2002::/16`), Teredo (`2001::/32`), the discard prefix (`100::/64`), and the deprecated IPv4-Compatible IPv6 form (`::/96`) remain blocked, and cloud-metadata IPs stay unreachable through any NAT64 wrap. See [SECURITY.md](../SECURITY.md#ipv6-transition-prefix-block-list) for the full rationale.
+The opt-in is scoped strictly to the two NAT64 prefixes — 6to4 (`2002::/16`), Teredo (`2001::/32`), the discard prefix (`100::/64`), the deprecated IPv4-Compatible IPv6 form (`::/96`, except `::1` loopback which follows the loopback/private-IPs flags), and the IPv4-Translated SIIT form (`::ffff:0:0:0/96`, RFC 2765) remain blocked, and cloud-metadata IPs stay unreachable through any NAT64 wrap. See [SECURITY.md](../SECURITY.md#ipv6-transition-prefix-block-list) for the full rationale.
## Troubleshooting
diff --git a/src/local_deep_research/notifications/service.py b/src/local_deep_research/notifications/service.py
index ed55aabc84..0484299c1d 100644
--- a/src/local_deep_research/notifications/service.py
+++ b/src/local_deep_research/notifications/service.py
@@ -891,8 +891,9 @@ class NotificationService:
# append the admin escape hatches; the user cannot fix
# this themselves. Suppress the hint for always-blocked
# categories (metadata, 6to4, Teredo, discard,
- # IPv4-mapped IPv6 of metadata, NAT64-wrapped metadata):
- # no env var can help, so naming one would mislead.
+ # IPv4-mapped IPv6 of metadata, IPv4-Compatible IPv6,
+ # IPv4-Translated/SIIT, NAT64-wrapped metadata): no env
+ # var can help, so naming one would mislead.
user_error = (
error_msg or "Invalid notification service URL."
)
diff --git a/src/local_deep_research/security/ip_ranges.py b/src/local_deep_research/security/ip_ranges.py
index c1e24468e8..afde91e4fa 100644
--- a/src/local_deep_research/security/ip_ranges.py
+++ b/src/local_deep_research/security/ip_ranges.py
@@ -61,8 +61,11 @@ PRIVATE_IP_RANGES = [
# deployment shape (laptops / dual-stack) from the IPv6-wrapped IMDS /
# RFC1918 SSRF bypass class. Operators who actually need NAT64 reachable
# can opt in via the env-only setting ``security.allow_nat64``
-# (LDR_SECURITY_ALLOW_NAT64=true). 6to4, Teredo, and discard remain
-# unconditionally blocked — they have no legitimate live use.
+# (LDR_SECURITY_ALLOW_NAT64=true). 6to4, Teredo, discard, the
+# IPv4-Compatible prefix (::/96, except ::1 loopback which follows the
+# loopback/private flags), and the IPv4-Translated/SIIT prefix
+# (::ffff:0:0:0/96) remain unconditionally blocked — they have no
+# legitimate live use.
NAT64_PREFIXES = [
ipaddress.ip_network("64:ff9b::/96"),
ipaddress.ip_network("64:ff9b:1::/48"),
diff --git a/src/local_deep_research/security/notification_validator.py b/src/local_deep_research/security/notification_validator.py
index c5c30bea51..4da4404ac4 100644
--- a/src/local_deep_research/security/notification_validator.py
+++ b/src/local_deep_research/security/notification_validator.py
@@ -871,7 +871,8 @@ class NotificationURLValidator:
actually unblock. If ``hint_would_help`` is False the URL
targets an always-blocked category (cloud-metadata IPs, 6to4,
Teredo, discard prefix, IPv4-mapped IPv6 of metadata,
- NAT64-wrapped metadata) and the hint is suppressed because
+ IPv4-Compatible IPv6, IPv4-Translated/SIIT, NAT64-wrapped
+ metadata) and the hint is suppressed because
naming the env var would mislead. The parametrized
integration test ``test_test_service_ip_rejection_matrix``
in tests/web/services/test_notification_coverage.py locks
@@ -1178,6 +1179,7 @@ class NotificationURLValidator:
logger.debug(
"hint suppressed: {} targets an always-blocked "
"category (metadata / 6to4 / Teredo / discard / "
+ "IPv4-Compatible / IPv4-Translated-SIIT / "
"NAT64-wrapped metadata)",
hostname,
)
diff --git a/src/local_deep_research/security/ssrf_validator.py b/src/local_deep_research/security/ssrf_validator.py
index 1b2664ca68..4ee43fb046 100644
--- a/src/local_deep_research/security/ssrf_validator.py
+++ b/src/local_deep_research/security/ssrf_validator.py
@@ -292,7 +292,8 @@ def is_ip_blocked(
if ip in blocked_range:
# NAT64 carve-out: when the operator has opted in, the two
# NAT64 prefixes don't block outright. 6to4 / Teredo / discard
- # remain blocked unconditionally.
+ # / IPv4-Compatible (::/96, except ::1) / IPv4-Translated
+ # (::ffff:0:0:0/96) remain blocked unconditionally.
if nat64_allowed and blocked_range in NAT64_PREFIXES:
# The opt-in permits reaching only what a DIRECT connection
# to the embedded IPv4 would be allowed to reach — it is not
diff --git a/src/local_deep_research/settings/env_definitions/security.py b/src/local_deep_research/settings/env_definitions/security.py
index ae1464737f..b4764a44b4 100644
--- a/src/local_deep_research/settings/env_definitions/security.py
+++ b/src/local_deep_research/settings/env_definitions/security.py
@@ -54,9 +54,12 @@ SECURITY_SETTINGS = [
"Enable only on IPv6-only deployments (DNS64+NAT64) where "
"outbound IPv4 traffic is synthesized through this prefix and "
"the operator has accepted the residual SSRF risk. 6to4 "
- "(2002::/16), Teredo (2001::/32), and the discard prefix "
- "(100::/64) remain unconditionally blocked because they have no "
- "live legitimate use in 2026. The cloud-metadata block "
+ "(2002::/16), Teredo (2001::/32), the discard prefix "
+ "(100::/64), the deprecated IPv4-Compatible IPv6 form "
+ "(::/96, except ::1 loopback which follows the loopback/"
+ "private flags), and the IPv4-Translated/SIIT form "
+ "(::ffff:0:0:0/96) remain unconditionally blocked because "
+ "they have no live legitimate use in 2026. The cloud-metadata block "
"(ALWAYS_BLOCKED_METADATA_IPS) still applies via embedded-IPv4 "
"extraction — see SECURITY.md."
),