Repository navigation
FIX: Detect url/target params, double-encoded slashes, and backslash bypasses in OpenRedirectOutputScorer (#3324) - #3679
Merged
Roman Lutz (romanlutz) merged 5 commits intoNov 2, 2026
Conversation
…bypasses in OpenRedirectOutputScorer (microsoft#3324)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Roman Lutz (romanlutz)
approved these changes
Nov 2, 2026
Roman Lutz (romanlutz)
left a comment
Contributor
There was a problem hiding this comment.
making the fix myself
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Allow raw and encoded scheme colons before leading encoded separators without scanning into paths or other parameters. Cover case and mixed encoding variants through public scoring and SQLite persistence. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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
This PR addresses the open redirect payload detection gaps reported in #3324 for
OpenRedirectOutputScorer(pyrit/score/true_false/regex/open_redirect_output_scorer.py):url,target,return_to, etc.): The previous parameter regex requiredredirect,return_url,returnto,next,continue,dest,goto,callback,forward, orlocation. It did not match common redirect parameters such asurl=(e.g.,?url=//attacker.example) ortarget=(e.g.,target=//attacker.example), which are among the most frequent open redirect sink query parameters in web applications.%252f%252f/%252F%252F):Encoded Slash Redirectpreviously matched only single%2f%2f. It now detects double-encoded slashes (%252f%252f,%255c%255c, and mixed variants) commonly used to evade basic decode filters./\,\/, and\\into network paths when resolving protocol-relative URLs.Protocol-Relative Redirect Paramnow supports these slash and backslash variants ([/\\]{2,}) leading to host destinations.Closes part of #3324.
Tests and Documentation
tests/unit/score/regex/test_open_redirect_output_scorer.py:url=,target=,return_to=, double-encoded%252f%252f/%255c, and backslash forms (/\,\/,\\).url=parameters.test_open_redirect_output_scorer.pyand all 1,241 tests intests/unit/score/regex/pass.ruff check,ruff format,ty check pyrit).