Summary
A race-condition-based server-side request forgery (SSRF) in 9Router allows bypassing initial image URL validation due to separate DNS resolutions for the same URL.
An authenticated user of the LLM proxy can exploit DNS rebinding with a vision-capable model to coerce the server into making HTTP requests to internal-only services.
Affected context
This vulnerability occurs in 9Router deployments where:
- The LLM proxy feature is enabled and accepts user-supplied image URLs
- A vision-capable model is used that triggers server-side image fetching
- DNS-based validation is performed separately from the actual HTTP fetch
- Internal HTTP services are reachable from the 9Router server network
The issue is specifically present in versions prior to 0.5.2.
Exploit preconditions
- Attack surface: LLM proxy endpoint that processes user-provided image URLs
- Required access: Authenticated access to the LLM proxy with ability to submit arbitrary image URLs
- Trigger point: Server-side image fetch in
open-sse/translator/concerns/image.jsafter an initial host validation step - Why exploitation is possible: The host is validated using one DNS resolution, but the actual fetch performs a separate DNS resolution; an attacker-controlled domain can rebind between these steps, causing the server to connect to internal addresses despite passing the initial check.
Why this happens
The root cause is a time-of-check, time-of-use (TOCTOU) inconsistency in DNS-based URL validation that underpins an SSRF condition.
The application first resolves the image host to validate that it points to an allowed, presumably public, IP address.
Later, during the actual image fetch, it performs a separate DNS resolution, trusting the hostname again instead of the previously validated address.
This aligns with CWE-367 (Time-of-check Time-of-use) combined with CWE-918 (Server-Side Request Forgery), where relying on mutable DNS information between validation and use allows attackers controlling DNS to redirect server-side requests to internal network targets.
Potential impact
- Access to internal-only HTTP services that are not exposed publicly
- Enumeration of internal network endpoints and metadata services
- Potential interaction with internal admin panels, APIs, or debugging endpoints
- Use of the 9Router server as a pivot point for further network reconnaissance
General mitigation guidance
Mitigations generally focus on making URL validation and use consistent, and minimizing trust in DNS resolution for access control.
Common patterns include:
- Binding the actual HTTP request to the exact IP address that was validated at check time, rather than re-resolving the hostname
- Implementing strict network egress controls so application components cannot directly reach internal or metadata endpoints from HTTP clients
- Enforcing allowlists of destinations or IP ranges that server-side HTTP clients may contact
- Treating all user-specified URLs as untrusted and avoiding reliance on DNS alone for determining whether a target is safe
- Running server-side HTTP fetch logic with minimized network privileges and restricted routing visibility to sensitive internal services
How teams detect issues like this
Detection typically involves a combination of code-level and behavior-level analysis:
- Static analysis rules that flag patterns where host/IP validation is separated from the actual connection step, especially with repeated DNS lookups
- Code reviews focusing on URL validation logic, ensuring the same resolved address is used for both validation and subsequent connections
- Security tests that simulate DNS rebinding scenarios to see whether validated URLs can be redirected to internal addresses
- Network monitoring and logging that identifies unusual outbound HTTP requests from the application to private IP ranges or internal hostnames
Automated security review tools can help highlight network client code paths that perform separate validation and connection resolutions.

