CVE-2026-71256: nanoMODBUS Client-Side Out-of-Bounds Read Leading to Wild-Pointer Write via object_id

Published Aug 5, 2026
·
Updated

nanoMODBUS through v1.23.0 contains an out-of-bounds stack read leading to a wild-pointer write in nmbsreaddeviceidentificationbasic() / recvreaddeviceidentificationres() in nanomodbus.c. A fixed 3-element stack array order[3] = {0,1,2} maps object IDs to buffer indices. The server-supplied objectid field (0-255, read directly from the wire) is used without any bounds check as bufindex = order[objectid]. When a malicious Modbus server sends a Read Device Identification response with objectid >= 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.

Affected Software

1 affected component
nanoMODBUS<=1.23.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade nanoMODBUS to a version that resolves this vulnerability.

    Fixed in v1.23.0
  2. Compensating control

    If you cannot patch immediately, restrict/deny connections to untrusted Modbus servers so attacker-controlled Read Device Identification responses (with object_id >= 3) cannot be received by nanoMODBUS.

Event History

Aug 5, 2026
CVE Published
via MITRE·11:44 AM
Data Sourced
via MITRE·11:44 AM
DescriptionSeverityWeakness
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-71256?

The severity of CVE-2026-71256 is classified as high with a score of 8.1.

2

How do I fix CVE-2026-71256?

To fix CVE-2026-71256, update to the latest version of nanoMODBUS that includes the patch for this vulnerability.

3

What type of vulnerability is CVE-2026-71256?

CVE-2026-71256 is an out-of-bounds read vulnerability leading to a wild-pointer write.

4

What might be the impact of exploiting CVE-2026-71256?

Exploiting CVE-2026-71256 may lead to potential crashes or arbitrary code execution due to a corrupted memory state.

5

Which versions of nanoMODBUS are affected by CVE-2026-71256?

CVE-2026-71256 affects nanoMODBUS versions up to and including v1.23.0.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203