CVE-2025-61489
Command Injection in sonirico mcp-shell v0.3.1 Allows RCE
Publication date: 2026-01-07
Last updated on: 2026-01-07
Assigner: MITRE
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| sonirico | mcp-shell | 0.3.1 |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-77 | The product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component. |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
CVE-2025-61489 is a command injection vulnerability in the shell_exec function of sonirico mcp-shell version 0.3.1. The vulnerability arises because the tool executes user-supplied commands by passing the entire command string to a bash shell, allowing attackers to exploit shell syntax features like command substitution and concatenation to bypass keyword-based validation checks. This enables attackers to execute arbitrary system commands by obfuscating malicious commands to evade the validation mechanism, which relies on insufficient keyword matching. The root cause is executing commands through a shell interpreter rather than invoking executables directly with arguments, making the validation ineffective against shell syntax obfuscation. [1, 2]
How can this vulnerability impact me? :
This vulnerability allows attackers to execute arbitrary system commands on the affected system without any privileges or user interaction. This can lead to unauthorized access, modification, or disruption of system resources. Because the mcp-shell server executes commands with full system access by default if not properly secured, exploitation can result in significant security breaches, including data compromise, system instability, or further attacks within the network. The impact is serious given the ability to bypass intended security controls and run dangerous commands. [1, 2]
How can this vulnerability be detected on my network or system? Can you suggest some commands?
Detection of this vulnerability involves monitoring for execution of suspicious or obfuscated shell commands that bypass keyword-based validation. Since the vulnerability allows attackers to use shell features like command substitution and concatenation to execute arbitrary commands, you can look for unusual command patterns such as use of `$()`, backticks, or fragmented commands reconstructed dynamically. Audit logs from mcp-shell, if enabled, should be reviewed for such patterns. There are no specific detection commands provided, but enabling and analyzing the structured audit logs generated by mcp-shell is recommended to identify suspicious command executions. [1, 2]
What immediate steps should I take to mitigate this vulnerability?
Immediate mitigation steps include disabling the use of shell-based command execution with untrusted input by avoiding passing commands through a shell interpreter. Instead, use direct executable invocation with separate arguments to prevent shell interpretation. Configure mcp-shell to enable strict allowlists for commands and blocklists for dangerous patterns via YAML security configuration files. Limit execution time, restrict working directories, run commands as unprivileged users, enable complete audit logging, and deploy mcp-shell within Docker containers or other sandboxing environments for isolation. Avoid relying on keyword-based validation as it is insufficient against shell syntax obfuscation. [1, 2]
How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:
The provided resources do not explicitly discuss the impact of CVE-2025-61489 on compliance with common standards and regulations such as GDPR or HIPAA. However, given that the vulnerability allows arbitrary command execution, it could potentially lead to unauthorized access or manipulation of sensitive data, which may result in non-compliance with data protection regulations. Proper configuration and mitigation (such as using allowlists, blocklists, user isolation, and audit logging) are critical to reduce this risk and help maintain compliance. [1, 2]