Repository navigation
Conversation
The server decodes the path, so request.url.path (used for routing, auth, filter checks and forwarding) is truncated at a decoded '?'/'#'. e.g. DELETE /collections/c/items/a%3Fb was checked against and applied to item 'a'. Reject such requests instead of acting on another record. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #217 +/- ##
==========================================
+ Coverage 89.76% 89.77% +0.01%
==========================================
Files 30 30
Lines 1348 1350 +2
Branches 180 181 +1
==========================================
+ Hits 1210 1212 +2
Misses 97 97
Partials 41 41
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
The server decodes the request path, so an item id containing an encoded
?or#(e.g.a%3Fb) makesrequest.url.pathstop at.../items/a. Every middleware (routing, auth, filter checks) and the reverse proxy use that truncated path, so they agree with each other, but the request acts on a different record from the one the client addressed. For example,DELETE /collections/c/items/a%3Fbdeletes itema.The reverse proxy now returns
400for such paths instead of forwarding them.Why not forward the encoded path instead? About 10 places use
request.url.path, includingEnforceAuthMiddleware. Moving only some of them to the encoded path would make auth and filter decisions disagree with what gets forwarded, and that would be a bypass. Rejecting is the small, safe fix. The trade-off is that ids containing?or#can't be reached through the proxy; before this change such requests quietly acted on the wrong item.The test fails on
main, where the DELETE is forwarded.🤖 Generated with Claude Code