Skip to content

Memory secret redaction: second-pass instabilities and a cosmetic doubled bracket #8121

Open

Description

@ThomasK33

Three known gaps in memory secret redaction (src/node/services/memorySecretRedaction.ts) on main (e2b1637). The maintainer deferred them during the memory follow-up run. A second redaction pass is meant to change nothing.

  1. Credentials in a URL are not stable across passes. https://user:Bearer SEKRIT66666666@h becomes https://user:[redacted]@h, and a second pass gives https://[redacted]@h.
  2. A Cookie header right after a redaction marker is not stable. -----BEGIN PRIVATE KEY-----x-----END PRIVATE KEY-----Cookie: becomes [redacted]Cookie: , and a second pass gives [redacted]Cookie: [redacted].
  3. Cosmetic doubled bracket. password=Bearer [redacted] becomes password=[redacted]] (stable, no secret readable).

None of these leaves a credential readable. The related leak where text continues after a marker (?sig=abc.sk-… → ?sig=[redacted]].xyz, password=[redacted]SEKRIT passing the write guard) is being fixed in a separate PR, not here.

Constraint for any fix: a change may only add redaction on top of main's output, redaction must be idempotent, and containsSecretLike/addsSecretLike must refuse at least what they refuse today.


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high

Activity

  1. self-assigned this
    on Nov 10, 2026
  2. ThomasK33 commented on Nov 10, 2026

    @ThomasK33
    MemberAuthor

    One more deferred second-pass case (found while narrowing #8120): a signed-URL signature marker followed by ] still grows on each pass as on main, e.g. [https://h/p?sig=SEKRIT] → …sig=[redacted]] → …sig=[redacted]]]. No secret is readable and the guard flags it. A candidate fix also skips the marker when closing brackets and then an ending character follow it: (?!\[redacted\](?:[\s"'\\<>&#,;)}]|\]+(?:[\s"'\\<>&#,;)}]|$)|$)) (fuzzed on 300,000 inputs with no guard verdict weaker than main except exact-marker values; not yet reviewed).


    Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high

  3. ThomasK33 commented on Nov 11, 2026

    @ThomasK33
    MemberAuthor

    Update from the memory follow-up run:

    • Item 3 (the doubled ] after a signed-URL marker, growing one ] per pass) is fixed on main by 🤖 fix: stop the signed-URL marker bracket growing on a second pass #8120: the signed-URL marker now stays [redacted] on every pass.
    • Added here as a deferred item: text that continues right after a marker stays readable in redacted text that models read (for example .xyz in ?sig=[redacted]].xyz, shown to the harvest and consolidation models), as before. Two attempts to redact it inside redactSecretLike made inputs that main redacts stably change on a second pass (URL userinfo bounds, then cookie-reader quote frames). Open PR 🤖 fix: refuse a memory write that puts text behind a [redacted] marker #8126 is narrowed to the memory-write guard: it refuses to store a value that continues with a letter or digit after a marker, and it keeps redactSecretLike output as on main.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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