CVE-2026-56676: 9router: DNS rebinding SSRF in image prefetch
GHSA-cmhj-wh2f-9cgxHIGHPoC AVAILABLECISA: TRACK*9router, an npm LLM routing gateway, validates image URLs against a public-host guard but then resolves the hostname a second time when it fetches them. An attacker-controlled DNS name can pass the check with a public IP and then rebind to an internal address, giving server-side request forgery against Docker or private-network services, and possibly cloud metadata endpoints. Exploitation is low-complexity and needs only low privileges (an authenticated API call with a vision-capable model). Even so, the EPSS score is 0.0026 (top 84th percentile), it is not in CISA KEV, and no public exploit or Nuclei template exists. With 1,776 downstream dependents and 36 other CVEs in the same package, exposure is wide and the project's security track record is poor. Upgrade to 0.5.2 or later, and until then restrict egress from the router host so it cannot reach metadata endpoints or internal admin services.
What is the risk?
High (CVSS 7.4). The attack is network-reachable, low complexity and needs low privileges. The scope change matters because the SSRF crosses a trust boundary from the gateway into internal networks. Exploitation probability is currently modest (EPSS 0.0026, no public exploit, not in KEV), but a working proof of concept is documented in the advisory and DNS rebinding tooling is commonly available. Risk is highest for deployments that expose /v1/chat/completions to untrusted or multi-tenant users and run on cloud hosts with reachable metadata services.
How does the attack unfold?
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| Ollama | npm | <= 0.4.80 | 0.5.2 |
Do you use Ollama? You're affected.
How severe is it?
What is the attack surface?
What should I do?
1 step1) Upgrade 9router to 0.5.2 or later (fix commit c7d07448). 2) Until patched, disable image/vision prefetch or block image_url content parts at a reverse proxy or WAF. 3) Enforce egress filtering on the router host or container to deny RFC1918, loopback, link-local and metadata ranges (169.254.169.254). On AWS, require IMDSv2 with a hop limit of 1. 4) Require authentication on the gateway and rate-limit it. 5) Detect by reviewing logs for image_url values with unusual or short-TTL domains, and for outbound connections from the router to internal addresses. 6) Use a DNS resolver that blocks rebinding (private IPs in answers for public names).
What does CISA's SSVC say?
Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.
How is it classified?
Which compliance frameworks are affected?
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2026-56676?
9router, an npm LLM routing gateway, validates image URLs against a public-host guard but then resolves the hostname a second time when it fetches them. An attacker-controlled DNS name can pass the check with a public IP and then rebind to an internal address, giving server-side request forgery against Docker or private-network services, and possibly cloud metadata endpoints. Exploitation is low-complexity and needs only low privileges (an authenticated API call with a vision-capable model). Even so, the EPSS score is 0.0026 (top 84th percentile), it is not in CISA KEV, and no public exploit or Nuclei template exists. With 1,776 downstream dependents and 36 other CVEs in the same package, exposure is wide and the project's security track record is poor. Upgrade to 0.5.2 or later, and until then restrict egress from the router host so it cannot reach metadata endpoints or internal admin services.
Is CVE-2026-56676 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2026-56676, increasing the risk of exploitation.
How to fix CVE-2026-56676?
1) Upgrade 9router to 0.5.2 or later (fix commit c7d07448). 2) Until patched, disable image/vision prefetch or block image_url content parts at a reverse proxy or WAF. 3) Enforce egress filtering on the router host or container to deny RFC1918, loopback, link-local and metadata ranges (169.254.169.254). On AWS, require IMDSv2 with a hop limit of 1. 4) Require authentication on the gateway and rate-limit it. 5) Detect by reviewing logs for image_url values with unusual or short-TTL domains, and for outbound connections from the router to internal addresses. 6) Use a DNS resolver that blocks rebinding (private IPs in answers for public names).
What systems are affected by CVE-2026-56676?
This vulnerability affects the following AI/ML architecture patterns: LLM gateways and routers, Model serving, Multimodal vision pipelines, Agent frameworks.
What is the CVSS score for CVE-2026-56676?
CVE-2026-56676 has a CVSS v3.1 base score of 7.4 (HIGH). The EPSS exploitation probability is 0.19%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0040AI Model Inference API AccessAML.T0049Exploit Public-Facing ApplicationAML.T0075Cloud Service DiscoveryCompliance Controls Affected
What are the technical details?
Original Advisory
## Summary 9router validates image URLs by resolving the host before fetching, but the later server-side fetch performs a separate DNS resolution. An attacker-controlled DNS name can resolve to a public IP during validation and then rebind to an internal Docker/private IP during the fetch. This allows the server-side image prefetch to reach internal-only HTTP services (SSRF). ## Details - **Affected version / commit:** 9router `v0.4.80` @ `b282f05`. - **Reachable through** `/v1/chat/completions` with a **vision-capable model** and an `image_url` content part. A vision-capable model name is required so the image survives modality stripping and the server-side prefetch is armed. - The provider used in this reproduction is the bundled **mock provider** — **no real API key and no real provider call**. - **internal-admin** (the SSRF target) is **not exposed to the host network**; it is reachable only from inside the Docker network. - **rebind-dns** behaviour for `rebind.9r.test`: - first A response → `1.1.1.1` (public) to pass the public-host guard, - second A response → `172.29.0.10` (internal-admin) during the fetch. - **internal-admin** logs `GET /ssrf-marker` with `peer=172.29.0.30` (the `proxied-router` container), proving the server-side fetch landed on the internal service. - **mock-provider** receives `POST /api/chat` and the flow completes with `HTTP 200`. - **Root cause:** DNS TOCTOU — the IP is **not pinned** between the validation resolution (the public-host guard) and the fetch resolution. The guard and the fetch each resolve the hostname independently, so a TTL-0 rebinding authority can return a public IP to the guard and an internal IP to the fetch. ## Proof of Concept This repository is a self-contained Docker Compose reproduction. No real provider is called and no real API key is required. 1. Build and start the stack: ```bash docker compose up --build ``` 2. Confirm `internal-admin` is unreachable from the host: ```bash curl -i http://127.0.0.1:18083/ssrf-marker # connection refused / fail docker compose ps # internal-admin has NO host port mapping ``` 3. Send the request named **`POST image-prefetch DNS rebinding trigger`** from [`requests.http`](./requests.http), or with curl: ```bash curl -i -X POST http://127.0.0.1:18082/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{ "model": "ollama-local/gemma3", "messages": [{"role":"user","content":[ {"type":"text","text":"reproduction image-prefetch trigger"}, {"type":"image_url","image_url":{"url":"http://rebind.9r.test:8080/ssrf-marker?case=rebind-trigger"}} ]}], "stream": false }' ``` ## Impact - SSRF to internal HTTP services reachable from the 9router host/container. - Depending on the environment, this can reach cloud metadata endpoints, internal admin panels, or be used for internal service discovery. - Blind / semi-blind SSRF when the fetched response is not returned to the attacker; an exfil variant (pointing the image at an internal endpoint that returns valid image bytes) can return internal content base64-encoded to the upstream. - Requires a code path that prefetches/normalizes remote images for vision-capable providers. - No real credential is needed for the reproduction. ## Suggested Fix - **Pin the resolved IP** after validation and connect to **that** IP (resolve once, then reuse the address for the fetch). - Block private, loopback, link-local, multicast, and cloud-metadata ranges **at connect time**, not only at validation time. - Perform DNS resolution and IP checks immediately before the request and against the address actually used to connect. - Disable redirects, or re-validate every redirect target with the same checks. - Enforce an allowlist for image-fetch domains where feasible. - Add a timeout, a response size limit, and a content-type check.
Exploitation Scenario
An attacker with a low-privilege account on a shared 9router deployment registers a domain whose authoritative DNS server answers with TTL 0, first with a public IP and then with an internal IP. They send a /v1/chat/completions request with a vision-capable model and an image_url pointing to that domain. The router's guard resolves the public IP and approves it. The prefetch then resolves again and connects to an internal admin service or the cloud metadata endpoint. The attacker repeats the request to enumerate internal services and, where an endpoint returns image-like content, reads it back through the model request.
Weaknesses (CWE)
CWE-367Time-of-check Time-of-use (TOCTOU) Race ConditionPrimaryCWE-918Server-Side Request Forgery (SSRF)PrimaryCWE-367 — Time-of-check Time-of-use (TOCTOU) Race Condition: The product checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check.
- [Implementation] The most basic advice for TOCTOU vulnerabilities is to not perform a check before the use. This does not resolve the underlying issue of the execution of a function on a resource whose state and identity cannot be assured, but it does help to limit the false sense of security given by the check.
- [Implementation] When the file being altered is owned by the current user and group, set the effective gid and uid to that of the current user and group when executing this statement.
Source: MITRE CWE corpus.
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:LReferences
Timeline
Related Vulnerabilities
CVE-2026-4633910.09router: unauthenticated RCE exposes LLM API keys
Same package: ollamaCVE-2026-422489.8Ollama: silent auto-update bypasses signature check on Windows
Same package: ollamaCVE-2025-633899.8ollama: Missing Auth allows unauthenticated access
Same package: ollamaCVE-2026-422499.8Ollama: path traversal + unsigned update = silent RCE
Same package: ollamaCVE-2026-74829.1Ollama: heap OOB read leaks API keys and chat data
Same package: ollama