Home/Research/Post

GHSA-wfmg-598x-58c5: KiCad MCP Pro: Variant export tools write outside KICAD_MCP_WORKSPACE_ROOT via unvalidated variant and output_name arguments

  • Severity: MEDIUM
  • CVE: CVE-2026-141546
  • Ecosystems: pip
  • Packages: kicad-mcp-pro

## Summary

The three variant export tools build their output path by joining an unvalidated tool argument onto the output directory, so the write lands wherever that argument points. `KICAD_MCP_WORKSPACE_ROOT` does not contain it.

Both `variant` and `output_name` work. `variant` has a suffix appended (`_bom.csv`, `_gerber`), while `output_name` has none, so with `output_name` the caller controls the entire final path component.

It overwrote a pre-existing file outside the workspace root, wrote to an absolute path outside it, and created directories outside it with no KiCad installed at all.

This is the same class as GHSA-h93v-ccrj-58fw, which was fixed in 4.15.1, in a module that fix did not touch. PR #1720 changed only `src/kicad_mcp/project/creation.py` and two test files, and added no shared guard, so the pattern survives in 4.20.0.

## Affected versions

Tested on:

– Repository: https://github.com/oaslananka/kicad-mcp-pro
– Commit: 70ae5a77b644f039f83e82caa6d4b6b54e54c044 (main, 2026-11-18)
– Package version: `kicad-mcp-pro` 4.20.0 from PyPI (latest). Everything below ran against the installed wheel; the checkout only supplied line numbers, which match.
– Python version: 3.13.18
– OS: Linux (Debian, in Docker)

## Impact

Anyone who can call these MCP tools can write and overwrite files outside the configured workspace root. That is the attacker model your own advisory for GHSA-h93v-ccrj-58fw describes, including an agent steered by prompt injection from a datasheet,…

Source: GitHub Security Advisories · 2026-12-03