Repository navigation
fix: invalidate relative-path Location targets - #151
Merged
Merged
Conversation
Relative-path Location and Content-Location were explicitly skipped before the ban. Resolve them against the unsafe request directory, reduce literal dot segments with a conservative same-host fallback, and preserve query identity. Real HTTP regressions verify cache and origin request IDs, trailing parent segments, unrelated objects, and existing reference forms.
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.
Summary
Fixes #147. The cache policy explicitly skipped relative paths before constructing a ban. Both headers now resolve against the unsafe request URL. Eight bounded reduction passes fall back to a conservative same-host ban for unusually deep navigation; scheme-relative references remain unsupported.
Evidence
make test-hostile-unsafe-locationfailed twice:expected GET relative-Location-item target after POST cache miss, got 'HIT', preserving the original backend request ID.After: real HTTP regressions pass for both headers, dot/parent segments (including trailing parents and empty segments), queries/fragments, deep-navigation fallback, unrelated-object preservation, and path-absolute/absolute controls.
COMPOSE_PARALLEL_LIMIT=1 make -j1 test test-e2e-hardpassed on the final revision, including the invalidation mutant canary.replay.shpassed its relative-reference scenario three times: warm GET HIT, then MISS after relative Location, Content-Location, and the path-absolute control.Merge Danger
Door: two-way
VCL and fixture changes only; revertable without data migration.
Blast Radius: cache
Unusually deep unresolved dot navigation invalidates all objects on the same host rather than risking stale data. Ordinary paths preserve unrelated objects; cross-host behavior is unchanged.