Skip to content

Command Blocklist Bypass Allows Arbitrary Command Execution #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jip-0-0-0-0-0 opened this issue Mar 25, 2025 · 2 comments
Closed

Command Blocklist Bypass Allows Arbitrary Command Execution #24

jip-0-0-0-0-0 opened this issue Mar 25, 2025 · 2 comments

Comments

@jip-0-0-0-0-0
Copy link

jip-0-0-0-0-0 commented Mar 25, 2025

The current validation only checks the first token of a command, allowing an attacker to bypass restrictions by appending dangerous commands with shell separators. For example, an input like:

echo "safe"; sudo rm -rf /important/data

passes validation but then executes the forbidden sudo command. This could lead to arbitrary command execution. Consider enhancing the validation logic to inspect the entire command string or avoid using shell: true in command execution.

@wonderwhy-er
Copy link
Owner

Thanks, will be done

@wonderwhy-er
Copy link
Owner

I think we fixed that in this release
https://github.com/wonderwhy-er/DesktopCommanderMCP/releases/tag/v0.1.35

Feel free to test and if you find some gaps report them again.
Thanks for your report!

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

No branches or pull requests

2 participants