Executive brief
A security vulnerability exists in code-screenshot-mcp, a tool used to generate screenshots of code via the Model Context Protocol (MCP). An attacker can exploit this flaw to execute unauthorized commands on the underlying server. This could lead to a complete takeover of the system, theft of sensitive data, or disruption of services.
Technical details
An OS command injection vulnerability (CWE-78) exists in the generator.ts component of MoussaabBadla code-screenshot-mcp version 0.1.0. The vulnerability stems from the improper neutralization of user-supplied input in the HTTP/MCP request handling logic, specifically where input from src/index.ts flows into an execAsync call in src/generator.ts. A remote attacker can trigger this by sending a maliciously crafted JSON-RPC request (e.g., to the screenshot_git_diff tool) containing shell metacharacters. This allows for arbitrary command execution with the privileges of the server process. As of the advisory date, the vendor has not responded to disclosure attempts and no patch is available.
Affected products
- MoussaabBadla code-screenshot-mcp 0.1.0
Timeline
- 2026-03-18: disclosed: Vulnerability reported by independent researcher BruceJin via GitHub issue.
- 2026-04-05: advisory: Initial disclosure via VulDB and NVD.