conformance(inclusion): enforce registry-anchor-v1 surrogate/key/cycle rules and validate leaf_index/entry fields
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start with conformance/src/trace_tests/inclusion.py, especially _outside_profile, parse_proof, and parse_entry; read the registry-anchor-v1 rules referenced in the issue and inspect their existing tests. Add or update tests for surrogate strings, dictionary keys and cycles, proof index and count bounds, and entry fields. Done means malformed inputs raise InclusionError and the conformance tests pass; an open linked pull request is already addressing this issue.
Written by the indexing model from the issue text.
Description
Summary
Three verification-boundary gaps exist in conformance/src/trace_tests/inclusion.py:
-
Unpaired UTF-16 surrogates, non-string dict keys, and circular references in
_outside_profile(conformance/src/trace_tests/inclusion.pylines 42-64):_outside_profile(value)skips all strings (if isinstance(v, bool) or v is None or isinstance(v, str): continue), never inspects dictionary keys (stack.extend(v.values())), and has no cycle detection.- As a result,
canonical_claim_bytesaccepts unpaired UTF-16 surrogates (U+D800..U+DFFF) in string values and object keys (violatingregistry-anchor-v1section 1), fails to reject non-string dictionary keys beforejson.dumps, and hangs in an infinite loop on cyclic dicts/lists.
-
Missing integer and range validation on
leaf_indexandleaf_countinparse_proof(conformance/src/trace_tests/inclusion.pylines 134-168):parse_proofcheckstype(leaf_count) is not intwhenleaf_countis present, but does not require1 <= leaf_count <= 2**53 - 1, and does not validatereceipt["leaf_index"](type(leaf_index) is not int or leaf_index < 0, orleaf_index >= leaf_countwhenleaf_countis present).- Consequently, malformed receipts carrying
leaf_index=True,leaf_index="0",leaf_index=-1, orleaf_count=0passparse_proof/parse_receiptwithout raisingInclusionError, causingTR-ANC-002to misreport a structurally malformed receipt as a Merkle root mismatch.
-
Whitespace-only / control-character strings accepted in
parse_entry(conformance/src/trace_tests/inclusion.pylines 195-230):parse_entrychecksif not isinstance(entry[key], str) or not entry[key], which accepts whitespace-only or newline/control-character strings inproducerandbatch_id, and does not boundleaf_count <= 2**53 - 1(type(leaf_count) is int).
Proposed Fix
- Update
_outside_profileinconformance/src/trace_tests/inclusion.pyto reject unpaired UTF-16 surrogates (0xD800 <= ord(ch) <= 0xDFFF) in string values and dict keys, reject non-string dict keys, and detect circular references on the active traversal path. - Validate
type(leaf_index) is int and 0 <= leaf_index <= _SAFE_INTand (when present)1 <= leaf_count <= _SAFE_INTandleaf_index < leaf_countinparse_proof. - Reject whitespace/control characters in
producerandbatch_idand enforcetype(leaf_count) is int and 1 <= leaf_count <= _SAFE_INTinparse_entry.
- Dominant language
- Python
- Stars
- 37
- Forks
- 33
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 111
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
-
prototype(verifier_token,execution_appraisal): enforce canonical 32-byte nonces, validate RelyingParty.challenge/verify_proof inputs, and reject non-finite JWT JSONPossibly taken @drk-ram claimed this 1 day ago. Openneeds-review:MEDIUM
Difficulty 4/5 3-5 days Newbie friendliness 35/100
agentrust-io/trace-spec#629 · 1 comment ·
Maintainers usually reply within 1 day
-
fix(platform_measurement): reject non-string or empty runtime.measurement across Python and TypeScriptPossibly taken @drk-ram claimed this 1 day 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 1 day 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 1 day 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
-
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 3 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
-
README.zh-CN/ja/es still hard-code 501 test counts after README.md went count-freePossibly taken @Aaqibhafeezkhan claimed this today. Openbeginner documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
BistaDinesh03/critique#164 · 1 comment ·
Maintainers usually reply within 1 day
-
bug IO
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
MrNeRF/LichtFeld-Studio#3824 ·
Maintainers usually reply within 1 day
-
bug confirmed issue
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
open-webui/open-webui#33200 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
The changelog workflow excludes otelbot but not dependabot, so every Dependabot pull request fails the changelog checkPossibly taken @ocelotl claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 82/100
open-telemetry/opentelemetry-python#5825 ·
Maintainers usually reply within 2 days