Skip to content

Mask plaintext value in codex_set MCP response when encryption is used#3

Merged
seabearDEV merged 3 commits intoclaude/verify-codexcli-readme-qVZ44from
copilot/sub-pr-2
Feb 21, 2026
Merged

Mask plaintext value in codex_set MCP response when encryption is used#3
seabearDEV merged 3 commits intoclaude/verify-codexcli-readme-qVZ44from
copilot/sub-pr-2

Conversation

Copy link
Contributor

Copilot AI commented Feb 21, 2026

When codex_set was called with encrypt: true, the success response echoed back the plaintext value, leaking it through the MCP tool response despite the stored value being encrypted.

Changes

  • src/mcp-server.ts: Replace value with [encrypted] in both codex_set response paths (with and without alias) when encrypt is truthy
// Before
return textResponse(`Set: ${resolved} = ${value}`);

// After
return textResponse(`Set: ${resolved} = ${encrypt ? '[encrypted]' : value}`);
  • src/__tests__/mcp-server.test.ts: Added two tests to verify the masking behavior:
    • Verifies [encrypted] is shown (and plaintext is absent) in the response when encrypt: true is passed without an alias
    • Verifies the same masking behavior when an alias is also provided

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: seabearDEV <40605056+seabearDEV@users.noreply.github.com>
Copilot AI changed the title [WIP] WIP Address feedback on Claude/verify codexcli readme Mask plaintext value in codex_set MCP response when encryption is used Feb 21, 2026
Copilot AI requested a review from seabearDEV February 21, 2026 20:23
@seabearDEV seabearDEV marked this pull request as ready for review February 21, 2026 20:24
Copilot AI review requested due to automatic review settings February 21, 2026 20:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses a security vulnerability where the codex_set MCP tool was leaking plaintext values in success responses when encryption was enabled. The fix ensures that encrypted values are properly masked in tool responses, preventing sensitive data exposure through the MCP interface.

Changes:

  • Modified codex_set tool response messages to display [encrypted] instead of the plaintext value when the encrypt parameter is true

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: seabearDEV <40605056+seabearDEV@users.noreply.github.com>
@seabearDEV seabearDEV merged commit f092477 into claude/verify-codexcli-readme-qVZ44 Feb 21, 2026
@seabearDEV seabearDEV deleted the copilot/sub-pr-2 branch February 21, 2026 20:31
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.

3 participants