Skip to the content.

altium-designer-mcp: count fields from a library file sized allocations, and a failed allocation aborts the server

Advisory: GHSA-p2qw-h8m7-5x69 (published 2026-10-09) Package: altium-designer-mcp, affected <= 1.2.0, patched in 1.2.1 Weakness: CWE-789, CWE-400, CWE-834, CVSS 3.1 AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H (Medium, 5.5)

altium-designer-mcp is an MCP server, written in Rust, that reads and writes Altium Designer schematic (.SchLib) and footprint (.PcbLib) libraries. The crate forbids unsafe, so the issue is availability only.

Root cause

Three readers took a count from the file and used it before checking it against anything:

The project has a safety net for failing tools. The dispatcher wraps each tool call in std::panic::catch_unwind (guard_panics in src/mcp/server.rs), and the release profile keeps unwinding on purpose so that net works. An allocation failure is not a panic, though. A count above isize::MAX bytes gives a “capacity overflow” panic, which the net catches. A count below that but larger than available memory makes the allocator call handle_alloc_error, which aborts the process. Over stdio that ends the session. Over the --http transport it ends every session on the process.

Fix

Pull request #566, released as 1.2.1:

The pull request also lists the other count-driven loops in the readers and why each is already bounded by the bytes it reads. A follow-up commit documents the count bounds in the threat model.

What I took from it

Thanks to the maintainer for keeping my patch as the first commit, tightening it with a better bound, finding the related KeyCount hang, and shipping 1.2.1 with the advisory.