Skip to content

privacy: YAML and BOM-prefixed JSON/TOML keep values under credential-flagged keys #4519

Closed

Description

@ScriptedAlchemy

Observed

Found by the adversarial review of PR #4515, on both pre-#4490 master (36eedb3ee7^1) and the PR head:

  • A YAML document whose object key is flagged as a credential is not quarantined. The YAML path does not inspect keys structurally; the raw scan replaces the key with [TraceDecay redacted: high-entropy token], and the value under that key is left as is.
  • The same happens for JSON and TOML files that start with a UTF-8 BOM: they do not parse as JSON/TOML (format is None), so they fall back to the raw scan with the same result.

Why it matters

For JSON/TOML the contract is: a flagged key is redacted and every value under it is redacted (or the file is withheld). For YAML and BOM-prefixed JSON/TOML, a value under a credential-shaped key survives unless it is secret-shaped on its own, e.g. api_keys:\n <secret>: admin-user-42 keeps admin-user-42, and a low-entropy secret stored under such a key is indexed.

Expected

YAML (and BOM-prefixed JSON/TOML, after stripping the BOM for parsing) follow the same contract as JSON/TOML: redact the flagged key and every value under it, or withhold the file when that cannot be done safely.

Activity

  1. added a commit that references this issue on Oct 25, 2026
    e4be12b
  2. ScriptedAlchemy commented on Oct 30, 2026

    @ScriptedAlchemy
    OwnerAuthor

    Closing as completed after checking the merged fix and its restoration to master. #4527 implements credential-key quarantine for YAML/line-format inputs, BOM-aware JSON/TOML parsing and rewriting, and sanitizer-revision invalidation while retaining original-byte limits and receipt identity. Its changes were initially merged into the generated release branch, then restored onto master by #4587 (merge 8f961b3).

    Current master 64a04ef retains the public-sanitizer regression coverage in crates/tracedecay-privacy/src/structured_text_tests.rs. The PR records 163 privacy and 633 session tests passing after the structural-ID follow-up, with no weakened admission limits. This is a merged-code/recorded-validation reconciliation, not a claim of a fresh test run today.

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions