Repository navigation
Conversation
parseVaryHeader wrote the Vary map with a bare assignment (output[trimmedHeader] = ...). For a Vary field literally named __proto__ this hits the Object.prototype __proto__ setter instead of creating an own property, so no dimension is recorded and varyMatches treats the stored entry as matching every request. A shared cache then serves one tenant's cached response to another when the application uses a __proto__ request header to vary responses. Use the setHeader util, already imported and used by the cache key and deduplication builders, so the field is stored as an own property.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6234 +/- ##
==========================================
+ Coverage 91.67% 91.71% +0.04%
==========================================
Files 113 113
Lines 44489 44816 +327
==========================================
+ Hits 40786 41105 +319
- Misses 3703 3711 +8 ☔ 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.
parseVaryHeaderwrites the Vary map with a bare assignment, so a Vary field literally named__proto__hits theObject.prototype.__proto__setter instead of creating an own property. The parsed map ends up empty, andvaryMatchesthen treats the stored entry as matching every request. In shared cache mode, an application that uses a__proto__request header to vary per-tenant responses would have one tenant's cached body served to another.Store the field via the
setHeaderutil (already used by the cache key and deduplication builders) so it becomes an own property, and add a regression test that asserts the cache keeps two__proto__variants separate.