Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessReach Modbus TCP service on port 502
-
DeliveryCraft MBAP frame with Length 264
-
ExploitPass off-by-one bounds check
-
Executionrecv() overflows aucTCPBuf by 7 bytes
-
PersistCorrupt adjacent usTCPBufPos state
-
ImpactParser state corruption / denial of service
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Bounds checking, write limits
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Privilege Escalation The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | The target must be running the FreeModbus LINUXTCP transport port (demo/LINUXTCP/port/porttcp.c) with its Modbus TCP listener exposed and reachable by the attacker (default TCP/502). The specific trigger is a Modbus MBAP frame whose Length header field is set to 264, producing usTCPFrameBytesLeft == 263 that slips through the flawed strict-greater-than check. No authentication, user interaction, or non-default runtime configuration is required - Modbus TCP has no built-in authentication - so the only real limiting factors are network reachability to the service and that the deployment actually uses the vulnerable LINUXTCP port rather than a different (e.g., RTU or custom TCP) transport. |
| Impact | The CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H, 9.1) reflects a genuinely trivial precondition set: network-reachable, no authentication, no user interaction, low complexity - consistent with Modbus having no built-in authentication. That makes the trigger reliable, but the actual memory-safety impact is bounded: the overflow is a controlled 7-byte write into one adjacent static variable (usTCPBufPos), not an unbounded stack/heap smash, so the realistic outcome is parser-state corruption and denial of service rather than straightforward code execution - the I:H/A:H rating is defensible for state corruption but arguably overstates exploitability toward RCE. No EPSS score, KEV entry, POC, or SSVC decision data was provided, so exploitation-probability signals are absent; treat this as no public exploit identified at time of analysis. A key caveat: the vulnerable code is a demo/reference transport port, so real-world exposure depends entirely on whether a deployed product actually built on LINUXTCP rather than a custom or RTU transport - verify against the specific firmware before prioritizing. |
| Exploit ScenarioDerived | An attacker with network reachability to a device running the FreeModbus LINUXTCP service on TCP/502 sends one crafted MBAP frame with the Length field set to 264. The frame passes the off-by-one check, and recv() writes 263 bytes into the 263-byte aucTCPBuf, overflowing 7 bytes into usTCPBufPos and corrupting the Modbus receive-position state, most plausibly crashing or hanging the poll loop (DoS). No POC is provided, and the low complexity plus absent authentication mean the trigger is a single unauthenticated packet. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 05, 2026
Out-of-bounds write in the LINUXTCP demo port of FreeModbus (cwalter-at fork) lets a remote, unauthenticated attacker overflow the static aucTCPBuf receive buffer by sending a single crafted Modbus TCP (MBAP) frame. Because the xMBPortTCPPool() length validation uses a strict '>' instead of '>=' against the 263-byte MB_TCP_BUF_SIZE, a frame declaring Length 264 passes the check and recv() writes 7 bytes past the buffer into the adjacent usTCPBufPos variable, corrupting parser state. CVSS is 9.1 (I:H/A:H); there is no public exploit identified at time of analysis and it is not on CISA KEV.
RemediationAI
No vendor-released patch identified at time of analysis. The correct fix is to change the bounds check in xMBPortTCPPool() from 'if (usTCPFrameBytesLeft > MB_TCP_BUF_SIZE)' to '>=', or equivalently to reject any MBAP frame whose declared Length would make usTCPFrameBytesLeft reach or exceed MB_TCP_BUF_SIZE (263) before the recv() call; rebuild affected firmware from the corrected source at https://github.com/cwalter-at/freemodbus/blob/master/demo/LINUXTCP/port/porttcp.c. Where patching is not immediately possible, restrict network exposure of the Modbus TCP service (default port 502) with firewall rules so only trusted control-network hosts can connect, and place the device behind a Modbus-aware gateway or IDS that drops MBAP frames with a Length field larger than the protocol maximum (253 for the PDU / 260 total) - the trade-off is that any legitimate over-length client traffic is dropped, but well-formed Modbus never needs Length 264. Network segmentation of OT/ICS assets away from general IT and the internet is the primary compensating control given Modbus lacks authentication.
Affected VersionsENISA
Affects your stack
Find out whether the stacks and servers you run are on an affected version.
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
FreeModbus is an open-source implementation of the Modbus RTU/ASCII/TCP protocol stack widely embedded in industrial and IoT device firmware. The flaw lives in the reference LINUXTCP transport port (demo/LINUXTCP/port/porttcp.c), which buffers incoming Modbus Application Protocol (MBAP) frames into a fixed 263-byte static buffer aucTCPBuf. Modbus TCP frames carry a 7-byte MBAP header (transaction ID, protocol ID, length, unit ID) followed by the PDU; the code reads the header-declared Length field to size the remaining recv(). The root cause is CWE-787 (out-of-bounds write) caused by a classic off-by-one boundary error: 'if (usTCPFrameBytesLeft > MB_TCP_BUF_SIZE)' should be '>=', so the maximum-plus-one case where usTCPFrameBytesLeft equals 263 slips through and recv() writes starting at offset 7, exceeding the 263-byte capacity by 7 bytes into the adjacent static usTCPBufPos.
Know when Freemodbus 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
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H
Remote, unauthenticated, single-packet trigger (AV:N/AC:L/PR:N/UI:N); bounded 7-byte overflow into one adjacent static var gives limited integrity impact (I:L) but reliable crash/DoS (A:H), no data disclosure (C:N).
Primary rating from Vendor (TuranSec).
CVSS VectorVendor: TuranSec
DescriptionCVE.org
The LINUXTCP port of FreeModbus contains an off-by-one bounds check in xMBPortTCPPool() (demo/LINUXTCP/port/porttcp.c). The check if (usTCPFrameBytesLeft > MB_TCP_BUF_SIZE) uses a strict greater-than comparison instead of greater-than-or-equal against the 263-byte MB_TCP_BUF_SIZE limit. An MBAP frame with a Length field of 264 makes usTCPFrameBytesLeft equal to 263, which passes the flawed check, and the subsequent recv() call writes up to 263 bytes starting at buffer offset 7 into the 263-byte static buffer aucTCPBuf, overflowing it by 7 bytes into the adjacent static variable usTCPBufPos. A single crafted, unauthenticated Modbus TCP packet triggers the overflow, since Modbus has no built-in authentication.
Executive ViewAI
FreeModbus LINUXTCP demo port (CVE-2026-71263, CVSS 9.1) contains a critical buffer overflow allowing remote, unauthenticated attackers to corrupt parser state and cause denial of service. Organizations operating this component as a network-accessible Modbus TCP service face immediate risk of operational disruption and potential code execution through memory corruption. No vendor patch is currently available, requiring urgent network isolation and architectural remediation.
No vendor-released patch identified at time of analysis. Interim mitigations: (1) network access control restricting Modbus TCP port 502 to pre-approved trusted hosts; (2) reverse proxy or inline validator rejecting MBAP frames with Length field ≥ 263; (3) network segmentation isolating Modbus systems from untrusted or internet-routable networks; (4) traffic monitoring and alerting on anomalous MBAP frame sizes; (5) air-gapped deployment if operationally feasible.
Threat Intelligence Overview
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.
What every action level means
SSVC AssessmentENISA
Priority Score
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.
Memory corruption occurs when a program writes data beyond the boundaries of allocated memory regions or accesses memory in unintended ways, violating the integrity of the process's address space.
EUVD-2026-53348
GHSA-cjvm-2pqq-6v6h
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB