feat(guard): runtime DNS SSRF bypass detection — WRD-RES-EXFIL-DNS-SSRF (#11)#73
Merged
Merged
Conversation
…FIL-DNS-SSRF, #11) Closes the bypass where WRD-RES-EXFIL-IP-LITERAL could not fire because the tools/call result contained a DNS hostname (e.g. 169.254.169.254.nip.io) rather than a raw IP literal. New rule WRD-RES-EXFIL-DNS-SSRF: guard resolves URL hostnames from result text at runtime via concurrent.futures.ThreadPoolExecutor (bounded 1 s, fail-open) and error-replaces when any resolved IP falls in SSRF_NETWORKS (link-local, loopback, RFC1918, IPv6 ULA/link-local/loopback). Opt-out via --no-block-exfil-dns-ssrf or --no-block-deterministic. Offline inspect command unchanged. Files: res_dns.py (new), res_catalog.py, result_inspection.py, guard_loop.py, guard_result.py, cli_guard.py, tests/test_res_dns.py (19 new), test_guard_posture.py (+4). All 530 tests pass. Closes DSE-58.
…workflow The repo transferred to DataScience-EngineeringExperts but the --certificate-identity flag still referenced the personal account (ernestprovo23). Fulcio mints a cert whose SAN reflects the actual org, so the exact-string equality check in sigstore 4.3.0 failed. Updated both the verify and negative-proof steps. Fixes Sigstore sign+verify (live) failure on PR #73.
ernestprovo23
added a commit
that referenced
this pull request
Jun 29, 2026
…-57) (#74) * feat(guard): runtime DNS resolution SSRF bypass detection (WRD-RES-EXFIL-DNS-SSRF, #11) Closes the bypass where WRD-RES-EXFIL-IP-LITERAL could not fire because the tools/call result contained a DNS hostname (e.g. 169.254.169.254.nip.io) rather than a raw IP literal. New rule WRD-RES-EXFIL-DNS-SSRF: guard resolves URL hostnames from result text at runtime via concurrent.futures.ThreadPoolExecutor (bounded 1 s, fail-open) and error-replaces when any resolved IP falls in SSRF_NETWORKS (link-local, loopback, RFC1918, IPv6 ULA/link-local/loopback). Opt-out via --no-block-exfil-dns-ssrf or --no-block-deterministic. Offline inspect command unchanged. Files: res_dns.py (new), res_catalog.py, result_inspection.py, guard_loop.py, guard_result.py, cli_guard.py, tests/test_res_dns.py (19 new), test_guard_posture.py (+4). All 530 tests pass. Closes DSE-58. * fix(ci): correct Sigstore certificate-identity org in integrity-gate workflow The repo transferred to DataScience-EngineeringExperts but the --certificate-identity flag still referenced the personal account (ernestprovo23). Fulcio mints a cert whose SAN reflects the actual org, so the exact-string equality check in sigstore 4.3.0 failed. Updated both the verify and negative-proof steps. Fixes Sigstore sign+verify (live) failure on PR #73. * feat(transport): add HTTP/SSE transport support to pin and check (DSE-57) Add streamable_http_client path to capture.py (_capture_http_async, capture_surface_http, capture_surface_http_sync). Extend CapturedSurface and ServerIdentity with optional url field (backward-compat, defaults None). Update _server_identity() to hash the URL when set. Route check_core run_check_full() and cli pin/check commands through HTTP capture when --url is provided; mutually exclusive with positional server-cmd. 6 new tests (async + sync, mocked transport, error paths).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
WRD-RES-EXFIL-DNS-SSRF: the guard now DNS-resolves URL hostnames fromtools/callresults at runtime and error-replaces when any resolved IP falls inSSRF_NETWORKSWRD-RES-EXFIL-IP-LITERALmissed destinations whose hostname (e.g.169.254.169.254.nip.io) resolves to a private/metadata IP rather than appearing as a raw literalHow it works
inspect_result()(pure, no IO), the guard extracts non-IP-literal URL hostnames from each result block viares_dns.extract_dns_candidates()res_dns.resolve_ssrf_hits()resolves them in aThreadPoolExecutorbounded by 1 second across all hosts — fail-open (anyOSError→ no hit)SSRF_NETWORKS(same table as the raw-IP-literal rule)WRD-RES-EXFIL-DNS-SSRF, block tier, error-replace (same posture asWRD-RES-EXFIL-DOMAIN)Opt-out
Files changed
src/mcp_warden/res_dns.pysrc/mcp_warden/res_catalog.pyinspect_exfil_dns_ssrf()src/mcp_warden/result_inspection.pyBLOCK_RULESsrc/mcp_warden/guard_loop.pyGuardConfig.no_block_exfil_dns_ssrf+_DET_OPTOUTentrysrc/mcp_warden/guard_result.pyinspect_result;_dns_ssrf_findings(); add toerror_rulessrc/mcp_warden/cli_guard.py--no-block-exfil-dns-ssrfflag wiredtests/test_res_dns.pytests/test_guard_posture.pyCHANGELOG.md[Unreleased]entry; remove DNS from out-of-scope listTest plan
uv run pytest tests/test_res_dns.py→ 19/19 passuv run pytest tests/test_guard_posture.py→ 14/14 passOSErrorfrom DNS → no findings, frame forwardedWRD-RES-EXFIL-IP-LITERAL)--no-block-exfil-dns-ssrfand--no-block-deterministicboth demote the rule🤖 Generated with Claude Code
https://claude.ai/code/session_01Btjz6CMgR5U9EZmzgCsaG5