CVE-2026-71254
Received Received - Intake

Out-of-Bounds Write in nanoMODBUS Modbus Server

Vulnerability report for CVE-2026-71254, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-08-05

Last updated on: 2026-08-05

Assigner: 309f9ea4-e3e9-4c6c-b79d-e8eb01244f2c

Description

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.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-08-05
Last Modified
2026-08-05
Generated
2026-08-05
AI Q&A
2026-08-05
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 1 associated CPE
Vendor Product Version / Range
debevv nanomodbus 1.23.0

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-787 The product writes data past the end, or before the beginning, of the intended buffer.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

This vulnerability is an out-of-bounds write in the nanoMODBUS library through version 1.23.0. It occurs in the Modbus server-side function handle_read_file_record() when processing FC 0x14 (Read File Record) requests. The function fails to validate the cumulative response size across multiple sub-requests, allowing an attacker to craft a request that overflows a buffer by writing up to 8490 bytes beyond its 260-byte limit. This can corrupt adjacent memory and potentially lead to denial of service or remote code execution.

Detection Guidance

Detecting this vulnerability requires monitoring for out-of-bounds write attempts in the nanoMODBUS server. Check for crashes or memory corruption in the server process when handling Modbus FC 0x14 requests. Use network traffic analysis tools like Wireshark to inspect Modbus packets for unusually large or malformed FC 0x14 requests with excessive sub-requests or record lengths.

Impact Analysis

If you use nanoMODBUS v1.23.0 or earlier in a Modbus server, an unauthenticated attacker on the network could exploit this to crash your server or execute arbitrary code. This is especially dangerous on embedded or bare-metal systems without memory protection, where out-of-bounds writes can directly corrupt critical data or control flow.

Compliance Impact

This vulnerability could lead to unauthorized memory access, denial of service, or remote code execution, which may compromise data integrity and confidentiality. For systems handling sensitive data under GDPR or HIPAA, such breaches could result in non-compliance, legal penalties, or loss of protected health information (PHI) integrity.

Mitigation Strategies

Immediately update nanoMODBUS to the latest version if available. If not, restrict network access to the Modbus server using firewalls or network segmentation. Disable FC 0x14 (Read File Record) functionality if not required. Monitor server logs for suspicious activity and consider deploying intrusion detection systems to block malformed Modbus requests.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-71254. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart