fix(detection): report the urllib SSRF flow once, at the sink - #94
Merged
Conversation
Follow-up to #89, as flagged in review. urllib.request.Request() only *builds* a request; taint propagates through `req = Request(tainted)`, so urlopen(req) already flags the flow. Listing the constructor as an SSRF sink as well reported one vulnerability twice, on adjacent lines — and because dedup keys on (file, line, category), two different lines cannot be collapsed. dest = flask.request.args.get('dest') req = urllib.request.Request(dest) # was flagged (L4) urllib.request.urlopen(req).read() # already flagged (L5) Dropping the constructor loses no detection: the sink still catches it. Verified — the case the contributor added in #89 still passes, and every other SSRF shape is unchanged (get/post positional + keyword, requests. request positional + keyword, httpx.patch, aiohttp.request, direct urlopen). Also credits @AdvaitVarhade in CONTRIBUTORS.md for #89.
Signetry Reviewer — 🟡 Needs human reviewA human should decide — the required check is pending. Deterministic gates (the authority)
FindingsNo issues found by the deterministic scanners. MergeA human should review and merge.
|
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.
Follow-up to #89 — the one nit I said I'd handle myself rather than asking @AdvaitVarhade to push again.
urllib.request.Requestwas inssrf_targetsalongsideurllib.request.urlopen. ButRequest()only builds a request; taint propagates through the assignment, so the sink already catches the flow. Listing the constructor too reported one vulnerability twice — and since dedup keys on(file, line, category), findings on two different lines can't be collapsed.No detection lost
Verified every SSRF shape is unchanged, including the
urllibcase from #89's own test suite:All five constant-URL false-positive cases remain silent. 259 tests pass,
ruffclean. Addedtest_urllib_request_flow_is_reported_once_at_the_sinkto pin it.Also credits @AdvaitVarhade in
CONTRIBUTORS.mdfor #89.