Summary
A validation flaw in TerriaJS-Server's proxy handling allows attackers to reach domains that are not explicitly listed in the proxyableDomains configuration.
When a vulnerable server is exposed, an attacker can abuse the proxy endpoint to perform Server-Side Request Forgery (SSRF), potentially accessing internal services or sensitive metadata from the server's network environment.
Affected context
This vulnerability affects deployments of TerriaJS-Server (prior to 4.0.3) that expose its HTTP(S) proxy feature to users.
It becomes relevant when:
- The server is reachable from untrusted clients (e.g., internet-exposed applications), and
- The
proxyableDomainsconfiguration is intended to restrict where the server may proxy requests.
Because of insufficient validation around requested target URLs, the proxy can be coerced into contacting domains and hosts that operators did not intend to allow, including internal or non-public endpoints, depending on network topology.
Exploit preconditions
- Attack surface: The TerriaJS-Server HTTP endpoint(s) that provide proxy functionality.
- Required access: Ability to send crafted HTTP requests to the server (usually unauthenticated or with the same level of access as typical end-users).
- Trigger point: Supplying a URL or domain parameter to the proxy endpoint that appears valid but bypasses the
proxyableDomainschecks. - Why exploitation is possible: The input validation logic around proxy target URLs is incomplete or flawed, allowing certain domain formats, hostnames, or URL constructions to pass checks even when they should be rejected, leading to server-initiated requests to unintended destinations.
Why this happens
The root cause lies in improper input validation (CWE-20) within the logic that decides whether a requested URL is permitted for proxying.
The server intends to enforce an allowlist of proxyableDomains, but the implementation does not correctly normalize, parse, or strictly compare the requested host against this allowlist.
As a result, an attacker can construct URLs that exploit edge cases in URL parsing or hostname comparison to bypass the allowlist and trigger Server-Side Request Forgery (CWE-918), where the server makes HTTP(S) requests to attacker-chosen destinations on the attacker's behalf.
Potential impact
- The server may access internal HTTP(S) services that are not otherwise exposed to the internet.
- Attackers could use SSRF to probe internal network topology (open ports, available services, metadata endpoints).
- Sensitive configuration or metadata available via HTTP (e.g., cloud instance metadata services) could be exfiltrated.
- Internal administrative panels, monitoring dashboards, or APIs reachable from the server's network could be accessed indirectly.
- Proxy functionality might be abused for logging evasion, partial anonymization, or as a stepping stone in broader attack chains.
General mitigation guidance
Effective mitigation generally focuses on tightening proxy authorization logic and reducing trust in user-supplied URLs:
- Apply strict, canonical URL parsing and normalization before validation, including explicit extraction and comparison of scheme, host, and port against a well-defined allowlist.
- Use exact or pattern-based host comparisons that do not rely on naïve substring checks, and treat edge cases (such as subdomains, dot-prefixed names, alternate encodings, and IPv6 literals) carefully.
- Restrict proxy functionality to the minimal set of protocols, ports, and hosts that are truly needed, preferring explicit lists over broad patterns.
- Where feasible, isolate the proxy component in a network segment with limited access to internal services and sensitive metadata endpoints.
- Apply the principle of least privilege at the network and application layers, ensuring that even if proxy validation fails, the process has limited reach and cannot access critical internal resources.
How teams detect issues like this
Detection typically involves a combination of code-centric and operational approaches:
- Static analysis & code review: Look for HTTP client code that forwards user-controlled URLs, particularly where domain checks are done with string operations rather than normalized host comparisons or where allowlists are loosely enforced.
- Configuration review: Audit
proxyableDomainsand related settings for overly broad patterns (e.g., wildcards, catch-all rules) that could mask validation weaknesses. - Dynamic testing: Use automated or manual testing to attempt proxying to clearly disallowed domains (e.g., internal hostnames, 127.0.0.1, metadata services) and confirm they are rejected.
- Logging & monitoring: Ensure proxy requests are logged with target URLs and response statuses; set up alerts for suspicious targets such as localhost, link-local addresses, or known metadata service endpoints.
- Security scanning tools: Incorporate SSRF-focused tests into CI/CD pipelines and periodic application security testing, using tools that specialize in finding server-side request issues.

