Skip to content

redact: a stray closer between a secret key and its colon keeps the value #405

Open

Description

@ElbertePlinio

A stray closer between a secret key and its colon hides the pair from both redaction paths, so the value is stored as written.

Examples, from a broken JSON line in a log artifact:

  • {"a":1 "password"]: "hunter21"} ok is stored unchanged.
  • {"api_keytoken": }"hunter2"} closes the object at }, and "hunter2"} is left as plain text that no rule matches.

The JSON rewrite only treats a token as a key when a colon follows it, and the plain-text JSON-key rule in redact_secrets needs the colon right after the key. A closer in between defeats both.

Found by the Fable council review of #352, in a differential fuzz of broken JSON (12 of 3000 generated documents had this shape). The same output comes from the revision before that review's commits, so it predates them.

Acceptance criteria:

  • A secret key followed by stray closers and then a colon has its value redacted, in log lines and in plain text.
  • Valid JSON output stays byte-identical.
  • Lines without secret keys keep their text.

Activity

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions