Repository navigation
fix(verify,runtime): reject private JWK members, non-canonical base64url, lone surrogates, duplicate JSON keys, and future revocation snapshots - #268
Closed
drk-ram wants to merge 1 commit into
Conversation
…url, lone surrogates, duplicate JSON keys, and future revocation snapshots - Reject RFC 7517/7518/8037 private or symmetric JWK members (d, p, q, dp, dq, qi, oth, k) and enforce canonical unpadded 32-byte base64url public keys in ca2a_verify.dag and ca2a_runtime.agent_manifest. - Reject lone UTF-16 surrogates (U+D800..U+DFFF) in ca2a_runtime.canonical string values and object keys with a deterministic ValueError. - Reject duplicate JSON object keys via object_pairs_hook in ca2a_verify.verify when loading chain and revocation files. - Raise RevocationStatusUnknown when max_revocation_staleness is configured and RevocationSnapshot.as_of is in the future relative to evaluation time. Closes agentrust-io#267 Signed-off-by: Raghuvar Durga <177662415+drk-ram@users.noreply.github.com> Co-authored-by: Raghuvar Durga <177662415+drk-ram@users.noreply.github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: Raghuvar Durga <177662415+drk-ram@users.noreply.github.com>
Contributor
|
Thanks for this, @drk-ram. Closing it for now, and it is not about the change itself. This repository asks first-time contributors to be vouched by a maintainer before opening a pull request. That is because agent-written contributions are easy to produce and expensive to review, and we would rather talk to you first than review something neither of us can explain. To get vouched: open an issue saying what you want to change and why, in your own words. A maintainer will reply, and add you with See CONTRIBUTING.md for the detail. |
Contributor
|
🟡 Contributor Check: MEDIUM
Automated check by AgenTrust Contributor Check. |
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
Hardens cryptographic key parsing, RFC 8785 canonicalization, JSON file loading, and revocation snapshot freshness enforcement across
ca2a_verifyandca2a_runtime:d,p,q,dp,dq,qi,oth,k) and enforces canonical unpadded 32-byte base64url public keys insrc/ca2a_verify/dag.pyandsrc/ca2a_runtime/agent_manifest.py.U+D800..U+DFFF) insrc/ca2a_runtime/canonical.pystring values and object keys with a deterministicValueErrorinstead of leakingUnicodeEncodeError.object_pairs_hookinsrc/ca2a_verify/verify.pywhen loading delegation chain and revocation files.RevocationStatusUnknowninsrc/ca2a_runtime/delegation/credential.pywhenmax_revocation_stalenessis set andRevocationSnapshot.as_of > now.Why
Closes #267.
Security impact
Touches
src/ca2a_verify/andsrc/ca2a_runtime/delegation/:ValueErrorduring canonical signing/verification.RevocationSnapshot.as_offrom producing a negativenow - revocations.as_ofdelta that bypassesmax_revocation_stalenessindefinitely.Test plan
pytestpasses (pytest tests/ -q— 875 passed, 16 skipped)ruff checkpasses (ruff check src/ tests/— All checks passed!)mypypasses (mypy src/ca2a_runtime/ src/ca2a_verify/— Success: no issues found in 47 source files)Verified counterfactual failures for all four fixes when each guard is disabled, and ran
bandit -r src/ -c pyproject.tomlwith zero issues.DCO sign-off
Developer Certificate of Origin (https://developercertificate.org).