Skip to main content

nanoMODBUS EUVDEUVD-2026-53333

| CVE-2026-71256 CRITICAL
Out-of-bounds Read (CWE-125)
2026-08-05 TuranSec GHSA-vq4c-5vwv-g86v
9.8
CVSS 3.1 · Vendor: TuranSec
View

Attack ChainAIDerived

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

  1. Access
    Attacker controls or MITMs a Modbus server
  2. Delivery
    Client sends Read Device Identification request
  3. Exploit
    Server replies with object_id ≥ 3
  4. Execution
    OOB stack read yields wild buffer index
  5. Persist
    strncpy writes attacker data to wild pointer
  6. Impact
    Memory corruption / code execution on client

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Bounds checking, read limits
MITRE ATT&CK

1 technique across 1 tactic: Collection

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires that a nanoMODBUS client (version through 1.23.0) issue a Read Device Identification request (Modbus function code 0x2B, MEI type 0x0E) to a server the attacker controls or can impersonate/MITM, and that the malicious server return a response object with object_id >= 3 - that out-of-range object_id read directly from the wire IS the core trigger condition. No authentication or user interaction on the client is needed to process the malicious response. The principal LIMITING factor is directional: this is a client-side library flaw, so the attacker must be the (or a) Modbus SERVER the client talks to, not an arbitrary remote host - clients that poll only trusted servers on isolated networks are not exposed. A further prerequisite is that the client actually uses the device-identification feature; clients that never send FC 0x2B requests do not reach the vulnerable parser.

Impact

The CVSS 3.1 base score of 9.8 (AV:N/AC:L/PR:N/UI:N, C:H/I:H/A:H) reflects a network-reachable, low-complexity flaw with no authentication and full impact, and the deterministic absence of any bounds check makes the trigger highly reliable (AC:L is justified). However, these signals must be weighed against a key structural caveat: this is a CLIENT-side library flaw, so exploitation requires the victim to connect to and query a MALICIOUS or COMPROMISED Modbus server (or an on-path/MITM attacker) - the classic 'malicious server attacks its client' model - rather than an attacker directly reaching an exposed service. No EPSS score, KEV listing, POC, or SSVC decision data was provided in the input, so probabilistic exploitation likelihood cannot be quantified from available signals. Net assessment: technically severe and reliably triggerable, but real-world priority is gated by whether affected deployments talk to untrusted or internet-exposed Modbus servers; devices polling only trusted local PLCs face lower practical exposure. The CWE-125 (read) classification understates the actual write primitive - treat this as a memory-corruption/write issue when prioritizing.

Exploit ScenarioDerived

An attacker who controls a Modbus server endpoint - or who man-in-the-middles an unencrypted Modbus/TCP session - waits for a nanoMODBUS client to send a Read Device Identification request. The malicious server replies with an object_id >= 3, causing the client to read an out-of-bounds stack byte and derive a wild destination pointer, then strncpy() attacker-supplied bytes to that address, corrupting client memory and potentially achieving code execution or a crash on the embedded device. No public exploit was identified at time of analysis, but the deterministic, unauthenticated trigger makes weaponization straightforward for anyone able to answer the client's query.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
No patch listed yet 0.3% exploitation probability (EPSS)

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

Alert me

AnalysisAIv2 – Aug 05, 2026

Arbitrary-address memory write in the nanoMODBUS Modbus client library (through v1.23.0) allows a malicious or compromised Modbus server to corrupt the memory of any client that issues a Read Device Identification request. The flaw stems from an unchecked server-supplied object_id used as an array index, ultimately steering a strncpy() destination pointer with attacker-controlled data - a condition that typically leads to remote code execution or crash on embedded/IoT clients. There is no public exploit identified at time of analysis, and it is not listed in CISA KEV; the assigned CVSS is 9.8, though exploitation requires the victim client to communicate with an attacker-controlled server.

Earlier versions of this analysis (1)
v1 Aug 05, 2026 - 12:18 CVSS 8.1

Out-of-bounds stack read cascading into a wild-pointer write in nanoMODBUS through v1.23.0 allows a malicious Modbus server to achieve arbitrary memory writes in any application embedding this library as a client. The flaw resides in the Read Device Identification response parser: an attacker-controlled object_id byte (0-255) indexes a fixed 3-element stack array without bounds validation, producing a garbage byte that is then dereferenced as a char* destination for strncpy() with server-supplied data. No exploit code has been publicly identified and no CISA KEV listing exists, but the network-reachable vector and full C/I/A impact make this a high-priority patch target for any OT or IoT firmware embedding this library.

RemediationAI

No vendor-released patch version was identified at time of analysis - the provided references point only to the GitHub repository (https://github.com/debevv/nanoMODBUS) and the vulnerable source file, not to a tagged fixed release, so upgrade to a specific version cannot yet be cited. Monitor the upstream repository for a release later than 1.23.0 that adds a bounds check on object_id, and apply it once published. As a concrete source-level fix, validate the server-supplied object_id before use - reject or ignore any Read Device Identification object with object_id >= 3 (or >= the size of order[]) before computing order[object_id], and additionally bounds-check the resulting buf_index against the buffers[] array length; this is a low-risk change with no functional downside for compliant servers. As compensating controls until patched: restrict nanoMODBUS clients to communicate only with trusted, authenticated Modbus servers on isolated OT/ICS network segments; block or filter Modbus (TCP/502) traffic from untrusted networks and prevent internet exposure; and where feasible avoid or disable issuing Read Device Identification (FC 0x2B / MEI 0x0E) requests to unverified endpoints - the trade-off is loss of device-identification metadata for those peers.

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 is a lightweight, portable C implementation of the Modbus RTU/TCP protocol used primarily in embedded, industrial, and IoT devices acting as Modbus clients (masters). The vulnerable path is nmbs_read_device_identification_basic() / recv_read_device_identification_res() in nanomodbus.c, which parses a Modbus 'Read Device Identification' (function code 0x2B / MEI type 0x0E) response. A fixed stack array order[3] = {0,1,2} maps each returned object ID to one of three destination buffers. The server-controlled object_id byte (0-255, read straight off the wire) is used as buf_index = order[object_id] with no range validation, so any object_id >= 3 reads a garbage byte from the stack adjacent to order[]. That byte then indexes a 3-element buffers[] array of char* pointers, yielding a wild pointer that is passed as the strncpy() destination. Although CISA/NVD classify this as CWE-125 (Out-of-bounds Read), the primary security consequence is an out-of-bounds/wild-pointer WRITE (closer to CWE-787), because the leaked index drives a destination pointer for a copy of server-supplied bytes.

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 9.8 HIGH
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
vuln.today AI 9.8 CRITICAL

Network-reachable via a malicious/MITM Modbus server (AV:N), deterministic no-bounds-check trigger (AC:L), no client auth or interaction (PR:N/UI:N); wild-pointer write of server-controlled data yields full C/I/A.

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

Primary rating from Vendor (TuranSec).

CVSS VectorVendor: TuranSec

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

4
Analysis Updated
Aug 05, 2026 - 12:28 vuln.today
v2 - CVSS changed
Severity Changed
Aug 05, 2026 - 12:22 NVD
HIGH CRITICAL
CVSS changed
Aug 05, 2026 - 12:22 NVD
8.1 (HIGH) 9.8 (CRITICAL)
CVE Published
Aug 05, 2026 - 11:44 cve.org
HIGH 8.1

DescriptionCVE.org

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

Executive ViewAI

Why It Matters

The nanoMODBUS client library (through v1.23.0) contains a critical remote code execution vulnerability (CVE-2026-71256, CVSS 9.8) triggered when clients communicate with a malicious Modbus server. Any organization deploying this library in IoT, industrial control systems, or embedded applications faces immediate risk of system compromise, data breach, or service disruption; no vendor-released patch identified at time of analysis.

Business Impact: Severe
Compensating Controls

Network segmentation restricting Modbus client-server communication to trusted, authenticated servers only; disable Read Device Identification requests where possible; implement inbound/outbound firewall rules with IP whitelisting; deploy network intrusion detection tuned for Modbus protocol anomalies; maintain audit logs of all Modbus transactions for incident investigation. Pending vendor patch release, these controls serve as temporary containment measures only.

Threat Intelligence Overview

EPSS Score
0.3%
Top 77% exploitable
Prevalence
Low
niche lightweight C Modbus library for embedded/IoT and OT devices
Social Media
1
Sightings
Data Quality
6 sources
Confidence: High

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 CRITICAL
CISA KEV No
Public POC No
EPSS 0.3%
Patch available No
Active threat No
Deciding rule
CRITICAL severity
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
Out-of-Cycle
Exploitation
None
System Exposure· derived
Open
Automatable
Yes
Human Impact
Very High
Technical Impact
Total

Priority Score

49
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +49
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.

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