Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessReach printer G-code interface (serial/network/file)
-
DeliveryCraft M421 with out-of-range I/J indices
-
ExploitTrigger out-of-bounds write past z_values
-
ExecutionCorrupt adjacent firmware variables
-
ImpactDenial of service or firmware state corruption
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V2 - Validation and Business Logic Array index validation
|
| Exploitation Conditions | Exploitation requires the firmware to be built with MESH_BED_LEVELING enabled - without that compile-time option the vulnerable M421 handler is not present. The attacker must be able to deliver G-code to the printer through one of: a USB serial connection, an exposed network interface, or a crafted .gcode file the operator prints; per CVSS PR:N no authentication is required on the G-code channel and no user interaction is needed for the serial/network vectors (the malicious-file vector does require an operator to start the print). The decisive limiting factors are reachability of the G-code interface plus the non-default MESH_BED_LEVELING build, captured by AT:P (present attack requirement) in the vector; printers using other bed-leveling modes, or with no exposed serial/network/file ingestion, are not exploitable via this path. |
| Impact | Signals are largely consistent toward a real, prioritizable issue but bounded by deployment context. The vendor CVSS 4.0 vector (AV:N/AC:L/AT:P/PR:N/UI:N, VI:H/VA:H, score 8.3) reflects integrity and availability impact with no confidentiality loss and an attack requirement (AT:P) corresponding to the non-default MESH_BED_LEVELING build option. POC is publicly available and the fix is confirmed in commit 1f255d1, reported by VulnCheck. There is no EPSS score, no SSVC decision, and no KEV listing provided, so the probability of widespread automated exploitation is unquantified. The practical attack surface is narrow: most printers are reached over local USB serial, and the AV:N rating is only realistic for the subset exposed via a network interface (network-enabled boards or host gateways) or those that ingest untrusted .gcode files. Note the tension - the vector says AV:N but the most common real-world delivery is local serial or file-based, so for a typical USB-tethered hobby printer the effective vector is closer to local; verify exposure per deployment. Impact is corruption/DoS rather than confirmed remote code execution, though memory corruption on an MPU-less microcontroller could escalate to unpredictable physical machine behavior. |
| Exploit ScenarioDerived | An attacker who can reach a network-exposed Marlin printer (or who tricks an operator into printing a malicious .gcode file) sends a single 'M421 I<large> J<large> Z<value>' command with grid indices beyond GRID_MAX_POINTS_X/Y. The handler writes the 32-bit float past z_values into adjacent firmware memory, corrupting state and crashing or destabilizing the controller. Given low complexity and publicly available POC, no chaining or special tooling is required once the G-code channel is reachable. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jun 24, 2026
Out-of-bounds write in Marlin Firmware (3D printer firmware) through 2.1.2.7 lets attackers corrupt firmware memory through the M421 G-code mesh-bed-leveling handler, which fails to upper-bound the X/Y grid indices before writing a 32-bit float into the z_values array. Any actor able to feed G-code to a printer built with MESH_BED_LEVELING enabled can write an attacker-controlled value past the array, overwriting adjacent firmware state and causing denial of service or unpredictable machine behavior. Publicly available exploit code exists and the fix is committed (1f255d1), but there is no public exploit identified as actively exploited in the wild (not in CISA KEV).
RemediationAI
Upstream fix available (PR/commit); a released patched version is not independently confirmed beyond commit 1f255d1, so update to a Marlin build that includes commit 1f255d16ec2d456454fd444494cfb338d62b0fa1 (PR #28468) - i.e., rebuild and reflash from current main or any release tagged after 2.1.2.7 that contains it. If you cannot reflash immediately, the most effective compensating control is to rebuild without MESH_BED_LEVELING (switching to a different leveling mode such as bilinear/UBL) to remove the vulnerable M421 path entirely, accepting the trade-off of losing manual mesh bed leveling. For network-exposed printers, restrict access to the serial/network G-code interface to trusted hosts only and place the printer behind a host controller on an isolated VLAN, which blocks the remote AV:N path but does not stop a locally tethered operator. Finally, do not load untrusted or third-party .gcode files, since a malicious file can carry the crafted M421 command. Reference the VulnCheck advisory (https://www.vulncheck.com/advisories/marlin-firmware-out-of-bounds-write-via-m421-g-code-handler) and issue #28467.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Marlin is the dominant open-source firmware for 3D printers and other CNC/RepRap-style motion controllers, running on embedded microcontrollers (AVR/ARM) that typically lack memory protection. The flaw is a classic CWE-129 (improper validation of array index): the M421 command sets a mesh bed-leveling point via 'M421 I<x> J<y> Z<value>', and the handler only rejected negative indices (ix < 0 || iy < 0) without checking the upper bounds GRID_MAX_POINTS_X/Y. The patched code replaces this with WITHIN(ix, 0, GRID_MAX_POINTS_X - 1) and WITHIN(iy, 0, GRID_MAX_POINTS_Y - 1), enforcing both ends of the valid range. Because the write target is the fixed-size z_values mesh array, an out-of-range index lets the supplied float land in adjacent firmware variables in RAM. This code path only compiles when MESH_BED_LEVELING is enabled (distinct from the more common AUTO_BED_LEVELING_BILINEAR/UBL paths), consistent with cpe:2.3:a:marlinfirmware:marlin.
Know when Marlin gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
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
AC:H reflects the non-default MESH_BED_LEVELING build requirement; PR:N because G-code channels are typically unauthenticated; C:N as only integrity and availability are affected via memory corruption.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
DescriptionCVE.org
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.
Executive ViewAI
Marlin 3D printer firmware versions through 2.1.2.7 with mesh-bed-leveling enabled are vulnerable to memory corruption via G-code commands, risking production downtime and equipment malfunction in manufacturing and prototyping environments. Public exploit code is available but no active exploitation has been reported in CISA threat databases, providing a mitigation window before potential widespread attacks.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.
Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.
EUVD-2026-38797
GHSA-x5qg-qgv8-q7cr
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB