Skip to content

fix(telemetry): close tuple privacy bypass, reject array headers in TS propagation, and validate digests in TRACE finalization #101

Closed

Description

@drk-ram

What is wrong

In agentrust-io/agentrust-telemetry on main, four privacy, propagation, and TRACE-finalization parity bugs exist across the Python (src/agentrust_telemetry/) and TypeScript (packages/typescript/src/) SDKs:

  1. Python privacy check _prohibited_paths ignores tuple containers:

    • In src/agentrust_telemetry/validation.py:67-76, _prohibited_paths walks dict and list values but does not walk tuple values (or reject tuple in _ensure_json_compatible), allowing prohibited keys (prompt, messages, api_key, authorization, etc.) nested inside a Python tuple to bypass the metadata-only privacy check.
  2. TypeScript extractContext accepts array-valued headers and eventFields drops empty string IDs:

    • In packages/typescript/src/propagation.ts:23-24, value() silently selects found[0] when a carrier header is an array (["attacker-run-id", "trusted-run-id"]), whereas Python extract_context (src/agentrust_telemetry/propagation.py:74-86) rejects non-string header values with PropagationError.
  3. TypeScript trace-finalizer.ts coerces non-string bundle_digest fields via String(...) and neither SDK validates digest format before signing:

    • In packages/typescript/src/trace-finalizer.ts:81-82, String(value!.algorithm) and String(value!.value) coerce non-string or undefined values into "undefined:undefined" instead of rejecting malformed bundle_digest objects, and TraceConfiguration.build_digest in both Python (src/agentrust_telemetry/trace_adapter.py) and TypeScript (trace-finalizer.ts) is only checked for truthiness rather than ^sha(256:[0-9a-f]{64}|384:[0-9a-f]{96})$.
  4. Duplicate JSON keys are accepted when loading JSON files in validation.py and conformance/runner/validate.py:

    • src/agentrust_telemetry/validation.py and conformance/runner/validate.py use plain json.loads(...) without rejecting duplicate object keys.

Expected behavior

  1. Traverse or reject tuple containers in src/agentrust_telemetry/validation.py so prohibited keys inside tuples can never bypass the metadata-only privacy check.
  2. Reject array-valued and non-string carrier headers in TypeScript extractContext (packages/typescript/src/propagation.ts) with PropagationError, matching Python extract_context.
  3. Validate build_digest and bundle_digest (algorithm and value) against canonical sha256 / sha384 lowercase hex digest syntax in both Python trace_adapter.py and TypeScript trace-finalizer.ts before signing.
  4. Reject duplicate JSON keys when parsing JSON documents in validation.py.

Activity

  1. github-actions commented on Oct 23, 2026

    @github-actions

    🟡 Contributor Check: MEDIUM

    Check Result
    Profile MEDIUM
    Credential LOW
    Overall MEDIUM

    Automated check by AgenTrust Contributor Check.

  2. added
    needs-review:MEDIUM
    on Oct 23, 2026
  3. added a commit that references this issue on Oct 29, 2026
    92ee54c
  4. added a commit that references this issue on Nov 12, 2026
    7c5e448
  5. added a commit that references this issue on Nov 19, 2026
    f66a847
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-review:MEDIUM

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions