fix(guard): stop aliasing requested keys to an unrelated issue - #3
Merged
Conversation
Guard::assess indexed a requested key via fetched.values().last(), which binds it to the lexicographically last fetched issue instead of the one just fetched — wrong classification and cross-issue disclosure on moved-issue redirects (I8, I4). Bind the requested key explicitly to the just-fetched body; unresolvable keys still deny uniformly (I2). Wiremock tests pin the aliasing ordering and both redirect shapes.
plusky
enabled auto-merge (rebase)
August 8, 2026 19:34
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.
Guard::assessindexed each fetched issue under the server-reported key, then aliased the requested key viafetched.values().last()— the lexicographically greatest key in theBTreeMap, not the issue just fetched. A moved-issue redirect whose reported key sorts below an already-fetched key bound the requested key to an unrelated issue's body, which was then classified and served under the requested key.The fix binds the requested key explicitly to the just-fetched issue value, preserving legitimate case/moved-issue redirects while making cross-issue aliasing impossible.
Invariants: I8 (assessment is provably about the served body), I4/I2 (unresolvable keys still deny with the uniform text).
Tests: two new wiremock tests; both empirically confirmed to fail against the unfixed code — one reproduces the cross-issue grant (requested key wrongly served another issue's allowed body).
Process: AI-assisted — implemented and independently adversarially reviewed against
docs/DESIGN.md(verdict: approve, with an empirical pre-fix-failure check). Full verification suite green at the commit.