Skip to content

fix(secret-scrub): redact bare-KEY names in JSON object and text paths - #1471

Merged
TheGreatAxios merged 3 commits into
mainfrom
cl-10761-secret-scrub-misses-bare-key-names-in-json-objecttext-paths
Oct 17, 2026
Merged

TheGreatAxios merged 3 commits into
mainfrom
cl-10761-secret-scrub-misses-bare-key-names-in-json-objecttext-paths

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Summary

  • Both JSON secret classifiers now redact provider-prefixed KEY names such as OPENAI_KEY
  • The underscore boundary with a required prefix keeps MONKEY-style words and ordinary key fields readable

Verification

  • Scrub plus consumer suites pass (120 pass, 0 fail across 7 files)
  • oxfmt, oxlint, typecheck, and the pre-commit build pass on this branch

Fixes CL-10761

Provider-prefixed keys carry no token or secret marker, so the JSON
classifiers need their own KEY boundary; the required prefix keeps
a field named exactly key and MONKEY-style words readable.
@linear-code

linear-code Bot commented Oct 17, 2026

Copy link
Copy Markdown

CL-10761

@corbits-triage

corbits-triage Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Triage: Pass

No changes needed from you. A maintainer will review this pull request.

@TheGreatAxios TheGreatAxios left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review · Request changes

Bare *_key names are redacted in JSON and query strings. The value-class change also leaks the tail of older password, api_key, and token secrets.

Findings

  • src/plugins/tool-result-secret-scrub.ts:21 — the query value now stops at ' or ". ?password=p'LEAKTAIL&format=json keeps LEAKTAIL. The same tail survives for api_key and token. A quote inside the secret should not end the match.
  • src/plugins/tool-result-secret-scrub.ts:24 — [^"]+_key redacts partition_key, sort_key, prompt_cache_key, and cache_key, including numbers and arrays. That is wider than a credential name.

@TheGreatAxios TheGreatAxios left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review · Approve

Query secrets keep the characters after a quote. partition_key, sort_key, and cache_key stay readable. OPENAI_KEY and api_key still redact.

No findings.

@TheGreatAxios
TheGreatAxios merged commit 510d686 into main Oct 17, 2026
24 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant