CVE-2026-54410
Received Received - Intake
Buffer Overflow in nanoMODBUS Modbus/TCP Server

Publication date: 2026-06-14

Last updated on: 2026-06-14

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

Description
nanoMODBUS through v1.23.0 contains an off-by-one buffer overflow in the recv_msg_header() function of the Modbus/TCP server that allows remote unauthenticated attackers to write one attacker-controlled byte past the end of the 260-byte receive buffer by sending a crafted MBAP frame whose Length field is set to 255. The overflow corrupts the adjacent buffer-index field of the nanoMODBUS state structure, resulting in denial of service through invalid memory accesses and, on bare-metal and RTOS targets without memory protection, one-byte information disclosure and writes to unintended register addresses on the Write Multiple Registers (FC16) handler path.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-06-14
Last Modified
2026-06-14
Generated
2026-06-14
AI Q&A
2026-06-14
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.
CWE-193 A product calculates or uses an incorrect maximum or minimum value that is 1 more, or 1 less, than the correct value.
Attack-Flow Graph
AI Quick Actions
Instant insights powered by AI
Executive Summary

CVE-2026-54410 is an off-by-one buffer overflow vulnerability in the nanoMODBUS library up to version 1.23.0. It occurs in the recv_msg_header() function of the Modbus/TCP server, where an attacker can send a specially crafted MBAP frame with a Length field set to 255. This causes the program to write one byte past the end of a 260-byte receive buffer, corrupting adjacent memory.

This overflow corrupts the buffer-index field of the nanoMODBUS state structure, leading to denial of service through invalid memory accesses. On bare-metal and RTOS systems without memory protection, it can also cause one-byte information disclosure and unintended writes to register addresses during the Write Multiple Registers (FC16) handler.

Impact Analysis

The vulnerability can lead to denial of service (DoS) by causing invalid memory accesses that crash or destabilize the nanoMODBUS server. Additionally, on systems without memory protection, it can result in information disclosure of one byte and unauthorized writes to unintended registers, potentially altering device behavior or data.

Detection Guidance

This vulnerability involves an off-by-one buffer overflow in the recv_msg_header() function of the nanoMODBUS Modbus/TCP server, triggered by a crafted MBAP frame with a Length field set to 255.

Detection on your network or system would involve monitoring for unusual or malformed Modbus/TCP packets, specifically those with an MBAP Length field set to 255, which is outside the expected range.

You can use network packet capture tools such as tcpdump or Wireshark to filter and inspect Modbus/TCP traffic for suspicious Length field values.

  • Use tcpdump to capture Modbus/TCP packets: tcpdump -i <interface> tcp port 502 -w modbus_traffic.pcap
  • Open the captured file in Wireshark and apply a display filter to show Modbus packets with Length field equal to 255: modbus.length == 255

Additionally, monitoring for crashes or denial of service symptoms on devices running nanoMODBUS v1.23.0 or earlier may indicate exploitation attempts.

Mitigation Strategies

Immediate mitigation steps include preventing the exploitation of the off-by-one buffer overflow by restricting or filtering incoming Modbus/TCP traffic.

  • Implement network-level filtering to block Modbus/TCP packets with suspicious Length field values, especially those set to 255.
  • Apply access controls to limit Modbus/TCP communication to trusted hosts only.
  • Monitor and log Modbus/TCP traffic for anomalous packets and signs of denial of service.

From a software perspective, update nanoMODBUS to a version later than v1.23.0 where this vulnerability is fixed, or apply patches that ensure proper bounds checking in the recv_msg_header() function.

General best practices include using safer programming techniques, validating buffer sizes, and employing compiler protections such as stack canaries and address space layout randomization (ASLR) to mitigate buffer overflow risks.

Compliance Impact

The vulnerability in nanoMODBUS allows remote unauthenticated attackers to cause denial of service and potentially disclose one byte of information on certain targets without memory protection. This information disclosure and denial of service could impact the confidentiality and availability aspects of data security.

Such impacts on confidentiality and availability may affect compliance with standards and regulations like GDPR and HIPAA, which require protection of personal and sensitive data against unauthorized access and ensure system availability.

However, the provided context does not explicitly describe or analyze the direct effects of this vulnerability on compliance with these or other common standards and regulations.

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