CVE-2026-71256 Details
Description
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].
A vulnerability in nanoMODBUS versions through 1.23.0 allows for an out-of-bounds stack read, which can lead to a wild-pointer write. This issue occurs in the functions nmbs_read_device_identification_basic() and recv_read_device_identification_res() within nanomodbus.c. The vulnerability arises because a fixed 3-element stack array is used to map object IDs to buffer indices, but the object_id field, which is read directly from the wire, is applied without proper bounds checking. When a malicious Modbus server sends a Read Device Identification response with an object_id of 3 or higher, it can read an out-of-bounds or garbage byte from the stack. This byte, which is adjacent to the order array, is then used as an index for a 3-element array of char* pointers. The resulting wild pointer is passed to strncpy() as the destination, enabling an arbitrary-address write with server-controlled data.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
Volerion
Assessed Aug 5, 2026CISA-ADP
Assessed Aug 5, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/debevv/nanoMODBUS | TuranSec | Vendor |
| https://github.com/debevv/nanoMODBUS/blob/master/nanomodbus.c | TuranSec | Source CodeVendor |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-125 | Out-of-bounds Read | TuranSec |
Affected Products
| Product | Versions |
|---|---|
| debevv nanoMODBUS | <= 1.23.0 (semver) |
CPE
Remediation
| |
Change History
3 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Aug 10, 2026 | CVE Modified | TuranSec |
| Aug 5, 2026 | CVE Modified | CISA-ADP |
| Aug 5, 2026 | New CVE Received | TuranSec |
Volerion