---
id: CVE-2026-56111
title: Marlin Firmware 2.1.2.7 Out-of-Bounds Write via M421 G-code Handler
summary: >-
  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 o…
severity: critical
cvss: 9.1
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H'
cvssSource: cna
cwe:
  - CWE-129
vendor: MarlinFirmware
product: Marlin
affected:
  - Marlin <= 2.1.2.7
ssvc:
  exploitation: poc
  automatable: 'yes'
  technicalImpact: partial
  timestamp: '2026-06-24T15:52:16.839509Z'
exploitAvailable: true
published: '2026-06-24'
updated: '2026-11-08'
sourceUpdated: '2026-11-08T14:05:32.027Z'
source: CVEORG
sourceUrl: 'https://www.cve.org/CVERecord?id=CVE-2026-56111'
references:
  - url: 'https://github.com/MarlinFirmware/Marlin/issues/28467'
    label: Researcher Disclosure
  - url: 'https://github.com/MarlinFirmware/Marlin/pull/28468'
    label: Pull Request
  - url: >-
      https://github.com/MarlinFirmware/Marlin/commit/1f255d16ec2d456454fd444494cfb338d62b0fa1
    label: Patch Commit
  - url: >-
      https://www.vulncheck.com/advisories/marlin-firmware-out-of-bounds-write-via-m421-g-code-handler
tags:
  - cve.org
  - exploit-available
epss: 0.00647
epssPercentile: 0.51279
exploits:
  github: 1
  githubRepos:
    - 'https://github.com/Christbowel/CVE-2026-56111'
  checkedAt: '2026-11-08T14:51:57.337Z'
ingestedAt: '2026-11-08T14:51:22.369Z'
---

## Overview

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.

## Affected

- `Marlin <= 2.1.2.7`

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.
