Repository navigation
[DRAFT] FIX: Normalize SSRF target hosts and reject URL near misses - #3536
Draft
Jaehyup (Jay) Shin (shin0343) wants to merge 2 commits into
Draft
Jaehyup (Jay) Shin (shin0343) wants to merge 2 commits into
Jaehyup (Jay) Shin (shin0343) wants to merge 2 commits into
Conversation
Classify built-in SSRF targets using normalized URL hosts, including IPv6, legacy numeric IPv4, metadata addresses, and known wildcard DNS forms. Consider client-dependent HTTP backslash authorities without making requests. Add public scoring and persistence regressions, network-boundary controls, custom-pattern compatibility tests, and synchronized notebook documentation. Related to microsoft#3324 (SSRF portion). Prepared with assistance from OpenAI Codex.
Author
|
@microsoft-github-policy-service agree |
1 similar comment
Author
|
@microsoft-github-policy-service agree |
Author
|
The This remains a draft for scope review: it covers only the SSRF portion of #3324 and leaves the umbrella issue open. The PR records 32,202 passing local unit tests, 1,256 passing regex scorer tests, and offline host-normalization checks without DNS requests. Feedback on whether this SSRF-only scope fits the intended direction would help move it forward. |
This branch has not been deployed
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.
Description
SSRFOutputScorermisses internal URL targets such ashttp://[::ffff:127.0.0.1]/,http://2130706433/, andhttp://user:pass@127.0.0.1/. It also flags public URLs such ashttp://10.0.0.1.example.com/and URLs containing a metadata address only in user information or a path.The built-in configuration now classifies the complete URL host, normalizes IPv6 and legacy numeric IPv4, and recognizes known IP-based nip.io/sslip.io names and localtest.me without DNS requests. Metadata coverage includes AWS IPv6 IMDS, AWS ECS, and Alibaba. For HTTP(S), both authority interpretations used by clients such as Requests and HTTPX are considered when a backslash is present. Other custom pattern mappings retain their literal regex behavior, and the existing named rationales, categories, and public scoring/persistence contracts are preserved.
Related to #3324, originally reported by Authensor (@AUTHENSOR). This PR addresses its SSRF portion only and leaves the umbrella issue open. It is a draft for scope review with the issue author and maintainers; I did not find an overlapping SSRF implementation PR. Matching remains a payload heuristic rather than proof that a request executed or that an arbitrary hostname resolves internally.
Tests and Documentation
mainat2092dd7(make unit-test): 32,202 passed, 23 skipped.socket.inet_atonfound no mismatches and made no DNS requests.doc/code/scoring/1_true_false_scorers.pyand its paired notebook. Their 26 cells remain synchronized and existing notebook outputs are preserved. This documentation-only change was checked without executing live API examples.AI assistance: implementation, tests, and this description were prepared with OpenAI Codex.