CVE-2026-71254: nanoMODBUS Server-Side Out-of-Bounds Write in handle_read_file_record()

Published Aug 5, 2026
·
Updated

nanoMODBUS through v1.23.0 contains an out-of-bounds write in the Modbus server-side handlereadfilerecord() 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 recordlength is at most 124, but it never validates the CUMULATIVE response size across all sub-requests before processing them. The accumulator responsedatasize is declared as uint8t and is incremented by 2 + recordlength2 for each of up to 35 sub-requests; with 35 sub-requests of recordlength=124, the cumulative demand is 8750 bytes, which overflows the uint8t accumulator. A subsequent loop then calls getn(), 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 bufidx by up to 248 bytes per call; swapregs() 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.

Affected Software

1 affected component
nanoMODBUS nanoMODBUS<=1.23.0

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-71254?

The severity of CVE-2026-71254 is rated as critical with a score of 9.1.

2

What vulnerability does CVE-2026-71254 describe?

CVE-2026-71254 describes an out-of-bounds write vulnerability in the handle_read_file_record() function of the nanoMODBUS server.

3

How do I fix CVE-2026-71254?

To fix CVE-2026-71254, update to a patched version of nanoMODBUS that addresses the out-of-bounds write issue.

4

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

CVE-2026-71254 affects versions of nanoMODBUS prior to v1.23.0.

5

What impact does CVE-2026-71254 have on the system?

CVE-2026-71254 can lead to remote code execution or denial of service due to the out-of-bounds write.

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