-
-
Notifications
You must be signed in to change notification settings - Fork 429
fix(security): fixing double URL decode of REQUEST_URI #4047
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
Contributor
|
📊 Quantitative test results for language: |
theseion
previously approved these changes
Mar 23, 2025
Member
|
You probably need to update test 930110-7? |
Member
Author
Member
Author
|
Ready for review. |
theseion
approved these changes
Mar 25, 2025
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.
Variable
REQUEST_URIis URL decoded by the engine so we should NOT uset:urlDecodeUni/t:urlDecodeactions with it, otherwise, the value gets URL decoded twice.It looks as better fix for rule
921240to remove actiont:urlDecodeUniand keep usingREQUEST_URIbut it is not as rule runs in phase 1 and, thanks to a bug in modsec2,REQUEST_URIis URL decoded at the start of phase 2. This does not apply for modsec3, where it is URL decoded at the start of phase1, so we need to useREQUEST_URI_RAW+t:urlDecodeUnito keep consistent bahavior accross the engines (by the way, current behavior of this rule differs between modsec2 and 3 as it gets double URL decoded in modsec3 but not in modsec2).Note: Variable
REQUEST_URI_RAWmay contain also domain name (if it was send by client) which is a different behavior fromREQUEST_URIbut it shoud not interfere with affected rules.