Require confirm before reading credential files via MCP - #220
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ssh_command's read-only allowlist (cat,grep,head,tail, ...) let a credential-bearing file (wp-config.php, an SSH private key,.env) be read with noconfirm: truestep, since the command is harmless in general even when the argument isn't.wp_cli's read-only check treatedwp config get DB_PASSWORDas safe too, for the same reason —getis a safe verb in general, butwp configis WP-CLI's direct interface onto wp-config.php's constants.confirm: true(the same human-approval flow every other sensitive MCP op already uses) when a credential-shaped path or theconfigcommand is involved. Nothing is blocked — legitimate reads/edits still go through, they just need the same explicit approval step as a write.Why
Prompted by a LinkedIn discussion (Remkus de Vries' post and a comment on it) about MCP connections carrying broad, undifferentiated permissions to a WordPress site. Checked our own
ssh_command/wp_clitools against that exact scenario and found this gap.Testing
npx tsc --noEmitinmcp-server/— clean, no type errors.mcp-server/to extend (no test script/files present).CHANGELOG bumped to 5.20.1 under
### Security.