CVE-2026-141546
KiCad MCP Pro: Variant export tools write outside KICAD_ MCP_ WORKSPACE_ ROOT via unvalidated variant and output_ name arguments
- Severity
- 5.0MediumLocal attack, low privileges, needs user interactionCVSS 3.1, CVE List
- Exploitation
- Proof of conceptCISA reports one, no source links it
- Exploit chance
- 0.40% in 30 daysPercentile36thEPSS, scored
- Listed fix
4.20.1for kicad-mcp- pro From GitHub Advisories and OSV
Overview
KiCad MCP Pro is an MCP server connecting AI agents to KiCad schematic and PCB workflows. Prior to 4.20.1, variant_export_bom, variant_export_schematic, and variant_export_manufacturing_package in src/kicad_mcp/tools/variants.py join unvalidated variant or output_name values to the output directory after the workspace check. A caller able to invoke these tools can use traversal or an absolute path to create directories or write and overwrite files outside KICAD_MCP_WORKSPACE_ROOT. Exploitation requires an active project and a schematic-capable profile; the tools are not in the default profile. No confidentiality impact is claimed. This issue is fixed in version 4.20.1.
CVSS 3.1 vector
Exploitability
- Attack vector
- Local
- Complexity
- Low
- Privileges needed
- Low
- User interaction
- Required
Impact
- Scope
- Unchanged
- Confidentiality
- None
- Integrity
- High
- Availability
- None
CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:N/I:H/A:NExploit chance over time
Discussion
Affected
Packages 1
| Package | Affected | Fixed |
|---|---|---|
kicad-mcp-proPyPI | through 4.20.0 | 4.20.1 |
| before 4.20.1, plus listed versions 3.13.03.14.03.14.13.15.03.15.1 Show 45 more versionsShow less3.16.03.17.03.17.13.18.03.19.03.19.13.20.03.21.03.22.03.22.13.22.23.24.03.24.13.25.03.26.03.27.03.28.03.29.03.29.13.29.23.30.03.30.13.31.03.32.03.33.03.33.13.33.23.33.33.34.03.34.13.34.23.34.33.34.43.34.53.34.63.34.73.34.83.35.03.35.13.35.23.36.03.37.04.0.04.0.14.0.2 | 4.20.1 |
The JSON record also has 23 more versions.
Products 1
Sources
CVE List Score usedCVSS 3.15.0
KiCad MCP Pro: Variant export tools write outside KICAD_MCP_WORKSPACE_ROOT via unvalidated variant and output_name arguments
KiCad MCP Pro is an MCP server connecting AI agents to KiCad schematic and PCB workflows. Prior to 4.20.1, variant_export_bom, variant_export_schematic, and variant_export_manufacturing_package in src/kicad_mcp/tools/variants.py join unvalidated variant or output_name values to the output directory after the workspace check. A caller able to invoke these tools can use traversal or an absolute path to create directories or write and overwrite files outside KICAD_MCP_WORKSPACE_ROOT. Exploitation requires an active project and a schematic-capable profile; the tools are not in the default profile. No confidentiality impact is claimed. This issue is fixed in version 4.20.1.
- Record
CVE-2026-141546- CVSS 3.1
- 5.0 Medium
CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:N/I:H/A:N - Weakness
- CWE-22
- Updated
- 2026-12-02
EUVDEUVD-2026-141812CVSS 3.15.0
KiCad MCP Pro: Variant export tools write outside KICAD_MCP_WORKSPACE_ROOT via unvalidated variant and output_name arguments
- Record
EUVD-2026-141812- CVSS 3.1
- 5.0 Medium
CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:N/I:H/A:N - Updated
- 2026-12-03
GitHub AdvisoriesGHSA-wfmg-598x-58c5CVSS 3.15.0
KiCad MCP Pro: Variant export tools write outside KICAD_MCP_WORKSPACE_ROOT via unvalidated variant and output_name arguments
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-pro4.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, a component description or a project file.
Attacker requirements:
- One MCP tool call with chosen arguments.
- A schematic-capable profile. The tools are not in the
defaultprofile. I enumeratedtools_for_profileat runtime: they appear inagent_full,builder,critic,expert,full,high_speed,power,schematic,schematic_authoring,schematic_onlyandsimulation. Your.env.example:48documentsKICAD_MCP_PROFILE=full, andserver.py:2388-2399materialises thefullcatalog for programmatic hosts. - An active project. No KiCad GUI, no IPC connection, no second user, and no authentication step.
What the documentation promises
docs/configuration.md:221-226, "Workspace Safety":
When
KICAD_MCP_WORKSPACE_ROOTis set, project artifact reads and writes must stay under that root.
Also docs/errors.md:34 describes UNSAFE_PATH as "A requested path escapes the workspace", docs/integration/kicad-studio.md:95 says the variable "constrains project artifact reads and writes", and the tool's own docstring at tools/variants.py:343 says the BOM goes "into the project output directory".
Reproduction
The PoC is local and non-destructive: everything is written inside a container, and /work/outside stands in for a location outside the configured root.
python -m venv .venv && .venv/bin/pip install kicad-mcp-pro==4.20.0
# /work/ws is KICAD_MCP_WORKSPACE_ROOT, /work/ws/proj is the active project
# (a copy of tests/fixtures/benchmark_projects/pass_minimal_mcu_board),
# /work/outside is outside the root
.venv/bin/python -I poc_variants.py
First, the controls. The documented resolver and your own pcb_export_stats both refuse the same strings:
resolve_within_project('../../../outside/control.csv') REFUSED: UnsafePathError: The requested path '/outside/control.csv' escapes workspace root '/work/ws/proj'.
resolve_within_project('/work/outside/control.csv') REFUSED: UnsafePathError: The requested path '/work/outside/control.csv' escapes workspace root '/work/ws/proj'.
ensure_output_dir('../../outside') REFUSED: UnsafePathError: Output subdirectories cannot contain parent traversal.
export_board_stats('../../../outside/stats.json') REFUSED: ValueError: Output name must be a single file name, not a path.
variant_export_bom('prod') -> /work/ws/proj/output/variants/prod_bom.csv
Overwriting a file outside the root. /work/outside/victim_bom.csv…
- Record
GHSA-wfmg-598x-58c5- CVSS 3.1
- 5.0 Medium
CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:N/I:H/A:N - Weakness
- CWE-22
- Updated
- 2026-12-03
NVDCVSS 3.15.0
KiCad MCP Pro is an MCP server connecting AI agents to KiCad schematic and PCB workflows. Prior to 4.20.1, variant_export_bom, variant_export_schematic, and variant_export_manufacturing_package in src/kicad_mcp/tools/variants.py join unvalidated variant or output_name values to the output directory after the workspace check. A caller able to invoke these tools can use traversal or an absolute path to create directories or write and overwrite files outside KICAD_MCP_WORKSPACE_ROOT. Exploitation requires an active project and a schematic-capable profile; the tools are not in the default profile. No confidentiality impact is claimed. This issue is fixed in version 4.20.1.
- Record
CVE-2026-141546- CVSS 3.1
- 5.0 Medium
CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:N/I:H/A:N - Weakness
- CWE-22
- Updated
- 2026-12-02
OSVCVSS 3.15.0
KiCad MCP Pro: Variant export tools write outside KICAD_MCP_WORKSPACE_ROOT via unvalidated variant and output_name arguments
KiCad MCP Pro is an MCP server connecting AI agents to KiCad schematic and PCB workflows. Prior to 4.20.1, variant_export_bom, variant_export_schematic, and variant_export_manufacturing_package in src/kicad_mcp/tools/variants.py join unvalidated variant or output_name values to the output directory after the workspace check. A caller able to invoke these tools can use traversal or an absolute path to create directories or write and overwrite files outside KICAD_MCP_WORKSPACE_ROOT. Exploitation requires an active project and a schematic-capable profile; the tools are not in the default profile. No confidentiality impact is claimed. This issue is fixed in version 4.20.1.
- Record
CVE-2026-141546- CVSS 3.1
- 5.0 Medium
CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:N/I:H/A:N - Weakness
- CWE-22
- Updated
- 2026-12-03
OSVGHSA-wfmg-598x-58c5CVSS 3.15.0
KiCad MCP Pro: Variant export tools write outside KICAD_MCP_WORKSPACE_ROOT via unvalidated variant and output_name arguments
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-pro4.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, a component description or a project file.
Attacker requirements:
- One MCP tool call with chosen arguments.
- A schematic-capable profile. The tools are not in the
defaultprofile. I enumeratedtools_for_profileat runtime: they appear inagent_full,builder,critic,expert,full,high_speed,power,schematic,schematic_authoring,schematic_onlyandsimulation. Your.env.example:48documentsKICAD_MCP_PROFILE=full, andserver.py:2388-2399materialises thefullcatalog for programmatic hosts. - An active project. No KiCad GUI, no IPC connection, no second user, and no authentication step.
What the documentation promises
docs/configuration.md:221-226, "Workspace Safety":
When
KICAD_MCP_WORKSPACE_ROOTis set, project artifact reads and writes must stay under that root.
Also docs/errors.md:34 describes UNSAFE_PATH as "A requested path escapes the workspace", docs/integration/kicad-studio.md:95 says the variable "constrains project artifact reads and writes", and the tool's own docstring at tools/variants.py:343 says the BOM goes "into the project output directory".
Reproduction
The PoC is local and non-destructive: everything is written inside a container, and /work/outside stands in for a location outside the configured root.
python -m venv .venv && .venv/bin/pip install kicad-mcp-pro==4.20.0
# /work/ws is KICAD_MCP_WORKSPACE_ROOT, /work/ws/proj is the active project
# (a copy of tests/fixtures/benchmark_projects/pass_minimal_mcu_board),
# /work/outside is outside the root
.venv/bin/python -I poc_variants.py
First, the controls. The documented resolver and your own pcb_export_stats both refuse the same strings:
resolve_within_project('../../../outside/control.csv') REFUSED: UnsafePathError: The requested path '/outside/control.csv' escapes workspace root '/work/ws/proj'.
resolve_within_project('/work/outside/control.csv') REFUSED: UnsafePathError: The requested path '/work/outside/control.csv' escapes workspace root '/work/ws/proj'.
ensure_output_dir('../../outside') REFUSED: UnsafePathError: Output subdirectories cannot contain parent traversal.
export_board_stats('../../../outside/stats.json') REFUSED: ValueError: Output name must be a single file name, not a path.
variant_export_bom('prod') -> /work/ws/proj/output/variants/prod_bom.csv
Overwriting a file outside the root. /work/outside/victim_bom.csv…
- Record
GHSA-wfmg-598x-58c5- CVSS 3.1
- 5.0 Medium
CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:N/I:H/A:N - Weakness
- CWE-22
- Updated
- 2026-12-03
The JSON record also has the rest of 2 source descriptions.
History
Recorded by Every CVE
| Day | Changed | Sources |
|---|---|---|
| Published date | EUVD | |
| Affected packages, references | OSV | |
| Affected packages, key facts, references | GitHub Advisories, NVD | |
| Other IDs, references | OSV | |
| Other IDs, published date | EUVD | |
| Key facts, references | CVE List, NVD | |
| First indexed | CVE List |
Upstream dates may differ.
References
github.com/oaslananka/kicad-mcp-pro/security/advisories/GHSA-wfmg-598x-58c5
github.com/oaslananka/kicad-mcp-pro/pull/1806
github.com/oaslananka/kicad-mcp-pro/commit/1ddb8ce1d3a8a67d4670f947a582d07c9ba29130
github.com/oaslananka/kicad-mcp-pro/releases/tag/mcp-server-v4.20.1
nvd.nist.gov/vuln/detail/CVE-2026-141546
github.com/advisories/GHSA-wfmg-598x-58c5
github.com/CVEProject/cvelistV5/tree/main/cves/2026/141xxx/CVE-2026-141546.json
github.com/oaslananka/kicad-mcp-pro