Skip to content

fix(provenance): validate attestation by shape, not truthiness - #339

Open
rajnisht7 wants to merge 2 commits into
agentrust-io:mainfrom
rajnisht7:fix-malformed-attestation
Open

fix(provenance): validate attestation by shape, not truthiness#339
rajnisht7 wants to merge 2 commits into
agentrust-io:mainfrom
rajnisht7:fix-malformed-attestation

Conversation

@rajnisht7

Copy link
Copy Markdown
Contributor

What this changes

provenance._check_structure() checked attestation with truthiness (not attestation / attestation) instead of checking its type and shape. Spec (server-provenance-v1.md §3) says attestation must be null unless kind == "tee-attested", and must match the TRACE v0.2 §3.1 runtime shape when it is.

Truthiness doesn't enforce that:

  • {}, [], "" are falsy but not null, so a non-TEE record carrying any of them as attestation built and verified cleanly.
  • Any non-empty string/list/dict is truthy, so a tee-attested record with attestation: "hello" or ["anything"] passed too.
  • Even a schema-valid attestation could name platform: "software-only", which is not a hardware claim at all the same contradiction §1 rules out for tee-attested ("the server itself, from inside a TEE").

Because this check is shared with verify_record() (#146), a hand-forged, correctly-signed record with attestation: "not-actually-attestation" passed verification.

Type of change

  • Editorial (typo, link fix, clarification: no normative effect)
  • Non-breaking spec change (new optional field, new platform profile, informative addition)
  • Breaking spec change (requires 14-day comment period and Project Lead sign-off)
  • Schema change
  • Example addition

Spec section

Not a change to spec/trace-v0.2.md itself this implements the existing server-provenance-v1.md §3 attestation contract and TRACE v0.2 §3.1 runtime shape more strictly in code. No wire format or normative text changes.

Checklist

  • DCO sign-off on all commits (git commit -s)
  • CHANGELOG.md updated (for any normative change)
  • Breaking changes marked with <!-- CHANGED: #NNN: description --> in spec text
  • Backward compatibility statement included (for breaking changes)

Signed-off-by: rajnisht7 <rajnishtiwari9787@gmail.com>
@rajnisht7
rajnisht7 requested review from a team and lywinged as code owners September 12, 2026 17:12
Signed-off-by: rajnisht7 <rajnishtiwari9787@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant