Repository navigation
fix(delegation): reject private JWKs in trusted_root_keys, duplicate lattice entries, and invalid credential bounds (#647) - #649
Open
drk-ram wants to merge 1 commit into
Conversation
…lattice entries, and invalid credential bounds (agentrust-io#647) - Reject RFC 7517/7518 private or symmetric JWK parameters in context.trusted_root_keys without echoing secret values. - Bound context.max_depth to JCS_SAFE_INTEGER and reject duplicate entries in context.data_class_lattice. - Require non-empty credential issuer and holder strings, integer not_before and not_after in [0, JCS_SAFE_INTEGER], and not_before <= not_after. - Seed visited with id(current) in verify_delegation_chain so a cycle returning to leaf terminates on the first return. Closes agentrust-io#647 Signed-off-by: Raghuvar Karthik Durga <177662415+drk-ram@users.noreply.github.com>
Contributor
|
🟡 Contributor Check: MEDIUM
Automated check by AgenTrust Contributor Check. |
Member
|
Batch response for this cluster is here: #653 (comment) |
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 this changes
Closes #647.
Hardens
_validate_contextandverify_delegation_chaininsrc/agentrust_trace/delegation.py:d,p,q,dp,dq,qi,oth,k) on entries incontext.trusted_root_keyswithout echoing secret values.context.max_depthtoJCS_SAFE_INTEGER(9007199254740991) and rejects duplicate entries incontext.data_class_lattice.issuerandholderstrings on each credential incontext.credentials, boundsnot_beforeandnot_afterto[0, JCS_SAFE_INTEGER], and requiresnot_before <= not_after.visited = {id(current)}inverify_delegation_chainso a cycle returning to the leaf stops at the first return.Validation commands and results:
PYTHONPATH=src python -m pytest tests/test_delegation_module.py tests/test_delegation_vectors.py -q-> passed (143 passed)python -m ruff check src/agentrust_trace/delegation.py tests/test_delegation_module.py-> passed (All checks passed!)PYTHONPATH=src python -m mypy src/agentrust_trace-> passed (Success: no issues found in 17 source files)python tools/check_dashes.py-> passed (no dashes outside examples/, spec/trace-v0.1.md)PYTHONPATH=src python tools/review_bar.py --base origin/main --head HEAD-> passed (18 changed test cases fail on behaviour at origin/main)Type of change
Spec section
src/agentrust_trace/delegation.py(informative A2A delegation chain profile; no normative change tospec/trace-v0.2.md)Tests for a fix
_JWK_PRIVATE_PARAMS.intersection(jwk)check oncontext.trusted_root_keys:tests/test_delegation_module.py::test_verify_delegation_chain_rejects_private_jwk_members_in_trusted_root_keysmax_depth <= JCS_SAFE_INTEGERcheck:tests/test_delegation_module.py::test_verify_delegation_chain_rejects_max_depth_above_safe_intlen(set(lattice_list)) != len(lattice_list)check oncontext.data_class_lattice:tests/test_delegation_module.py::test_verify_delegation_chain_rejects_duplicate_data_class_lattice_entriesissuerandholder,0 <= val <= JCS_SAFE_INTEGERonnot_before/not_after, andnot_before <= not_after:tests/test_delegation_module.py::test_verify_delegation_chain_rejects_invalid_credential_identities_and_windowsvisited: set[int] = {id(current)}initialization inverify_delegation_chain:tests/test_delegation_module.py::test_verify_delegation_chain_stops_at_first_return_to_leaf_in_cycleChangelog entry
agentrust_trace.delegation.verify_delegation_chainnow rejects RFC 7517/7518 private or symmetric JWK members incontext.trusted_root_keys, duplicate entries incontext.data_class_lattice,context.max_depth > 9007199254740991, empty credentialissuer/holderstrings, out-of-range or inverted credentialnot_before/not_afterbounds, and seedsvisitedwith the initial leaf record.Checklist
git commit -s)<!-- CHANGED: #NNN: description -->in spec text