Repository navigation
fix: make the HTTP client SSRF sinks read the request destination only - #129
Merged
Merged
Conversation
This was referenced Sep 24, 2026
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.
Closes #128. This is the first of the model fixes that come before the stricter guard rule from the #98 measurement.
Change
get,post,put,patch,delete,head,options), or second after the method (request,stream), or passed asurl=. Forsend, the destination is the prepared request (request=). An argument that is not the destination (the body, JSON, headers, query parameters or method) no longer producesssrf. Responses stayhttp-responsesources for every function.Sink.keywords. A kind restricted bypositionsorkeywordsreaches exactly the arguments those restrictions list. A starred argument or**kwargsstill reaches no restricted kind, as before.mergedandSafeArgumentguarding keep the keywords.requests.post(url=target)inside a project function would have been lost.ExternalCall.keyword_dependenciesnow keeps each keyword's name,((name, dependencies), …), with None for*argsand**kwargs. The cache format moves from 8 to 9.Snapshot changes, reviewed
introduction/apis.py:83:ssrfremoved. The call isrequests.request("PATCH", url, data=payload)with a constant URL; only the POSTed CSRF token in the body is tainted. It was a false positive.httpie/client.py:114: one of the twossrfrecords at this line is gone, the other stays. The line isrequests_session.send(request=prepared_request, **send_kwargs_merged, **send_kwargs). The removed flow reachedsendonly through the**kwargsdicts of environment settings, not through the prepared request. The remaining flow is the prepared request itself, which stays a sink.Verification
pytest: 1032 passed.pytest -m regressionunder Python 3.12: 19 passed after re-recording only the two snapshots above.ruff check src testsandmypyare clean.test_keyword_arguments_are_conservatively_mergedbecomestest_keyword_arguments_keep_their_names. Merging was exactly what madeurl=undecidable through a summary.