fix(verify,runtime): reject private JWK members, non-canonical base64url, lone surrogates, duplicate JSON keys, and future revocation snapshots
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
- #268 di @drk-ram — chiusa senza merge
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- json, python
- Ambito
- backend, cryptography, security
Direzione di ricerca
Read the named entry points in src/ca2a_verify/dag.py, src/ca2a_runtime/agent_manifest.py, src/ca2a_runtime/canonical.py, src/ca2a_verify/verify.py, and src/ca2a_runtime/delegation/credential.py. Trace each boundary check and its existing tests, then add focused coverage for the listed malformed inputs and future timestamps. Done means all four cases are rejected with the specified errors; a pull request is already linked.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What is wrong
In agentrust-io/ca2a on main, four related cryptographic and JSON/JCS boundary gaps exist across src/ca2a_verify/ and src/ca2a_runtime/:
-
Private JWK parameters and non-canonical base64url keys are accepted in
ca2a_verify/dag.pyandca2a_runtime/agent_manifest.py:src/ca2a_verify/dag.py:_jwk_raw(lines 75-91) checkskty == "OKP"andcrv == "Ed25519"and decodesxviabase64.urlsafe_b64decode(value + "=" * (-len(value) % 4)).- It does not reject RFC 7517 / RFC 7518 / RFC 8037 private or symmetric key parameters (
d,p,q,dp,dq,qi,oth,k—GHSA-vc4p-h84j-7qxjclass), does not enforce canonical unpadded base64url (accepting=,+//, whitespace, and non-zero trailing bits), and does not requirelen(decoded) == 32. src/ca2a_runtime/agent_manifest.pyuses the same lenienturlsafe_b64decodehelper.
-
Lone UTF-16 surrogates in
ca2a_runtime/canonical.pyleakUnicodeEncodeError:src/ca2a_runtime/canonical.py(lines 40-52, 94) appends lone UTF-16 surrogates (\ud800..\udfff) unescaped and calls.encode("utf-8"), raising a rawUnicodeEncodeErrorinstead of a deterministicValueError(matching RFC 8785 I-JSON rules).
-
Duplicate JSON object keys are accepted in
ca2a_verify/verify.py:src/ca2a_verify/verify.py(lines 105-111, 135-141) loads chain and revocation JSON files with plainjson.loads(...)without anobject_pairs_hook, silently keeping only the last value when duplicate member names are present.
-
Future-dated
RevocationSnapshot.as_ofbypassesmax_revocation_staleness:- In
src/ca2a_runtime/delegation/credential.py:381-389, staleness is checked viaif max_staleness is not None and now - revocations.as_of > max_staleness: raise RevocationStatusUnknown(...). Whenrevocations.as_of > now(a future-dated snapshot),now - revocations.as_ofis negative and passes anymax_stalenesscheck indefinitely.
- In
Expected behavior
- Reject any JWK carrying private key parameters (
d,p,q,dp,dq,qi,oth,k) and enforce canonical unpadded 32-byte base64url inca2a_verify/dag.pyandca2a_runtime/agent_manifest.py. - Reject lone UTF-16 surrogates (
U+D800..U+DFFF) inca2a_runtime/canonical.pywith a deterministicValueError. - Reject duplicate JSON keys in
ca2a_verify/verify.py. - Reject or flag
RevocationSnapshotinstances whoseas_ofis dated in the future relative to the evaluation time (as_of > now) withRevocationStatusUnknown.
- Lingua principale
- Python
- Stelle
- 9
- Fork
- 14
- Merge medio
- 19h 54m
- PR unite (30g)
- 47
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di agentrust-io/ca2a
-
transport.a2a_adapter / a2a_sdk / hardware_acceptance: unvalidated message/metadata types, empty parent_record_hash, unsafe float-to-int coercion, and duplicate JSON keysForse già presa @drk-ram l’ha presa 2 giorni fa. Apertaneeds-review:MEDIUM
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
agentrust-io/ca2a#286 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
challenge / trace_binding: boolean ttl_seconds/now/iat bypasses, unvalidated challenge secret/expiry_str, and empty credential_id in emit_dagForse già presa @drk-ram l’ha presa 2 giorni fa. Apertaneeds-review:MEDIUM
Difficoltà 3/5 1-2 giorni Idoneità per principianti 25/100
agentrust-io/ca2a#285 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
ca2a_runtime.response: PendingResponse accepts boolean timeout, ResponseProducer.finish does not validate status/body invariants, and AuthenticatedPeerError drops error detailForse già presa @drk-ram l’ha presa 2 giorni fa. Apertaneeds-review:MEDIUM
Difficoltà 3/5 1-2 giorni Idoneità per principianti 20/100
agentrust-io/ca2a#284 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
ca2a_verify.tdx / ca2a_verify.sev_snp: verify_tdx_quote does not check quote.version == 4 and verify_tdx_quote / verify_sev_snp_report do not validate expected digest lengthsForse già presa @drk-ram l’ha presa 2 giorni fa. Apertaneeds-review:MEDIUM
Difficoltà 3/5 1-2 giorni Idoneità per principianti 25/100
agentrust-io/ca2a#283 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
tee.tpm / ca2a_verify.tpm: TpmQuote.parse ignores trailing bytes, _chain_from_leaf reads AIA URLs without a byte cap, and verify_tpm_report does not check report.platformForse già presa @drk-ram l’ha presa 2 giorni fa. Apertaneeds-review:MEDIUM
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
agentrust-io/ca2a#282 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di agentrust-io/ca2a
Issue simili
-
bug P1
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Toloka/tolokaforge#1947 ·
I maintainer di solito rispondono entro 1 giorno
-
SageMaker provider: streaming fails with NoStreamDataError on DJL Serving (LMI) endpointsForse già presa @balajiaru l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
UKGovernmentBEIS/inspect_ai#6127 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
pydot/pydot#601 · 4 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
letsencrypt/cp-cps#361 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100