fix(mcp): add trust dialog for local untrusted .mcp.json config#3183
Draft
SAAITAAMAA wants to merge 2 commits into
Draft
fix(mcp): add trust dialog for local untrusted .mcp.json config#3183SAAITAAMAA wants to merge 2 commits into
SAAITAAMAA wants to merge 2 commits into
Conversation
| let mut input = String::new(); | ||
| std::io::stdin().read_line(&mut input).unwrap(); | ||
| if input.trim().to_uppercase() != "YES" { | ||
| unsafe { std::env::set_var("FORGE_SKIP_LOCAL_MCP", "1") }; |
Contributor
There was a problem hiding this comment.
generally we avoid using unsafe rust.
| print!("Untrusted .mcp.json found in current directory. Do you trust its contents? (YES/NO): "); | ||
| std::io::stdout().flush().unwrap(); | ||
| let mut input = String::new(); | ||
| std::io::stdin().read_line(&mut input).unwrap(); |
Contributor
There was a problem hiding this comment.
we already have components that you can leverage for asking prompts.
b1c6e36 to
0e84894
Compare
This prevents autoloading of untrusted .mcp.json and mitigates the arbitrary code execution. Used pre-existing confirmation code and removed unsafe block.
0e84894 to
472bdb7
Compare
|
Action required: PR inactive for 5 days. |
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.
This prevents autoloading of untrusted .mcp.json and mitigates the arbitrary code execution.