Repository navigation
fix(verify/tdx,embodied_action): enforce hex format in verify_tdx_measurement and guard non-dict inputs in verify_embodied_action_evidence (#803) - #806
Conversation
|
🟡 Contributor Check: MEDIUM
Automated check by AgenTrust Contributor Check. |
ecf1781 to
5f35696
Compare
…surement and guard non-dict inputs in verify_embodied_action_evidence (agentrust-io#803) - Require lowercase sha384:<96 hex> measurement at Step 1 and validate report_data_hex format in verify_tdx_measurement. - Guard non-dict audit_entry, detached_payload, and claim_json nested fields and enforce exact sha256/sha384 digest lengths in verify_embodied_action_evidence. Closes agentrust-io#803 Signed-off-by: Raghuvar Durga <177662415+drk-ram@users.noreply.github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
5f35696 to
6513313
Compare
carloshvp
left a comment
There was a problem hiding this comment.
Reviewed exact head 65133135cee9c487036649a2997ca95c53fd81c2 in an isolated checkout.
The measurement parser now requires the declared lowercase SHA-384 format, malformed report data follows the controlled mismatch path, and embodied-action evidence rejects malformed containers and digest values without treating receipt validity as proof of policy authorization or physical completion. No blocking finding in the changed paths.
Local hash-locked Python 3.12.10 validation: 2,528 unit tests passed, 20 skipped; pip check, Ruff, mypy and Bandit passed. All PR commits have sign-offs. git diff --check notes one extra blank line at test_tdx_verify.py EOF, a nonblocking cleanup. Hosted CI and required maintainer gates still need completion.
Reviewed with OpenAI Codex.
noah-ing
left a comment
There was a problem hiding this comment.
Reviewed current head 65133135cee9c487036649a2997ca95c53fd81c2. The new shape guards treat a supplied but malformed TRACE Claim like no Claim at all. With the repository’s valid signed ROS2 evidence fixture, claim_json={"trace": None, "gateway": None} returns verified=True, no failures or warnings, and omits all policy, catalog, and agent cross-bindings. The added test currently asserts that success. Please preserve None as the explicit no-Claim mode, but return a nonverified result when a supplied Claim has malformed sections, and add a negative regression for that distinction. This is a fail-closed helper-contract concern; I have not shown a bypass of the documented flow that verifies the full TRACE Claim first.
The TDX format changes behaved as intended. Local exact-head validation: 2,528 unit tests passed, 20 skipped; focused negative fixture replay passed. Hosted CI is blocked by the existing locked-dependency audit, and required governance checks remain outstanding.
…med sections Signed-off-by: Raghuvar Durga <177662415+drk-ram@users.noreply.github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Thanks @noah-ing and @carloshvp! Updated |
|
Thanks for the follow-up. I checked head |
Signed-off-by: Srinivasa Consultants <78673153+dinakarjs@users.noreply.github.com>
dinakarjs
left a comment
There was a problem hiding this comment.
I prepared a signed adoption companion addressing the outstanding review finding: dinakarjs#6
Validation: unit suite 2547 passed/6 skipped; conformance+integration+confinement 114 passed/23 skipped. Ruff on src/tests, strict mypy and Bandit passed. All five malformed-identity parameter cases fail by assertion when just this fix is removed; valid/absent controls pass with the repair.
Please cherry-pick/adopt the companion and request independent re-review of the resulting head. I have contributed the follow-up and am not approving my own contribution.
|
Thanks @noah-ing! Distinguished absent |
|
Thanks @dinakarjs and @noah-ing! Adopted @dinakarjs's signed companion commit |
a59495d to
2411f8f
Compare
noah-ing
left a comment
There was a problem hiding this comment.
Reviewed exact head 2411f8f33811a9afdd63cfe80968527330d8c483. The supplied-but-malformed gateway.agent_identity cases now fail explicitly, while an absent identity remains optional; valid and mismatched identities behave as expected. I replayed nine cases against the signed ROS2 evidence fixture with receipt checking enabled. The focused tests passed (64/64), as did the full unit suite (2,533 passed, 20 skipped), Ruff, mypy, dependency and whitespace checks. This resolves my requested change, so I approve this scoped verifier fix. The normal hosted checks and merge gates still need to complete.
carloshvp
left a comment
There was a problem hiding this comment.
Reviewed exact head 2411f8f33811a9afdd63cfe80968527330d8c483 in an isolated checkout.
The updated source additionally rejects a supplied malformed Claim context and malformed present agent identity, while keeping the explicit no-Claim receipt-only mode and optional absent identity. The measurement, digest and container guards remain intact. Current receipt/Claim binding tests pass with valid controls; the reported receipt facts remain distinct from authorization and physical completion. No blocking finding in the updated paths.
Independent validation in a fresh repository-hash-locked Python 3.12.10 environment: 2,533 tests passed, 20 skipped; pip check, configured Ruff, mypy, Bandit and diff whitespace checks passed. Commit sign-offs are present. Hosted CI and applicable independent maintainer/security gates remain separate prerequisites to merge.
Reviewed with OpenAI Codex.
What
Enforce
^sha384:[0-9a-f]{96}$measurement format and valid hexreport_data_hexinverify_tdx_measurement, and guard non-dict inputs and exact digest lengths inverify_embodied_action_evidence.Why
Closes #803.
Security impact
Ensures malformed TDX measurement strings or
report_data_hexvalues are classified accurately (invalid_measurement_formatandreport_data_mismatch), and prevents unhandledAttributeError/TypeErrorwhenverify_embodied_action_evidencereceives non-dict inputs or malformedclaim_jsonstructures.Test plan
pytestpasses (pytest tests/unit/test_tdx_verify.py tests/unit/test_embodied_action_evidence.py -q)ruff checkpasses (ruff check src/cmcp_verify/tdx.py src/cmcp_verify/embodied_action.py tests/unit/test_tdx_verify.py tests/unit/test_embodied_action_evidence.py)mypypasses (mypy src/cmcp_verify/tdx.py src/cmcp_verify/embodied_action.py)DCO sign-off
Developer Certificate of Origin (https://developercertificate.org).