Executive brief
DesktopCommanderMCP, a tool used to provide AI assistants with file system and terminal access, is vulnerable to a denial-of-service attack. By providing a specially crafted search pattern, an attacker can cause the application to consume 100% of the CPU, making the AI assistant unresponsive. This can be triggered remotely through prompt injection or by manipulating the search parameters used by the AI agent.
Technical details
A Regular Expression Denial of Service (ReDoS) vulnerability exists in the `start_search` tool of DesktopCommanderMCP within `src/search-manager.ts`. The application uses the native JavaScript `RegExp` engine to process user-supplied search patterns when scanning Excel (.xlsx) and DOCX (.docx) files. Because these patterns are compiled and executed without complexity limits or timeouts, an attacker can provide a pattern designed to trigger catastrophic backtracking (e.g., `(a+)+
Affected products
- wonderwhy-er DesktopCommanderMCP < 0.2.39
Timeline
- 2026-06-03: disclosed
- 2026-06-03: advisory
- 2026-07-10: patched: GitHub advisory updated with patch details
References
- https://github.com/wonderwhy-er/DesktopCommanderMCP/issues/375
- https://github.com/wonderwhy-er/DesktopCommanderMCP/pull/400
- https://github.com/wonderwhy-er/DesktopCommanderMCP/commit/4ce845f8749b6a159b57b38dcc3357f7222a8078
- https://github.com/wonderwhy-er/DesktopCommanderMCP
- https://github.com/wonderwhy-er/DesktopCommanderMCP/releases/tag/v0.2.39