Skip to content

Obfuscation: a bare top-level value after a complete document is kept as sent instead of obfuscated #2577

Open

Description

@webern

This was a finding from a follow-up AI-based differential audit of the reworked Saluki obfuscation PR as I introduce libdatadog in agent-data-plane. I've widened it since filing: the Agent leaks the same way after an object document, so matching the Agent isn't enough. I'd like a bare value after a complete document to always be obfuscated.

AI

A bare top-level value after a complete JSON document is copied as sent instead of obfuscated. At libdatadog rev 9b339e982 and Agent rev 17ecddf4e3e, both scanners accept concatenated documents for Elasticsearch-style bodies: on non-whitespace after a completed document they reset and scan afresh (Rust end_top; Go stateEndTop). A stray scalar in that position can be read as an object key and copied verbatim, so a string or a card-number-shaped number is sent unobfuscated.

input                      libdd-trace-obfuscation      Agent
[1,2] "secret"             ["?","?"] "secret"           ["?","?"] "?"
{"a":1} "secret"           {"a":"?"} "secret"           {"a":"?"} "secret"
{"a":1} 4111111111111111   {"a":"?"} 4111111111111111   {"a":"?"} 4111111111111111

The Agent's array-case result is a side effect of that retained closure, not a deliberate rule, and its object case leaks. Nothing legitimate depends on the copy: concatenated documents are whole objects or arrays, and those are obfuscated correctly ({"a":1} {"b":2} → {"a":"?"} {"b":"?"}).

Could a bare top-level value after a complete document always be obfuscated, with regression tests for these two cases?

  • [1,2] "secret" → ["?","?"] "?"
  • {"a":1} "secret" → {"a":"?"} "?"

This diverges from the Agent only on malformed input, and only toward obfuscating more.
AI

Saluki #2601 carries both expectations as #[ignore]d tests; we'll unskip them when this is fixed.

Activity

  1. added
    bug
    AI Generated
    on Sep 25, 2026
  2. changed the title [-]Obfuscation: a bare top-level value after an array document is kept as sent instead of obfuscated[/-] [+]Obfuscation: a bare top-level value after a complete document is kept as sent instead of obfuscated[/+] on Sep 25, 2026
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

    AI Generatedbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions