Skip to main content

nanoMODBUS CVE-2026-54410

| EUVDEUVD-2026-36661 HIGH
Off-by-one Error (CWE-193)
2026-06-14 TuranSec GHSA-6f53-f2m4-6j2h
7.8
CVSS 4.0 · Vendor: TuranSec
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Identify exposed Modbus/TCP port 502
  2. Delivery
    Establish TCP connection to server
  3. Exploit
    Send MBAP frame with Length=255
  4. Install
    Trigger off-by-one past 260-byte buffer
  5. C2
    Corrupt state buffer-index field
  6. Execute
    Issue FC16 Write Multiple Registers with skewed index
  7. Impact
    Crash service or write unintended physical registers

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Off-by-one prevention
Exploitation Conditions

The target must be running nanoMODBUS ≤ v1.23.0 compiled with the Modbus/TCP server role and reachable on TCP/502 from the attacker; no authentication, user interaction, or non-default configuration is required because Modbus/TCP has no native auth. Triggering the overflow itself requires only a single MBAP frame with Length=255 - there are no protocol prerequisites beyond completing the TCP handshake. The elevated outcomes (one-byte information disclosure and unintended-register writes via the FC16 handler) are limited to bare-metal and RTOS deployments without an MMU or MPU isolating the receive buffer from the adjacent state structure; on Linux or other memory-protected hosts the impact degrades to denial of service. Exploitation is bounded by network reachability to the Modbus/TCP service, which in compliant OT architectures is segmented from corporate and internet zones.

Impact

The provided CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:N, VA:H, VC:L/VI:L) accurately reflects a remote, unauthenticated, low-complexity reach with high availability impact and low confidentiality/integrity impact, consistent with the description's primary DoS outcome and conditional info-disclosure/unintended-write secondaries. The E:P (proof-of-concept) and AU:Y (automatable) supplemental metrics elevate operational risk because a single malformed MBAP frame is sufficient and scriptable. No EPSS score, KEV listing, or POC reference is included in the input, so empirical exploitation probability cannot be quantified - treat the E:P as the reporter's claim, not CISA-confirmed activity. The real-world severity is highly deployment-dependent: on Linux/MMU-backed targets the impact is DoS only, while on bare-metal/RTOS industrial endpoints the corruption can cross into safety-relevant unintended register writes, which is the scenario operators should weight most heavily. Note the provided 7.8 score appears low for an AV:N/PR:N/VA:H bug - defenders should recompute rather than rely on the supplied number.

Exploit ScenarioDerived

An attacker with TCP reach to a device's Modbus/TCP port 502 opens a connection and sends a single MBAP frame whose 16-bit Length field is set to 255, triggering the off-by-one write at the end of the 260-byte receive buffer and corrupting the state machine's buffer-index. On a Linux target the service crashes (DoS of the industrial endpoint); on an RTOS or bare-metal PLC, the attacker follows up with a Write Multiple Registers (FC16) request that, due to the corrupted index, lands at an unintended register address - potentially altering a setpoint or coil that controls a physical process. No public exploit identified at time of analysis, but the trigger is a one-packet primitive that is straightforward to weaponize.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
No patch listed yet 0.5% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jun 14, 2026

Off-by-one buffer overflow in nanoMODBUS through v1.23.0 lets remote unauthenticated attackers write one attacker-controlled byte past a 260-byte receive buffer in the Modbus/TCP server's recv_msg_header() function. The corruption of the adjacent buffer-index field can cause denial of service on all targets and, on bare-metal/RTOS deployments without memory protection, leak one byte of memory and trigger unintended writes through the Write Multiple Registers (FC16) handler. No public exploit identified at time of analysis, but the bug is trivially reachable by sending a crafted MBAP frame with Length=255.

RemediationAI

No vendor-released patch identified at time of analysis; monitor the upstream repository at https://github.com/debevv/nanoMODBUS for a release succeeding v1.23.0 and rebuild/reflash firmware once a fixed tag is published. In the interim, restrict Modbus/TCP server exposure to dedicated OT/process-control VLANs and block TCP/502 at perimeter and IT/OT boundary firewalls (Modbus has no native authentication, so network segmentation is the standard compensating control); the trade-off is that any legitimate remote engineering workstation will also lose direct reach and must be tunneled through a jump host. As a code-level workaround for integrators who cannot wait, patch recv_msg_header() locally to reject MBAP frames whose Length field exceeds the receive buffer capacity (a strict upper bound below 255 for the post-header payload) before the buffered read, which closes the off-by-one without affecting protocol conformance for valid frames. For bare-metal/RTOS targets, consider enabling MPU regions around the nanoMODBUS state structure to convert the unintended-write primitive into a fault rather than silent register corruption.

Affected VersionsENISA

nanoMODBUS 0 ≤1.23.0

Affected Packages

euvd nanomodbus no fix

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

nanoMODBUS (cpe:2.3:a:debevv:nanomodbus) is a lightweight, embedded-oriented C implementation of the Modbus protocol commonly deployed on microcontrollers, RTOS targets, and bare-metal industrial devices acting as Modbus/TCP servers. The root cause is CWE-193 (Off-by-One Error) in recv_msg_header() at nanomodbus.c line 369, where the MBAP (Modbus Application Protocol) header's 16-bit Length field is trusted with insufficient bound enforcement: a value of 255 causes the read to extend one byte beyond the fixed 260-byte receive buffer. Because the overflowed byte lands in the immediately-adjacent buffer-index member of the nanoMODBUS state structure (an adjacency-based corruption pattern that overlaps with CWE-787 out-of-bounds write), subsequent parsing - particularly in the FC16 Write Multiple Registers path - uses an attacker-influenced index, turning a parsing bug into a logic corruption that affects register write targeting on systems without MMU/MPU isolation.

Know when Nanomodbus gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (TuranSec) PRIMARY 7.8 HIGH
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:H/SC:N/SI:N/SA:N/E:P/AU:Y
vuln.today AI 8.6 HIGH

Single crafted Modbus/TCP frame on port 502 with no auth or interaction (AV:N/AC:L/PR:N/UI:N); reliable DoS gives A:H while conditional one-byte leak and unintended writes give C:L/I:L.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (TuranSec).

CVSS VectorVendor: TuranSec

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
Low
Vulnerable system: Integrity
Low
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

DescriptionCVE.org

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.

Executive ViewAI

Why It Matters

nanoMODBUS versions through v1.23.0 contain a remote unauthenticated off-by-one buffer overflow in the Modbus/TCP server, enabling attackers to cause denial of service against all deployments and potentially leak memory or trigger arbitrary writes on unprotected bare-metal and RTOS systems. Organizations operating nanoMODBUS in industrial control, IoT, or operational technology environments face immediate service disruption risk and, on unprotected deployments, potential system compromise or unauthorized system state modification.

Business Impact: High
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations: (1) enforce network-layer access control to restrict Modbus/TCP connectivity to trusted subnets; (2) deploy intrusion detection signatures to detect and block crafted MBAP frames with oversized Length values; (3) on bare-metal and RTOS deployments without OS-level memory protection, enable hardware-based protections (MPU, watchdog timers) if available; (4) implement continuous monitoring for unexpected process restarts or system crashes; (5) establish migration timeline to switch to a hardened or patched Modbus implementation.

Threat Intelligence Overview

EPSS Score
0.5%
Top 59% exploitable
Social Media
2
Sightings
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment CIRCL GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.5%
Patch available No
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
Yes
Human Impact
High
Technical Impact
Partial

Priority Score

40
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +39
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy