Skip to content

Don't follow HTTP redirects in vuln_prober fetches - #25

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-management-80ac
Draft

cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-management-80ac

Conversation

@cursor

@cursor cursor Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Bug and impact

src/vuln_prober.py _http_get used urllib.request.urlopen, which follows 3xx by default — including cross-host hops. Scanning an authorized public HTTP target that returns Location: http://169.254.169.254/... (or RFC1918) made the agent fetch that body.

That is scanner SSRF. It also confirmed false findings from the off-origin response: Tomcat Manager unauthenticated access (CRITICAL) and directory listing, with metadata-like content treated as evidence.

probe_open_redirect in the same file already refused redirects; the shared GET helper did not.

This is distinct from #24 (header/stack/service/web fetchers). #24's helper comments that vuln_prober was already blocked, which was true only for the open-redirect probe, not _http_get.

Fix

_http_get now uses a no-redirect opener (same pattern as probe_open_redirect) and still applies the existing CERT_NONE TLS context. 3xx is returned as-is; callers that require 200/401 no longer confirm from a redirect destination.

Validation

  • Local origin 302 → off-origin /secret: _http_get returns 302, destination hit count stays 0, Tomcat and directory-listing probes return no finding.
  • Direct 200 still returns the in-scope body.
  • python3 -m pytest test_vuln_prober_redirect.py test_probers.py -q — 47 passed.
Open in Web View Automation 

_http_get used urllib's default urlopen, which follows 3xx including
cross-host hops. A public scan target that 302s to metadata or RFC1918
let the agent fetch that body and confirm Tomcat/directory-listing
findings from it. Refuse redirects the same way probe_open_redirect
already does.

Co-authored-by: dmitryflynn <dmitryflynn@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant