Repository navigation
Use the client IP and path set by earlier middleware - #823
Open
iacobdaniel wants to merge 3 commits into
Open
iacobdaniel wants to merge 3 commits into
iacobdaniel wants to merge 3 commits into
Conversation
A middleware before ours can change the client IP or the path. The Aikido middlewares read the request again when such a value changed, and the values from before stay scanned.
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.
Apps that set the client IP or rewrite the path in their own middleware, before the Aikido middleware, had their requests checked against the original IP and path. The Aikido middlewares for Django, Flask and ASGI read the request again when an earlier middleware changed the WSGI environ or the ASGI scope, so rate limits and the bypassed IP list use the rewritten client and route, and so do the IP lists and route allowlists that Starlette, FastAPI and Quart check before the route. Under Django ASGI only changes to
request.scopeare seen, not changes torequest.META. The headers, query and cookies from before the change are still scanned for attacks.