trust-record-verify: reject non-object inputs in parentRecordHash, verifyDelegationLink, and bundleDigest
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- javascript, python, typescript
Línea de trabajo
Read trust-record-verify/src/delegation.ts and trust-record-verify/src/revocation.ts, then compare the Python entry-point checks in src/agentrust_trace/delegation.py and src/agentrust_trace/revocation.py. Check the TypeScript tests for these functions and the revocation bundle validation order. Done means non-object inputs produce the specified errors while checkRevocationBundle still reports bundle_malformed; an open pull request already addresses this issue.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What is wrong
At main (a8e3559), @agentrust-io/trust-record-verify (trust-record-verify/src/delegation.ts and trust-record-verify/src/revocation.ts) accepts non-object inputs in parentRecordHash, verifyDelegationLink, and bundleDigest:
-
parentRecordHash(record)andverifyDelegationLink(child, parent)accept non-objectrecord/parentvalues:- In
trust-record-verify/src/delegation.ts:38-48,parentRecordHash(record, algorithm)callscanonicalize(record)without checkingisPlainObject(record). Because numbers (123), booleans (true), strings ("abc"), arrays ([1, 2]), andnullhave valid RFC 8785 forms,await parentRecordHash(123)returns"sha256:a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3"instead of rejecting withrecord_not_object. - In
verifyDelegationLink(child, parent, options)(trust-record-verify/src/delegation.ts:81-127),isPlainObject(child)is checked at line 95, butisPlainObject(parent)is never checked. Passingparent = 123(ornull,true,"str",[1, 2]) with a matchingchild.delegation.parent_record_hashresolves with aDelegationLinkfor a non-objectparent(and when the hash differs, rejects withdelegation_parent_mismatchinstead ofrecord_not_object). - By contrast, Python
agentrust_trace.delegation.parent_record_hashandverify_delegation_linkreject any non-dictrecordorparentat entry.
- In
-
bundleDigest(bundle)accepts non-objectbundlevalues:- In
trust-record-verify/src/revocation.ts:75-77,bundleDigest(bundle)callscanonicalize(bundle)without checkingisPlainObject(bundle). Passing123,null,true,"str", or[1, 2]returns asha256:...digest instead of throwingTraceVerificationError(invalid_argument), whereas Pythonagentrust_trace.revocation.bundle_digest(src/agentrust_trace/revocation.py:206-207) raisesValueError("bundle must be a JSON object...").
- In
Reproduction on a8e3559:
import { parentRecordHash, verifyDelegationLink, bundleDigest } from "./trust-record-verify/dist/index.js";
const h = await parentRecordHash(123);
// 1. Resolves instead of rejecting with record_not_object:
await verifyDelegationLink({ delegation: { parent_record_hash: h, credential_id: "c1" } }, 123);
// 2. Resolves instead of rejecting with invalid_argument:
await bundleDigest(123);
Spec section or file
trust-record-verify/src/delegation.ts(parentRecordHash,verifyDelegationLink)trust-record-verify/src/revocation.ts(bundleDigest)spec/trace-v0.2.mdsections 3.1.3 and 3.2.3
Expected behavior
parentRecordHash(record, algorithm)andverifyDelegationLink(child, parent, options)requireisPlainObject(record)andisPlainObject(parent), failing withrecord_not_object("a Trust Record is a JSON object") before computing or comparing digests.bundleDigest(bundle)requiresisPlainObject(bundle), failing withinvalid_argument("bundle must be a JSON object") on non-object inputs, whilecheckRevocationBundlecontinues to report non-object bundles asbundle_malformedat step 1 before callingbundleDigest.
Impact
verifyDelegationLink in @agentrust-io/trust-record-verify accepts non-object parent values as valid parent Trust Records when their RFC 8785 digest matches child.delegation.parent_record_hash, and parentRecordHash / bundleDigest diverge from Python agentrust_trace.
- Lenguaje dominante
- Python
- Estrellas
- 37
- Forks
- 33
- Merge medio
- 1 d 4 h
- PR fusionados (30 d)
- 111
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de agentrust-io/trace-spec
-
prototype(azure_execution_binding): bind HCLAkPub exponent e and key size, reject duplicate JSON keys, and harden _secure_boot_state and authenticode_sha256Posiblemente ocupada @drk-ram la tomó hace 1 día. Abiertoneeds-review:MEDIUM
Dificultad 4/5 3-5 días Aptitud para principiantes 20/100
agentrust-io/trace-spec#613 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
content_marking: validate record.alg against record.hash prefix, reject unknown assertion fields, and check anchor agreementPosiblemente ocupada @drk-ram la tomó hace 1 día. Abiertoneeds-review:MEDIUM
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
agentrust-io/trace-spec#614 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
adapters: validate data_class, policy/appraisal enums, and URI fields in TraceAGTAdapter and TraceSandboxAdapterPosiblemente ocupada @drk-ram la tomó hace 1 día. Abiertoneeds-review:MEDIUM
Dificultad 4/5 3-5 días Aptitud para principiantes 20/100
agentrust-io/trace-spec#615 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
intent_bridge,successor_observation: validate caller options and trusted JWKs at entry and deep-copy observation before predicatePosiblemente ocupada @drk-ram la tomó hace 1 día. Abiertoneeds-review:MEDIUM
Dificultad 4/5 1-2 días Aptitud para principiantes 35/100
agentrust-io/trace-spec#617 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
prototype(tdx_collateral,snp_collateral): fold non-UpToDate TCB statuses in _converge, reject negative/non-minimal DER integers, and harden policy inputsPosiblemente ocupada @drk-ram la tomó hace 2 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
agentrust-io/trace-spec#603 ·
Los mantenedores suelen responder en 1 día
Todos los issues de agentrust-io/trace-spec
Issues similares
-
Project submission:Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
slavakurilyak/awesome-ai-agents#845 ·
Los mantenedores suelen responder en 1 día
-
tests: pin that the atomic writers in utils/paths.py stage the temporary file in the target's directoryPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertodifficulty:2 enhancement good first issue
Dificultad 1/5 1-3 horas Aptitud para principiantes 92/100
MakazhanAlpamys/Soup#2178 ·
Los mantenedores suelen responder en 1 día
-
[BUG] dcg.waggr permutation p-values are folded twice, so near-zero scores get the smallest p-valuesAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
scverse/rapids-singlecell#854 ·
Los mantenedores suelen responder en 1 día
-
Slang input: int8_t4_packed and uint8_t4_packed are copied into CrossGLPosiblemente ocupada @ninglinLiu la tomó hoy. Abiertoarea:frontend backend:slang bug direction:input
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
random_elements(unique=True) on an OrderedDict: ZeroDivisionError once only zero weights remain, AssertionError with use_weighting=FalsePosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 13 días