[v1.31.x] Validate both token readings in internal callback namespace check - #12382
Open
davidporter-id-au wants to merge 2 commits into
Open
davidporter-id-au wants to merge 2 commits into
davidporter-id-au wants to merge 2 commits into
Conversation
A bare ChasmComponentRef and a NexusOperationCompletion envelope share a wire type on field 6 (component_path vs. component_ref), so a bare ref can be crafted to also decode as an envelope wrapping a different ref. The validator was picking one reading and checking only that one, while history (chasm_invocation.go) always acts on the bare reading -- so validation and consumption could disagree on which ref a token actually refers to. Validate every reading the token's bytes can produce instead of picking one, rejecting if any targets a different namespace. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Contributor
|
Claude finished @davidporter-id-au's task in 1m 48s —— View job Reviewed 2 files, 0 findings. |
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
What
Follow-up to #11876 / #12319 on
release/v1.31.x.The internal-callback token can be read two ways: as a bare
ChasmComponentRef, or as aNexusOperationCompletionenvelope wrapping a ref. History's consumption path (chasm_invocation.go) always acts on the bare-ref reading. The validator added in #12319 picked one reading (envelope if it parsed cleanly, else bare) and checked only that one.This change validates every reading the token's bytes can produce instead of picking one, rejecting if any targets a different namespace, so the namespace check always agrees with what history will actually use.
Why?
Keeps the validator's view of "what namespace does this token target" consistent with what the rest of the system does with the same bytes.
How did you test it?
go build ./service/frontend/...go test -tags test_dep ./service/frontend/...Rollback
Nothing is persisted, so rolling back is safe.
🤖 Generated with Claude Code