Every CVESearch/Get API key

CVE-2026-141546

KiCad MCP Pro: Variant export tools write outside KICAD_MCP_WORKSPACE_ROOT via unvalidated variant and output_name arguments

Explain with AI
ChatGPTClaudeGoogle AI
Severity
5.0Medium
Local attack, low privileges, needs user interactionCVSS 3.1, CVE List
Exploitation
Proof of concept
CISA reports one, no source links it
Exploit chance
0.40% in 30 days
Percentile36th
EPSS, scored
Listed fix
4.20.1 for 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:N

Exploit chance over time

Unchanged since Dec 3, 2026
EPSS score 0.40% every day from Dec 3, 2026 to Dec 4, 2026.

Discussion

14 days ago: 0 people13 days ago: 0 people12 days ago: 0 people11 days ago: 0 people10 days ago: 0 people9 days ago: 0 people8 days ago: 0 people7 days ago: 0 people6 days ago: 0 people5 days ago: 0 people4 days ago: 0 people3 days ago: 0 people2 days ago: 0 people1 day ago: 0 peopleLast 24 hours: 1 person

Affected

Packages 1

Affected packages
PackageAffectedFixed
kicad-mcp-pro
PyPI
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 less
3.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 MediumCVSS: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 MediumCVSS: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-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, 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 default profile. I enumerated tools_for_profile at runtime: they appear in agent_full, builder, critic, expert, full, high_speed, power, schematic, schematic_authoring, schematic_only and simulation. Your .env.example:48 documents KICAD_MCP_PROFILE=full, and server.py:2388-2399 materialises the full catalog 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_ROOT is 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 MediumCVSS: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 MediumCVSS: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 MediumCVSS: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-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, 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 default profile. I enumerated tools_for_profile at runtime: they appear in agent_full, builder, critic, expert, full, high_speed, power, schematic, schematic_authoring, schematic_only and simulation. Your .env.example:48 documents KICAD_MCP_PROFILE=full, and server.py:2388-2399 materialises the full catalog 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_ROOT is 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 MediumCVSS: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

Changes recorded by Every CVE
DayChangedSources
Published dateEUVD
Affected packages, referencesOSV
Affected packages, key facts, referencesGitHub Advisories, NVD
Other IDs, referencesOSV
Other IDs, published dateEUVD
Key facts, referencesCVE List, NVD
First indexedCVE List

Upstream dates may differ.

References

MoveEnter Open