Skip to content

fix: treat only entries of root-level maps as identifier names - #11

Merged
Fafoooo merged 1 commit into
mainfrom
fix/sanitizer-entry-names
Oct 10, 2026
Merged

Fafoooo merged 1 commit into
mainfrom
fix/sanitizer-entry-names

Conversation

@Fafoooo

@Fafoooo Fafoooo commented Oct 10, 2026

Copy link
Copy Markdown
Owner

What

This is a follow-up to #10. The automated security review of #10's last commit (which added the entry-map exemption) raised a fail-open:

  • Every key under a map named mcpServers, servers, mcp, plugins, projects or profiles counted as an identifier.
  • That applied at any depth and for any value.
  • So a credential like "mcp": { "apiKey": "…" } was no longer redacted by name.

How

  • Entry maps are matched by their path from the document root: mcpServers, mcp.servers, enabledPlugins, extraKnownMarketplaces, …
  • Only an entry is named by an identifier. An entry is an object, or a plugin's on/off switch (true/false).
  • Strings beside the entries keep the usual rules, and so do maps of the same name nested elsewhere.
  • Codex TOML already scopes its named-entry maps by root path, and still applies isSecretKey to leaves, so it needs no change.

Regression test: "treats only entries (objects, plugin switches) of root-level entry maps as names".

Checklist

  • npm run typecheck passes
  • npm run test passes (672 tests)
  • npm run build succeeds
  • New behavior has tests
  • Cross-platform: no path handling changed
  • No secret can reach the repo: this restores name-based redaction for strings under entry maps
  • Docs: code comments updated

Security impact

This tightens redaction back to main's level for strings under generic map names, while MCP server names and plugin ids stay identifiers. On the maintainer's real config files nothing changes compared with #10; across all 2635 backed-up text files, no line changes that main left alone.

Release

This is a fix: commit, so it ships as 1.0.2 after merge.

An automated security review of the last commit of PR #10 found that
every key under a map named mcpServers, servers, mcp, plugins, projects
or profiles counted as an identifier, at any depth and for any value. A
string under a secret name inside such a map, `"mcp": { "apiKey": "…" }`,
was therefore no longer redacted by name.

Entry maps are now matched by their path from the document root
(mcpServers, mcp.servers, enabledPlugins, ...), and only an entry — an
object, or a plugin's on/off switch — is named by an identifier. Strings
beside the entries, and maps of the same name nested elsewhere, keep the
usual rules.
@coderabbitai

coderabbitai Bot commented Oct 10, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 48 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6a4fd5aa-9317-4bfd-81e9-a0af45dcca6d

📥 Commits

Reviewing files that changed from the base of the PR and between 63902a7 and 5f47fcb.


📒 Files selected for processing (2)
  • src/core/sanitizer/index.ts
  • test/unit/sanitizer.test.ts

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Fafoooo

Fafoooo commented Oct 10, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@Fafoooo
Fafoooo merged commit 93e1c62 into main Oct 10, 2026
8 checks passed
@Fafoooo
Fafoooo deleted the fix/sanitizer-entry-names branch October 10, 2026 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant