You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Block private and loopback dials in webhook HTTP client
A tenant with rights to create MCPWebhookConfig could previously point
url at any HTTPS endpoint, including 169.254.169.254, 127.0.0.1, RFC1918
ranges, and IPv6 loopback or link-local addresses. The webhook HTTP
transport built a bare http.Transport with no DialContext; the wrapping
networking.ValidatingTransport only checks the URL scheme, not the
resolved peer address, so cross-tenant access to cloud metadata or
in-cluster services was unblocked.
Wire networking.ProtectedDialerControl into the inner transport's
DialContext so private, loopback, and link-local destinations are
rejected at dial time, regardless of whether ValidatingTransport's
HTTPS check is bypassed via InsecureAllowHTTP. The hook is held in an
atomic.Pointer so test overrides remain race-free if a future test
introduces t.Parallel().
Export protectedDialerControl as ProtectedDialerControl in pkg/networking
so the webhook package can install it without duplicating the body.
Add cross-package test injection (SetDialerControlForTesting,
SetDialerControlForTestMain, AllowAnyDialerControl) so existing
httptest-based tests in pkg/webhook and its subpackages continue to
work; subpackage TestMain functions install the permissive override
at suite startup. The pkg/runner webhook middleware integration test
installs the same override, since its production webhook clients dial
httptest servers on 127.0.0.1.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments