Repository navigation
fix: keep authentic signed attributes when an extended attribute collides - #1370
Open
arpitjain099 wants to merge 1 commit into
Open
arpitjain099 wants to merge 1 commit into
arpitjain099 wants to merge 1 commit into
Conversation
…ides Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
arpitjain099
requested review from
NiazFK,
gokarnm,
priteshbandi,
rgnote,
shizhMSFT,
toddysm,
vaninrao10 and
yizha1
as code owners
October 14, 2026 11:08
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.
Description
getSignedAttributesseeds a flat map withcontentType,signingScheme,signingTimeandexpiry, then writes every envelope-supplied extended attribute into the same map. An extended attribute keyed on one of those four names therefore replaces the authentic signed value, and the real one never reachesnotation inspect -o jsonornotation blob inspect -o json. The tree handler is not affected, because it uses spaced display labels andAddPairappends, so it emits both rows.The fix is to populate the extended attributes first and write the four well-known keys after, so the authentic value always wins. The flat schema is documented in
specs/cmd/inspect.md, so I kept it rather than namespacing anything.Worth saying what this is not: a signer can already set
SigningTimeandExpiryto whatever they like in theSignRequest, andinspectperforms no verification, so nothing trusts this output. It is data loss in a machine-readable view, where two distinct fields collapse into one.TestGetSignedAttributesCollisionbuilds an envelope with a colliding attribute for each of the four keys plus one benign attribute. On main all four assertions fail, for instanceexpected signingTime 2023-11-14 17:13:20 -0500 EST, but got 1970-01-01T00:00:00Z; the benign attribute passes either way. ExistingTestGetSignedAttributesis untouched andgo test ./...is green.An alternative would be to skip the colliding key and log it instead of dropping it silently. Happy to switch if you would rather surface the collision.
AI assistance was used on this change and is disclosed in the commit trailer.