Description
hagent through commit 761eec6 contains an OS command injection vulnerability that allows MCP clients to execute shell commands by injecting metacharacters into the args parameter of the hagent_arduino and hagent_esp32 tools. Attackers or prompt-injected agents can supply crafted args interpolated into arduino-cli and idf.py commands run with subprocess.run(shell=True) to execute commands as the MCP server user.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| masc-ucsc | hagent | — | — |
References
- GitHub Issue #98 issue-tracking
- https://github.com/masc-ucsc/hagent product
- https://github.com/masc-ucsc/hagent/blob/761eec627a1e6fb128a2a8ce9245aa595cc2f7af/hagent/mcp/mcp_arduino.py#L776 technical-description
- https://github.com/masc-ucsc/hagent/blob/761eec627a1e6fb128a2a8ce9245aa595cc2f7af/hagent/mcp/mcp_esp32.py#L682 technical-description
- VulnCheck Advisory: hagent through commit 761eec6 OS Command Injection via Arduino and ESP32 MCP Tools third-party-advisory