Skip to content

redaction: attachment secret check reads raw text only; some escaped, quoted and base64 shapes are shown #996

Closed

Description

@jayden1711

Found by the second review of #921 round 7. All four are measured on main and are the same at #921's head. The exact inputs are held privately (#707).

  1. The attachment secret check reads only raw text. secretKinds, which the chat attachment refusal uses, matches each pattern on the raw text. It has no glue points and no union with the redactor's shapes. So some secrets that redactString hides (a token glued after a terminal escape or a word prefix, or a credential after a newline) give no kind, and the attachment is stored without the refusal. That it can then be served raw is inferred.
  2. Escaped forms. A bearer token written with JSON-escaped slashes is only partly hidden.
  3. Other-language quoting. A password in a single-quoted dictionary literal is shown in both modes.
  4. Base64 variants of a JWT. JWTs with padding, or with standard-base64 characters, are shown.

Fix, by design:

  • secretKinds and redactString share one matcher, the same rules applied at the same glue points. The attachment check then can never find less than redaction hides.
  • Add rows for 2–4 to the redactor's shape tables.
  • A test should assert that, for every shape the redactor hides, secretKinds is non-empty.

Related: #889 and #921 (shared redactor), and #988.

Activity

  1. jayden1711 commented on Oct 21, 2026

    @jayden1711
    OwnerAuthor

    More shapes of the same class, found by #921 round 8's second review (measured on main and at #921's head; exact inputs held privately). In default mode a password in a URL is shown when the URL has an empty user part, which is the usual form for some services. Also shown on every path: a raw @ or / inside the password, a fully percent-encoded URL, and JSON-escaped slashes. Suggested direction: the default URL rule accepts an empty user, and the user-info part is read up to the last @ before the host.

  2. added a commit that references this issue on Oct 24, 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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions