Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconIdentify exposed Modbus/TCP port 502
-
DeliveryEstablish TCP connection to server
-
ExploitSend MBAP frame with Length=255
-
InstallTrigger off-by-one past 260-byte buffer
-
C2Corrupt state buffer-index field
-
ExecuteIssue FC16 Write Multiple Registers with skewed index
-
ImpactCrash service or write unintended physical registers
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Off-by-one prevention
|
| Exploitation Conditions | The target must be running nanoMODBUS ≤ v1.23.0 compiled with the Modbus/TCP server role and reachable on TCP/502 from the attacker; no authentication, user interaction, or non-default configuration is required because Modbus/TCP has no native auth. Triggering the overflow itself requires only a single MBAP frame with Length=255 - there are no protocol prerequisites beyond completing the TCP handshake. The elevated outcomes (one-byte information disclosure and unintended-register writes via the FC16 handler) are limited to bare-metal and RTOS deployments without an MMU or MPU isolating the receive buffer from the adjacent state structure; on Linux or other memory-protected hosts the impact degrades to denial of service. Exploitation is bounded by network reachability to the Modbus/TCP service, which in compliant OT architectures is segmented from corporate and internet zones. |
| Impact | The provided CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:N, VA:H, VC:L/VI:L) accurately reflects a remote, unauthenticated, low-complexity reach with high availability impact and low confidentiality/integrity impact, consistent with the description's primary DoS outcome and conditional info-disclosure/unintended-write secondaries. The E:P (proof-of-concept) and AU:Y (automatable) supplemental metrics elevate operational risk because a single malformed MBAP frame is sufficient and scriptable. No EPSS score, KEV listing, or POC reference is included in the input, so empirical exploitation probability cannot be quantified - treat the E:P as the reporter's claim, not CISA-confirmed activity. The real-world severity is highly deployment-dependent: on Linux/MMU-backed targets the impact is DoS only, while on bare-metal/RTOS industrial endpoints the corruption can cross into safety-relevant unintended register writes, which is the scenario operators should weight most heavily. Note the provided 7.8 score appears low for an AV:N/PR:N/VA:H bug - defenders should recompute rather than rely on the supplied number. |
| Exploit ScenarioDerived | An attacker with TCP reach to a device's Modbus/TCP port 502 opens a connection and sends a single MBAP frame whose 16-bit Length field is set to 255, triggering the off-by-one write at the end of the 260-byte receive buffer and corrupting the state machine's buffer-index. On a Linux target the service crashes (DoS of the industrial endpoint); on an RTOS or bare-metal PLC, the attacker follows up with a Write Multiple Registers (FC16) request that, due to the corrupted index, lands at an unintended register address - potentially altering a setpoint or coil that controls a physical process. No public exploit identified at time of analysis, but the trigger is a one-packet primitive that is straightforward to weaponize. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jun 14, 2026
Off-by-one buffer overflow in nanoMODBUS through v1.23.0 lets remote unauthenticated attackers write one attacker-controlled byte past a 260-byte receive buffer in the Modbus/TCP server's recv_msg_header() function. The corruption of the adjacent buffer-index field can cause denial of service on all targets and, on bare-metal/RTOS deployments without memory protection, leak one byte of memory and trigger unintended writes through the Write Multiple Registers (FC16) handler. No public exploit identified at time of analysis, but the bug is trivially reachable by sending a crafted MBAP frame with Length=255.
RemediationAI
No vendor-released patch identified at time of analysis; monitor the upstream repository at https://github.com/debevv/nanoMODBUS for a release succeeding v1.23.0 and rebuild/reflash firmware once a fixed tag is published. In the interim, restrict Modbus/TCP server exposure to dedicated OT/process-control VLANs and block TCP/502 at perimeter and IT/OT boundary firewalls (Modbus has no native authentication, so network segmentation is the standard compensating control); the trade-off is that any legitimate remote engineering workstation will also lose direct reach and must be tunneled through a jump host. As a code-level workaround for integrators who cannot wait, patch recv_msg_header() locally to reject MBAP frames whose Length field exceeds the receive buffer capacity (a strict upper bound below 255 for the post-header payload) before the buffered read, which closes the off-by-one without affecting protocol conformance for valid frames. For bare-metal/RTOS targets, consider enabling MPU regions around the nanoMODBUS state structure to convert the unintended-write primitive into a fault rather than silent register corruption.
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
nanoMODBUS (cpe:2.3:a:debevv:nanomodbus) is a lightweight, embedded-oriented C implementation of the Modbus protocol commonly deployed on microcontrollers, RTOS targets, and bare-metal industrial devices acting as Modbus/TCP servers. The root cause is CWE-193 (Off-by-One Error) in recv_msg_header() at nanomodbus.c line 369, where the MBAP (Modbus Application Protocol) header's 16-bit Length field is trusted with insufficient bound enforcement: a value of 255 causes the read to extend one byte beyond the fixed 260-byte receive buffer. Because the overflowed byte lands in the immediately-adjacent buffer-index member of the nanoMODBUS state structure (an adjacency-based corruption pattern that overlaps with CWE-787 out-of-bounds write), subsequent parsing - particularly in the FC16 Write Multiple Registers path - uses an attacker-influenced index, turning a parsing bug into a logic corruption that affects register write targeting on systems without MMU/MPU isolation.
Know when Nanomodbus 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:N/PR:N/UI:N/VC:L/VI:L/VA:H/SC:N/SI:N/SA:N/E:P/AU:Y
Single crafted Modbus/TCP frame on port 502 with no auth or interaction (AV:N/AC:L/PR:N/UI:N); reliable DoS gives A:H while conditional one-byte leak and unintended writes give C:L/I:L.
Primary rating from Vendor (TuranSec).
CVSS VectorVendor: TuranSec
DescriptionCVE.org
nanoMODBUS through v1.23.0 contains an off-by-one buffer overflow in the recv_msg_header() function of the Modbus/TCP server that allows remote unauthenticated attackers to write one attacker-controlled byte past the end of the 260-byte receive buffer by sending a crafted MBAP frame whose Length field is set to 255. The overflow corrupts the adjacent buffer-index field of the nanoMODBUS state structure, resulting in denial of service through invalid memory accesses and, on bare-metal and RTOS targets without memory protection, one-byte information disclosure and writes to unintended register addresses on the Write Multiple Registers (FC16) handler path.
Executive ViewAI
nanoMODBUS versions through v1.23.0 contain a remote unauthenticated off-by-one buffer overflow in the Modbus/TCP server, enabling attackers to cause denial of service against all deployments and potentially leak memory or trigger arbitrary writes on unprotected bare-metal and RTOS systems. Organizations operating nanoMODBUS in industrial control, IoT, or operational technology environments face immediate service disruption risk and, on unprotected deployments, potential system compromise or unauthorized system state modification.
No vendor-released patch identified at time of analysis. Interim mitigations: (1) enforce network-layer access control to restrict Modbus/TCP connectivity to trusted subnets; (2) deploy intrusion detection signatures to detect and block crafted MBAP frames with oversized Length values; (3) on bare-metal and RTOS deployments without OS-level memory protection, enable hardware-based protections (MPU, watchdog timers) if available; (4) implement continuous monitoring for unexpected process restarts or system crashes; (5) establish migration timeline to switch to a hardened or patched Modbus implementation.
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.
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.
More in Nanomodbus
View allOut-of-bounds heap/stack write in nanoMODBUS through v1.23.0 lets an unauthenticated network client corrupt memory in th
Arbitrary-address memory write in the nanoMODBUS Modbus client library (through v1.23.0) allows a malicious or compromis
Memory corruption in nanoMODBUS through v1.23.0 allows a malicious or compromised Modbus server to crash or potentially
EUVD-2026-36661
GHSA-6f53-f2m4-6j2h
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB