mediumCVSS 6.6Vulnerability

CVE-2026-53708

## Summary The `/admin/gateways/test` endpoint validates submitted URLs by resolving the hostname at validation time and blocking private address ranges. The HTTP client independently re-resolves DNS at connection time with no IP binding between the two operations, creating a TOCTOU window exploitable via DNS rebinding. The source code explicitly acknowledges this limitation in two separate locations. ## Details `validate_gateway_test_url()` in `mcpgateway/common/validators.py` (lines 1527–1710) calls `socket.getaddrinfo()` on the submitted hostname, checks whether the resolved IP falls in private, loopback, link-local, or cloud-metadata ranges (including `169.254.169.254`, `10.0.0.0/8`, `172.16.0.0/12`, and `192.168.0.0/16`), and accepts the URL if the result is clean. The validated URL is then passed to the HTTP client **as the original hostname string**, not as the validated IP address. The HTTP client (`httpx`, via `ResilientHttpClient`) performs its own independent DNS resolution at connection time. No mechanism bridges the two resolutions: - The validated IP address is never passed to the HTTP client. - Only the original hostname is forwarded, triggering a second independent lookup. - No TTL enforcement, mandatory DNS-cache reuse, or IP-level socket binding is implemented. The configuration options `ssrf_blocked_networks` (default: enabled, covers `169.254.169.254/32`, link-local ranges, etc.) and `ssrf_dns_fail_closed` (default: `True`) apply exclusively at **validation time**. They share the same TOCTOU gap because they operate on the validation-time resolution result, not on the connection-time resolution performed by the HTTP client. ### Two independent acknowledgements in the source code **Location 1** — `mcpgateway/common/validators.py`, lines 1537–1543 (function docstring of `validate_gateway_test_url`): > "DNS TOCTOU Limitation: This validation resolves DNS at validation time, but > the HTTP client will re-resolve DNS at connection time. An

Properties

ghsa_id
GHSA-9hgc-g3w5-67cm
severity
medium
summary
ContextForge: DNS TOCTOU race condition causes SSRF protection bypass (`/admin/gateways/test`)
cvss_score
6.6
cve_id
CVE-2026-53708
cvss_vector
CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:L/A:N
is_ghsa_only
false
ghsa_published
2026-08-14T19:49:14Z
source_url
https://github.com/advisories/GHSA-9hgc-g3w5-67cm
ghsa_updated
2026-08-14T19:49:14Z

Related Entities (6)

VULNERABLE_TO (1)

[Software]pip/mcp-contextforge-gateway

AFFECTS (1)

[Software]pip/mcp-contextforge-gateway

HAS_WEAKNESS (3)

[Weakness]Reliance on Reverse DNS Resolution for a Security-Critical Action
[Weakness]Time-of-check Time-of-use (TOCTOU) Race Condition
[Weakness]Server-Side Request Forgery (SSRF)

REPORTED_BY (1)

[Source]GitHub Advisory Database

Explore deeper with Ninja Signal's threat intelligence graph

CVE-2026-53708 (CVSS 6.6) — Ninja Signal Threat Intelligence | Ninja Signal