Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAttacker controls or MITMs a Modbus server
-
DeliveryClient sends Read Device Identification request
-
ExploitServer replies with object_id ≥ 3
-
ExecutionOOB stack read yields wild buffer index
-
Persiststrncpy writes attacker data to wild pointer
-
ImpactMemory corruption / code execution on client
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Bounds checking, read limits
MITRE ATT&CK
1 technique across 1 tactic: Collection The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires that a nanoMODBUS client (version through 1.23.0) issue a Read Device Identification request (Modbus function code 0x2B, MEI type 0x0E) to a server the attacker controls or can impersonate/MITM, and that the malicious server return a response object with object_id >= 3 - that out-of-range object_id read directly from the wire IS the core trigger condition. No authentication or user interaction on the client is needed to process the malicious response. The principal LIMITING factor is directional: this is a client-side library flaw, so the attacker must be the (or a) Modbus SERVER the client talks to, not an arbitrary remote host - clients that poll only trusted servers on isolated networks are not exposed. A further prerequisite is that the client actually uses the device-identification feature; clients that never send FC 0x2B requests do not reach the vulnerable parser. |
| Impact | The CVSS 3.1 base score of 9.8 (AV:N/AC:L/PR:N/UI:N, C:H/I:H/A:H) reflects a network-reachable, low-complexity flaw with no authentication and full impact, and the deterministic absence of any bounds check makes the trigger highly reliable (AC:L is justified). However, these signals must be weighed against a key structural caveat: this is a CLIENT-side library flaw, so exploitation requires the victim to connect to and query a MALICIOUS or COMPROMISED Modbus server (or an on-path/MITM attacker) - the classic 'malicious server attacks its client' model - rather than an attacker directly reaching an exposed service. No EPSS score, KEV listing, POC, or SSVC decision data was provided in the input, so probabilistic exploitation likelihood cannot be quantified from available signals. Net assessment: technically severe and reliably triggerable, but real-world priority is gated by whether affected deployments talk to untrusted or internet-exposed Modbus servers; devices polling only trusted local PLCs face lower practical exposure. The CWE-125 (read) classification understates the actual write primitive - treat this as a memory-corruption/write issue when prioritizing. |
| Exploit ScenarioDerived | An attacker who controls a Modbus server endpoint - or who man-in-the-middles an unencrypted Modbus/TCP session - waits for a nanoMODBUS client to send a Read Device Identification request. The malicious server replies with an object_id >= 3, causing the client to read an out-of-bounds stack byte and derive a wild destination pointer, then strncpy() attacker-supplied bytes to that address, corrupting client memory and potentially achieving code execution or a crash on the embedded device. No public exploit was identified at time of analysis, but the deterministic, unauthenticated trigger makes weaponization straightforward for anyone able to answer the client's query. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv2 – Aug 05, 2026
Arbitrary-address memory write in the nanoMODBUS Modbus client library (through v1.23.0) allows a malicious or compromised Modbus server to corrupt the memory of any client that issues a Read Device Identification request. The flaw stems from an unchecked server-supplied object_id used as an array index, ultimately steering a strncpy() destination pointer with attacker-controlled data - a condition that typically leads to remote code execution or crash on embedded/IoT clients. There is no public exploit identified at time of analysis, and it is not listed in CISA KEV; the assigned CVSS is 9.8, though exploitation requires the victim client to communicate with an attacker-controlled server.
Earlier versions of this analysis (1)
Out-of-bounds stack read cascading into a wild-pointer write in nanoMODBUS through v1.23.0 allows a malicious Modbus server to achieve arbitrary memory writes in any application embedding this library as a client. The flaw resides in the Read Device Identification response parser: an attacker-controlled object_id byte (0-255) indexes a fixed 3-element stack array without bounds validation, producing a garbage byte that is then dereferenced as a char* destination for strncpy() with server-supplied data. No exploit code has been publicly identified and no CISA KEV listing exists, but the network-reachable vector and full C/I/A impact make this a high-priority patch target for any OT or IoT firmware embedding this library.
RemediationAI
No vendor-released patch version was identified at time of analysis - the provided references point only to the GitHub repository (https://github.com/debevv/nanoMODBUS) and the vulnerable source file, not to a tagged fixed release, so upgrade to a specific version cannot yet be cited. Monitor the upstream repository for a release later than 1.23.0 that adds a bounds check on object_id, and apply it once published. As a concrete source-level fix, validate the server-supplied object_id before use - reject or ignore any Read Device Identification object with object_id >= 3 (or >= the size of order[]) before computing order[object_id], and additionally bounds-check the resulting buf_index against the buffers[] array length; this is a low-risk change with no functional downside for compliant servers. As compensating controls until patched: restrict nanoMODBUS clients to communicate only with trusted, authenticated Modbus servers on isolated OT/ICS network segments; block or filter Modbus (TCP/502) traffic from untrusted networks and prevent internet exposure; and where feasible avoid or disable issuing Read Device Identification (FC 0x2B / MEI 0x0E) requests to unverified endpoints - the trade-off is loss of device-identification metadata for those peers.
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 is a lightweight, portable C implementation of the Modbus RTU/TCP protocol used primarily in embedded, industrial, and IoT devices acting as Modbus clients (masters). The vulnerable path is nmbs_read_device_identification_basic() / recv_read_device_identification_res() in nanomodbus.c, which parses a Modbus 'Read Device Identification' (function code 0x2B / MEI type 0x0E) response. A fixed stack array order[3] = {0,1,2} maps each returned object ID to one of three destination buffers. The server-controlled object_id byte (0-255, read straight off the wire) is used as buf_index = order[object_id] with no range validation, so any object_id >= 3 reads a garbage byte from the stack adjacent to order[]. That byte then indexes a 3-element buffers[] array of char* pointers, yielding a wild pointer that is passed as the strncpy() destination. Although CISA/NVD classify this as CWE-125 (Out-of-bounds Read), the primary security consequence is an out-of-bounds/wild-pointer WRITE (closer to CWE-787), because the leaked index drives a destination pointer for a copy of server-supplied bytes.
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
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Network-reachable via a malicious/MITM Modbus server (AV:N), deterministic no-bounds-check trigger (AC:L), no client auth or interaction (PR:N/UI:N); wild-pointer write of server-controlled data yields full C/I/A.
Primary rating from Vendor (TuranSec).
CVSS VectorVendor: TuranSec
Lifecycle Timeline
4DescriptionCVE.org
nanoMODBUS through v1.23.0 contains an out-of-bounds stack read leading to a wild-pointer write in nmbs_read_device_identification_basic() / recv_read_device_identification_res() in nanomodbus.c. A fixed 3-element stack array order[3] = {0,1,2} maps object IDs to buffer indices. The server-supplied object_id field (0-255, read directly from the wire) is used without any bounds check as buf_index = order[object_id]. When a malicious Modbus server sends a Read Device Identification response with object_id >= 3, this reads an out-of-bounds/garbage byte from the stack adjacent to order[], which is then used as an index into a 3-element buffers[] array of char* pointers. The resulting wild pointer is passed to strncpy() as the destination, causing an arbitrary-address write with server-controlled data.
Executive ViewAI
The nanoMODBUS client library (through v1.23.0) contains a critical remote code execution vulnerability (CVE-2026-71256, CVSS 9.8) triggered when clients communicate with a malicious Modbus server. Any organization deploying this library in IoT, industrial control systems, or embedded applications faces immediate risk of system compromise, data breach, or service disruption; no vendor-released patch identified at time of analysis.
Network segmentation restricting Modbus client-server communication to trusted, authenticated servers only; disable Read Device Identification requests where possible; implement inbound/outbound firewall rules with IP whitelisting; deploy network intrusion detection tuned for Modbus protocol anomalies; maintain audit logs of all Modbus transactions for incident investigation. Pending vendor patch release, these controls serve as temporary containment measures only.
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.
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
Memory corruption in nanoMODBUS through v1.23.0 allows a malicious or compromised Modbus server to crash or potentially
Off-by-one buffer overflow in nanoMODBUS through v1.23.0 lets remote unauthenticated attackers write one attacker-contro
EUVD-2026-53333
GHSA-vq4c-5vwv-g86v
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB