Mcp contextforge gateway: ContextForge: DNS TOCTOU race condition causes SSRF protection bypass (`/admin/gateways/test`) (CVE-2026-53708)
ContextForge is an AI gateway, registry, and proxy that provides centralized discovery, guardrails, and management for MCP, A2A, and REST or gRPC APIs. Prior to 1.0.3, the /admin/gateways/test call site in mcpgateway/admin.py calls validate_gateway_test_url() in mcpgateway/common/validators.py to resolve and reject private, loopback, link-local, and cloud-metadata addresses, but ResilientHttpClient later resolves the original hostname again without binding the validated address. When MCPGATEWAY_ADMIN_API_ENABLED is enabled, an attacker with a database-backed role containing explicit gateways.read permission can use DNS rebinding to return a public address during validation and a private or metadata address during connection, bypassing ssrf_blocked_networks and ssrf_dns_fail_closed because those controls apply only to the validation-time result. The endpoint's allow_admin_bypass=False setting means a bootstrap-only virtual platform-admin identity without a database role is not sufficient. Successful exploitation can reach internal services and cloud metadata, expose cloud credentials, access internal APIs, or probe internal network ports. This issue is fixed in version 1.0.3.
AI Analysis
Technical Summary
The /admin/gateways/test endpoint in mcp-contextforge-gateway performs hostname validation by resolving DNS and blocking private IP ranges at validation time. However, the HTTP client (httpx via ResilientHttpClient) independently re-resolves DNS at connection time without binding to the validated IP address, creating a TOCTOU window exploitable via DNS rebinding. This allows an attacker controlling DNS to present a public IP during validation and a private IP during connection, bypassing SSRF protections. The vulnerability requires MCPGATEWAY_ADMIN_API_ENABLED=true and a credential with gateways.read permission. The maintainers explicitly acknowledge this limitation in the source code and track it as an open defect (ICACF-15).
Potential Impact
An attacker with valid credentials holding gateways.read permission and with the admin API enabled can exploit the DNS TOCTOU race condition to bypass SSRF protections. This may allow the attacker to cause the system to connect to internal or private IP addresses that should be blocked, potentially exposing internal services or sensitive data. The vulnerability does not allow privilege escalation or denial of service directly but compromises the SSRF protection mechanism.
Mitigation Recommendations
A patch is available for this vulnerability. Operators should upgrade to a fixed version to eliminate the DNS TOCTOU race condition. Until patched, mitigation requires ensuring MCPGATEWAY_ADMIN_API_ENABLED is not enabled unless necessary and strictly controlling credentials with gateways.read permission. The vendor acknowledges the limitation and tracks it for future improvement; thus, applying the official fix is recommended. No temporary workaround is described in the advisory.
Mcp contextforge gateway: ContextForge: DNS TOCTOU race condition causes SSRF protection bypass (`/admin/gateways/test`) (CVE-2026-53708)
Description
ContextForge is an AI gateway, registry, and proxy that provides centralized discovery, guardrails, and management for MCP, A2A, and REST or gRPC APIs. Prior to 1.0.3, the /admin/gateways/test call site in mcpgateway/admin.py calls validate_gateway_test_url() in mcpgateway/common/validators.py to resolve and reject private, loopback, link-local, and cloud-metadata addresses, but ResilientHttpClient later resolves the original hostname again without binding the validated address. When MCPGATEWAY_ADMIN_API_ENABLED is enabled, an attacker with a database-backed role containing explicit gateways.read permission can use DNS rebinding to return a public address during validation and a private or metadata address during connection, bypassing ssrf_blocked_networks and ssrf_dns_fail_closed because those controls apply only to the validation-time result. The endpoint's allow_admin_bypass=False setting means a bootstrap-only virtual platform-admin identity without a database role is not sufficient. Successful exploitation can reach internal services and cloud metadata, expose cloud credentials, access internal APIs, or probe internal network ports. This issue is fixed in version 1.0.3.
CVSS v3.1
Score 6.6medium
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The /admin/gateways/test endpoint in mcp-contextforge-gateway performs hostname validation by resolving DNS and blocking private IP ranges at validation time. However, the HTTP client (httpx via ResilientHttpClient) independently re-resolves DNS at connection time without binding to the validated IP address, creating a TOCTOU window exploitable via DNS rebinding. This allows an attacker controlling DNS to present a public IP during validation and a private IP during connection, bypassing SSRF protections. The vulnerability requires MCPGATEWAY_ADMIN_API_ENABLED=true and a credential with gateways.read permission. The maintainers explicitly acknowledge this limitation in the source code and track it as an open defect (ICACF-15).
Potential Impact
An attacker with valid credentials holding gateways.read permission and with the admin API enabled can exploit the DNS TOCTOU race condition to bypass SSRF protections. This may allow the attacker to cause the system to connect to internal or private IP addresses that should be blocked, potentially exposing internal services or sensitive data. The vulnerability does not allow privilege escalation or denial of service directly but compromises the SSRF protection mechanism.
Mitigation Recommendations
A patch is available for this vulnerability. Operators should upgrade to a fixed version to eliminate the DNS TOCTOU race condition. Until patched, mitigation requires ensuring MCPGATEWAY_ADMIN_API_ENABLED is not enabled unless necessary and strictly controlling credentials with gateways.read permission. The vendor acknowledges the limitation and tracks it for future improvement; thus, applying the official fix is recommended. No temporary workaround is described in the advisory.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-9hgc-g3w5-67cm
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2026-53708"]
- Ecosystems
- ["PyPI"]
- Database Specific Severity
- MODERATE
- Cvss Version
- 3.1
Threat ID: 6a7ff5f6bf8831d53988006a
Added to database: 08/15/2026, 05:15:34 UTC
Last enriched: 09/14/2026, 22:13:47 UTC
Last updated: 09/30/2026, 06:54:39 UTC
Views: 117
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.