Friday, 4 December 2026
4 agent hacks today▼ 3 vs yesterday (7)

Path traversal flaw lets KiCad MCP Pro write outside its workspace

A GitHub advisory published on 3 December 2026 says three variant export tools in version 4.20.0 accept unvalidated arguments that steer writes anywhere on disk.

By The Agentic Times ·

A key turns inside a lock's cylinder, but the guard rails fall away—the door swings open onto hallways beyond the intended room, files scattering across forbidden floors.
A key turns inside a lock's cylinder, but the guard rails fall away—the door swings open onto hallways beyond the intended room, files scattering across forbidden floors. · Illustration: The Agentic Times

A GitHub security advisory published on 3 December 2026 describes a path traversal flaw in KiCad MCP Pro, a Python package that exposes electronic design automation functions to AI agents through the Model Context Protocol. The advisory, tracked as GHSA-wfmg-598x-58c5 and CVE-2026-141546, says three variant export tools in version 4.20.0 build their output path by joining an unvalidated tool argument onto the output directory, so a write lands wherever that argument points. The setting meant to confine writes, KICAD_MCP_WORKSPACE_ROOT, does not contain it.

According to the advisory, both the variant and output_name arguments work as attack vectors. The variant argument has a suffix appended, such as _bom.csv or _gerber, while output_name has none, meaning the caller controls the entire final component of the path.

The researcher reported testing against the kicad-mcp-pro 4.20.0 wheel from PyPI on Python 3.13.18, running on Debian inside Docker, against repository commit 70ae5a77b644f039f83e82caa6d4b6b54e54c044 dated 18 November 2026. In the published proof of concept, a call to the variant BOM export tool using a relative traversal string overwrote a pre-existing file outside the workspace root, replacing its contents with exported component data. A second call using an absolute path wrote outside the root with no traversal needed. A third created a directory outside the root even though kicad-cli was not installed in the container at all.

The advisory notes that the proof of concept for the output_name cases used a stub standing in for kicad-cli, and labels that part as simulated. The researcher argues that what is under test is the path the code hands to the --output flag, which is pure Python, and that the manifest write in one case uses the package's own file-writing code rather than the stub.

The advisory contrasts this behaviour with the project's own documentation. The configuration documentation states that when KICAD_MCP_WORKSPACE_ROOT is set, project artifact reads and writes must stay under that root, and the error documentation defines an UNSAFE_PATH code for a requested path that escapes the workspace. The researcher also showed that the documented path resolver and another export tool in the same package correctly refused the same strings, raising unsafe path errors.

On exploitation, the advisory says anyone who can call these MCP tools can write and overwrite files outside the configured workspace root. It cites the attacker model from an earlier advisory for the same project, GHSA-h93v-ccrj-58fw, which includes an agent steered by prompt injection from a datasheet, a component description or a project file. The requirements listed are a single MCP tool call with chosen arguments, a schematic-capable profile and an active project. No KiCad graphical interface, no IPC connection, no second user and no authentication step are needed.

The tools are not present in the default profile. The researcher enumerated the profiles at runtime and found them in eleven others, including full, which the project's example environment file documents as a setting.

The advisory describes the issue as the same class as the earlier flaw, which was fixed in version 4.15.1, but in a module that fix did not touch. The earlier pull request changed one source file and two test files and added no shared guard, so the pattern survives in 4.20.0. The incident record lists the status as reported.

Sources

  1. github.comhttps://github.com/advisories/GHSA-wfmg-598x-58c5