Repository navigation
fix(provenance): reject duplicate JSON keys, private JWKs, and non-dict records in check_server_provenance and validate required_kind in meets() (#813) - #818
Conversation
|
🟡 Contributor Check: MEDIUM
Automated check by AgenTrust Contributor Check. |
carloshvp
left a comment
There was a problem hiding this comment.
Reviewed exact head b4ae1bdfa981a591080e5d7c93179f613fc2c398 in an isolated checkout.
Provenance-file parsing now handles malformed containers and ambiguous JSON as controlled invalid outcomes, refuses private/symmetric material in the supplied public trust anchor, and validates required assurance kinds. The focused controls pass here and expose missing baseline rejection/error handling when the baseline module is restored. No embedded signer key is promoted to an out-of-band trust anchor by this change.
Independent validation in a fresh repository-hash-locked Python 3.12.10 environment: 2,531 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.
…ct records in check_server_provenance and validate required_kind in meets() (agentrust-io#813) - Reject duplicate JSON object keys and non-finite JSON constants when parsing provenance files, and fail closed when the parsed root is not a JSON object or when any OSError/UnicodeDecodeError occurs. - Reject private or symmetric JWK parameters in public_jwk before passing to verify_provenance_record. - Validate required_kind against _ASSURANCE_RANK in ProvenanceCheckResult.meets(). Closes agentrust-io#813 Signed-off-by: Raghuvar Karthik Durga <177662415+drk-ram@users.noreply.github.com>
b4ae1bd to
417e073
Compare
What
Reject duplicate JSON keys,
NaN/Infinity, non-dict JSON records, andtrusted_jwkdicts carrying private/symmetric key parameters incheck_server_provenance, guard non-stringkind/publisherfields, and validaterequired_kindinProvenanceResult.meets.Why
Closes #813.
Security impact
Prevents unhandled
AttributeError/TypeErrorcrashes on malformed server provenance files, prevents private key material intrusted_jwk, and ensures unknownrequired_kindvalues raiseValueErrorregardless of outcome.Test plan
pytestpasses (pytest tests/unit/test_provenance_consumption.py -q:22 passed)ruff checkpasses (All checks passed!)mypypassesDCO sign-off
Developer Certificate of Origin (https://developercertificate.org).