prototype(verifier_token,execution_appraisal): enforce canonical 32-byte nonces, validate RelyingParty.challenge/verify_proof inputs, and reject non-finite JWT JSON
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- python
- Domain
- backend-api-design, security
Research direction
Start with the listed validation points in prototype/verifier_token.py, prototype/cmcp_gate.py, and prototype/execution_appraisal.py, then inspect the related nonce, challenge, proof, and token appraisal tests. Check how the code handles canonical nonces, exact integer ranges, and JSON constants. Done means all three boundaries enforce the stated constraints and the relevant tests cover the rejected inputs; pull request #634 is already open.
Written by the indexing model from the issue text.
Description
Summary
Three verification-boundary gaps exist in prototype/verifier_token.py, prototype/cmcp_gate.py, and prototype/execution_appraisal.py:
-
Non-canonical 43-character base64url nonces accepted in
Proof,RelyingParty.challenge, andCMCPTraceGate._prove(prototype/verifier_token.pylines 229, 770;prototype/cmcp_gate.pyline 139):Proof.nonceandRelyingParty.challengecheck onlyr"^[A-Za-z0-9_-]{43}$"(andCMCPTraceGate._provecheckslen(nonce) != 43) without verifying that the 43-character base64url string has zero unused trailing pad bits (_b64url(nonce)round-trip). As a result,"A" * 42 + "B"(non-zero pad bits) is accepted as a valid nonce.
-
Unvalidated caller parameters in
RelyingParty.challengeandverify_proof(prototype/verifier_token.pylines 730-780):RelyingParty.challengedoes not checkisinstance(nonce, str)beforere.fullmatch, does not validatesession_id(Identifier) oraction_digest(Digest), and does not requiretype(issued_at) is intandtype(expires_at) is intwith0 <= issued_at < expires_at <= 9007199254740991(allowingissued_at=False, expires_at=Trueor negative timestamps).verify_proofdoes not checktype(now) is int,type(challenge_issued_at) is int, ortype(challenge_expires_at) is int(allowingnow=Trueto satisfy1 <= True < 2).
-
Non-finite JSON constants and unbounded integer timestamps in
prototype/execution_appraisal.py(lines 89-160):authenticate_tokenparses JWT header and claims viajson.loads(..., object_pairs_hook=_pairs)withoutparse_constant, allowingNaN/Infinityin JWT JSON, andappraise_launchdoes not boundiat,nbf,exp, andnowby9007199254740991(JCS safe integer range).
Proposed Fix
- Enforce canonical 32-byte base64url (
_b64url(nonce)) onProof.nonce,RelyingParty.challenge, andCMCPTraceGate._prove. - Validate
session_id,action_digest, and exact integer timestamps (0 <= issued_at < expires_at <= 9007199254740991) inRelyingParty.challengeandverify_proof. - Reject non-finite JSON constants (
parse_constant) inauthenticate_tokenand boundiat,nbf,exp, andnowby9007199254740991inappraise_launch.
- Dominant language
- Python
- Stars
- 37
- Forks
- 33
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 112
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from agentrust-io/trace-spec
-
fix(platform_measurement): reject non-string or empty runtime.measurement across Python and TypeScriptPossibly taken @drk-ram claimed this 3 days ago. Openneeds-review:MEDIUM
Difficulty 2/5 1-3 hours Newbie friendliness 30/100
agentrust-io/trace-spec#628 · 1 comment ·
Maintainers usually reply within 1 day
-
fix(provenance,validate): remove str() coercion on digest/hash fields in provenance and enforce strict JSON in schema loadersPossibly taken @drk-ram claimed this 3 days ago. Openneeds-review:MEDIUM
Difficulty 3/5 1-2 days Newbie friendliness 35/100
agentrust-io/trace-spec#627 · 1 comment ·
Maintainers usually reply within 1 day
-
conformance(runner): reject boolean/float level, invalid fmt, and malformed caller options at run() entryPossibly taken @drk-ram claimed this 3 days ago. Openneeds-review:MEDIUM
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
agentrust-io/trace-spec#626 · 1 comment ·
Maintainers usually reply within 1 day
-
conformance(inclusion): enforce registry-anchor-v1 surrogate/key/cycle rules and validate leaf_index/entry fieldsPossibly taken @drk-ram claimed this 3 days ago. Openneeds-review:MEDIUM
Difficulty 3/5 1-2 days Newbie friendliness 35/100
agentrust-io/trace-spec#625 · 1 comment ·
Maintainers usually reply within 1 day
-
prototype(azure_execution_binding): bind HCLAkPub exponent e and key size, reject duplicate JSON keys, and harden _secure_boot_state and authenticode_sha256Possibly taken @drk-ram claimed this 5 days ago. Openneeds-review:MEDIUM
Difficulty 4/5 3-5 days Newbie friendliness 20/100
agentrust-io/trace-spec#613 · 1 comment ·
Maintainers usually reply within 1 day
All issues in agentrust-io/trace-spec
Similar issues
-
[Bug]: AdaLAM's draw_first_k_couples repeats couples already drawn instead of the next ones (8 of the default 128 RANSAC hypotheses)Possibly taken @1sakshm claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
TheAlgorithms/Python#15656 ·
Maintainers usually reply within 2 days
-
external integration integration-submission
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
langchain-ai/docs#7128 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
kaifcodec/user-scanner#755 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
eclipse-score/mcp-servers#61 ·
Maintainers usually reply within 4 days