Repository navigation
Conversation
…ecret scan The scan runs \b patterns on raw file text. In a JSON string, \n, \t, \r and \uXXXX end in a word character, so no boundary precedes a token after them.
The publish-time secret scan matched the \b patterns against raw text only. In a JSON or JSONC string, \n, \t, \r and \uXXXX end in a word character, so a token written after one had no boundary before it and a push published it. Also check every string token of a .json or .jsonc file, keys included, decoded.
Trivia tokens are not string literals, so the check reads the same tokens either way.
# Conflicts: # src/node/services/backup/payload.ts
…decodes JSON strings The scan's raw-text check still passes a token behind a JSON or percent escape, but the scan now also reads each decoded string of a .json file, so a JSON escape no longer slips past the scan as a whole. The row check keeps leaving such a plugin out of the list (a push does not stop over a name the installer took), and the percent escape stays the one the scan cannot see. Reword the two comments, and let the tests assert the scan holds the file too.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
🟢 e2e stories (Haiku): 14 passed22 agent steps · 7 replayed from cache · 15 model calls · 47.1k tokens (23% cached) All 14 tests in 9 files
e2e 0.20.0 · 1m 14s · web · run artifacts 🟢 e2e Electron stories (Haiku): 3 passed3 agent steps · 3 model calls · 7.9k tokens (22% cached) All 3 tests in 3 files
e2e 0.20.0 · 20.5s · electron · run artifacts 🟢 e2e agent repros (Haiku): no tests selectedSpend: $0.00 of the $1.00 cap (proxy ledger) e2e 0.20.0 · 5.8s · 2 targets (web, phone) · run artifacts |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
…aches a push unreviewed A .md or .txt file in a skill is published without review, and the decoded-string scan ran only for .json and .jsonc paths. Also pin that a JSONC comment is still read by the raw check.
…d .jsonc A skill's .md or .txt file is published without review and can hold JSON text, so the file name does not say how a reader reads it. Text that is not JSON reads as it is, and only a quoted string can match, so this only adds matches.
Without a backslash each decoded string is the raw text between two quotes, and the raw check has already seen it with the same word boundaries, so the skip changes no result. The scan is synchronous, and a file with no backslash needs none of it.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c8c57e3d8d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const scanner = jsonc.createScanner(text); | ||
| for (let token = scanner.scan(); token !== jsonc.SyntaxKind.EOF; token = scanner.scan()) { | ||
| if (token === jsonc.SyntaxKind.StringLiteral && matchesSecretPattern(scanner.getTokenValue())) { |
There was a problem hiding this comment.
Scan strings hidden after comment-like text
When a non-JSON backup file contains an unquoted URL before embedded JSON on the same line—for example, https://host {"response":"x\\nghp_..."}—jsonc-parser treats the // and everything following it as line-comment trivia, so this scanner never emits the embedded StringLiteral; the raw regex also misses the token because the raw escape ends in the word character n. Since this function now scans auto-published Markdown/text files, a skill or API log with this common layout can still push a credential without SECRET_DETECTED; scan quoted strings without allowing unrelated JSONC comment syntax to mask the remainder of arbitrary files.
Useful? React with 👍 / 👎.
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
Summary
The settings-backup secret scan now reads the decoded strings of every file it publishes, as well as the raw text. Before this change, a token that follows a JSON escape (
"line one\nghp_…") passed the scan, and a push published it. That included a skill's.mdor.txtfile that holds JSON text: Xum publishes those without review.Background
scanBackupFilesForSecretsmatched each secret pattern against a file's text as written. In a JSON string, the escapes\n,\t,\rand\uXXXXend in a word character. The\bthat starts each pattern then finds no boundary before a token that follows one. Main had this gap for every JSON file in a backup (preferences.json, manifests, shelf metadata). I found it while triaging a verifier finding on #8036, which closed the same gap for plugin rows only.The first version of this PR decoded only
.jsonand.jsoncpaths. A verifier showed that this left a hole: a skill's.mdor.txtfile with JSON text and an escaped token still reached the remote with no approval. The file name does not say how a reader reads the text, so this version has no extension filter.Implementation
jsonc.createScanner. Text that is not JSON reads as it is, and only a double-quoted string can match. The change can only add matches.jsonc.parse.parsekeeps only the last of a duplicate key and drops__proto__, so a token in an earlier duplicate's value would escape. A scanner also reads a file that does not parse.jsonValueHidesSecret) keeps its behavior: a row that hides a token behind an escape is still left out of the plugin list. Its comments now say that the file scan also finds a JSON-escaped token, so the row check is a second layer. A percent escape stays the one case that only the row check covers, and a test pins that. I did not narrow the row check to percent escapes. That would change "left out" into "the push waits for review", which is a product change for 🤖 fix: check backed-up plugin rows with the installer's own rules #8036.Validation
\n,\t,\r,\u0020and\u000a,\b-anchored pattern,.jsoncfile with comments and a trailing comma,preferences.jsonthat holds an escaped token,skills/…/*.md,skills/…/*.txt,memory/global/*.txtandAGENTS.md,.mdfile with JSON text and an escaped token stops withSECRET_DETECTED, nothing reaches the remote, and the push goes through only with the exact approval digest..jsoncfile whose token sits only in a comment is still flagged, because only the raw check reads comments..jsonand.jsoncpaths again: the four non-JSON-name tests and the push test fail,mutation-equivalent. A skip that always applies, or one that applies only when a backslash is present, fails 26 of 31 tests and the push test. I checked the skip a second way, with random texts:Risks
"{\"a\":\"x\\nghp_…\"}") decodes once, so a token behind its inner escape still passes.Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high• Cost:$257.92