Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessReach exposed Modbus server on TCP/502
-
DeliveryCraft FC 0x14 with 35 max-length sub-requests
-
ExploitOverflow uint8_t response_data_size accumulator
-
ExecutionUnbounded get_n()/swap_regs() writes past 260-byte buffer
-
PersistCorrupt adjacent process memory
-
ImpactCrash service or execute attacker code
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Bounds checking, write limits
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Privilege Escalation The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | The target must run nanoMODBUS (≤1.23.0) in server/slave mode with Read File Record (FC 0x14) handling reachable over the network - typically Modbus TCP on port 502 or RTU-over-TCP - and Modbus's lack of authentication means no credentials are needed. The malicious request must pass the existing checks (total request ≤245 bytes, each record_length ≤124) while packing enough sub-requests (up to 35) so the summed 2 + record_length*2 contributions overflow the uint8_t accumulator; a record_length=124 × 35 sub-request payload achieves this. Limiting factors: exploitation only affects deployments exposing the FC 0x14 handler (client-only uses are safe), reliable code execution (versus mere crash) is far more likely on embedded/bare-metal targets without an MMU or memory protections, and network segmentation or a firewall restricting TCP/502 to trusted hosts removes remote reachability. |
| Impact | All exploitability signals point the same direction: the provided CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N, base 9.8) describes remote, low-complexity, unauthenticated exploitation with High impact to confidentiality, integrity and availability, consistent with the description's memory-corruption-to-RCE narrative. No EPSS score, KEV entry, or public POC was supplied, so real-world exploitation is currently unproven - the risk is credible but not confirmed-active. The most reliable outcome is denial of service (an oversized OOB write will typically crash or hang the target); RCE is plausible but not demonstrated and is most feasible on embedded/bare-metal devices without an MMU/stack protections, where the write lands in adjacent live memory. Note a mild tension in the vector: the primitive is fundamentally an out-of-bounds write (integrity/availability), so the C:H rating leans on the RCE hypothesis rather than a direct confidentiality leak - treat the confidentiality impact as conditional on successful code execution. Because affected devices are often long-lived, unattended field equipment, patch latency is a bigger practical risk driver than exploit probability. |
| Exploit ScenarioDerived | An attacker with network reach to an exposed nanoMODBUS server (for example an unsegmented ICS device on TCP/502) sends one crafted FC 0x14 Read File Record message containing 35 sub-requests each with record_length=124, staying under the 245-byte total-request limit but overflowing the uint8_t cumulative-size accumulator. The server processes each sub-request and writes thousands of bytes past its 260-byte buffer, crashing the process (DoS) or, on an unprotected embedded target, corrupting adjacent memory toward code execution. No authentication, user interaction, or prior access is required, and no public exploit is known to exist yet. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv2 – Aug 05, 2026
Out-of-bounds heap/stack write in nanoMODBUS through v1.23.0 lets an unauthenticated network client corrupt memory in the Modbus server via a single crafted Read File Record (FC 0x14) request. The server-side handle_read_file_record() function validates per-request and per-sub-request sizes but never checks the cumulative response size, and a uint8_t accumulator (response_data_size) silently overflows, allowing swap_regs() to write up to ~8490 bytes past the 260-byte receive buffer. There is no public exploit identified at time of analysis, but the flaw yields reliable denial of service and, on embedded/bare-metal targets lacking memory protection, potential remote code execution.
Earlier versions of this analysis (1)
Out-of-bounds write in nanoMODBUS (through v1.23.0), a lightweight embedded Modbus C library, lets an unauthenticated network client corrupt server memory with a single crafted Read File Record (FC 0x14) request. The server validates per-request and per-sub-request sizes but never checks the cumulative response size, overflowing a uint8_t accumulator (CWE-787) so up to ~8490 bytes are written past the 260-byte receive buffer, causing denial of service or potential remote code execution on no-MMU embedded targets. No public exploit identified at time of analysis, though the vulnerability is trivially reachable and carries a CVSS 9.1.
RemediationAI
No vendor-released patch version was identified at time of analysis - the only references are the upstream repository root and nanomodbus.c on master, with no tagged fixed release or fix commit/PR provided, so monitor https://github.com/debevv/nanoMODBUS for a release that adds a cumulative-response-size check and widens the response_data_size accumulator beyond uint8_t. Until a fixed version is confirmed, restrict network reachability of the Modbus endpoint: place the device behind a firewall or ACL that permits TCP/502 (or the RTU-over-TCP port in use) only from known-trusted engineering hosts, and segment OT/ICS networks so untrusted clients cannot reach the server - the trade-off is that legitimate remote polling stations must be explicitly whitelisted. If Read File Record (FC 0x14) is not needed operationally, disable or reject that function code at the application layer or via a Modbus-aware firewall/DPI proxy, which blocks this attack path at the cost of losing file-record functionality. As a stopgap for maintainers building from source, patching handle_read_file_record() to sum the sub-request response sizes in a wider integer and reject requests exceeding the 260-byte buffer before calling get_n() removes the primitive.
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 small, dependency-light C implementation of the Modbus protocol (RTU and TCP) intended for embedded and bare-metal devices (CPE cpe:2.3:a:debevv:nanomodbus). The bug is a classic CWE-787 out-of-bounds write rooted in an integer-truncation/accumulator design error: the running total of response bytes is stored in a uint8_t (max 255), yet up to 35 sub-requests each contributing 2 + record_length*2 bytes (record_length up to 124) can demand 8750 bytes. Because the overflow wraps the accumulator instead of triggering a size rejection, the subsequent processing loop repeatedly calls the internal get_n() helper - which performs no bounds checking - advancing buf_idx by as much as 248 bytes per sub-request into the fixed 260-byte msg.buf, and swap_regs() then writes through that unchecked pointer. Modbus itself carries no authentication or transport encryption, so any client that can reach the server's TCP port (typically 502) can submit the malicious function code.
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
Unauthenticated single-packet network trigger against a default server handler gives AV:N/AC:L/PR:N/UI:N; OOB write reliably yields A:H and, via potential RCE on unprotected targets, C:H/I:H.
Primary rating from Vendor (TuranSec).
CVSS VectorVendor: TuranSec
Lifecycle Timeline
3DescriptionCVE.org
nanoMODBUS through v1.23.0 contains an out-of-bounds write in the Modbus server-side handle_read_file_record() function (FC 0x14, Read File Record) in nanomodbus.c. The function validates that the total request size does not exceed 245 bytes and that each sub-request's record_length is at most 124, but it never validates the CUMULATIVE response size across all sub-requests before processing them. The accumulator response_data_size is declared as uint8_t and is incremented by 2 + record_length*2 for each of up to 35 sub-requests; with 35 sub-requests of record_length=124, the cumulative demand is 8750 bytes, which overflows the uint8_t accumulator. A subsequent loop then calls get_n(), an internal function with no bounds checking, once per sub-request to obtain a pointer into the 260-byte msg.buf receive buffer and advances the internal buf_idx by up to 248 bytes per call; swap_regs() then writes to that pointer unconditionally. A single crafted FC 0x14 request from an unauthenticated network client can cause up to ~8490 bytes to be written out of bounds past the 260-byte buffer, corrupting adjacent memory in the server process and leading to denial of service or potential remote code execution, particularly on embedded/bare-metal targets without memory protection.
Executive ViewAI
nanoMODBUS versions through 1.23.0 contain a critical out-of-bounds memory write vulnerability allowing unauthenticated remote attackers to crash MODBUS servers and potentially execute code on embedded systems lacking memory protection. Organizations running industrial control systems on nanoMODBUS face operational disruption and potential safety risks, with no vendor patch currently available.
Restrict network access to MODBUS ports (TCP/UDP 502) to trusted internal networks; deploy intrusion detection signatures for oversized Read File Record responses; run MODBUS servers on systems with memory protection (ASLR, DEP/NX) to mitigate RCE potential; monitor for unexpected process terminations and memory anomalies. No vendor-released patch identified at time of analysis-apply patch immediately upon release.
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.
Memory corruption occurs when a program writes data beyond the boundaries of allocated memory regions or accesses memory in unintended ways, violating the integrity of the process's address space.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.
More in Nanomodbus
View allArbitrary-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
Off-by-one buffer overflow in nanoMODBUS through v1.23.0 lets remote unauthenticated attackers write one attacker-contro
EUVD-2026-53331
GHSA-29rm-wvww-5gjv
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB