Skip to main content

FreeModbus EUVDEUVD-2026-53348

| CVE-2026-71263 CRITICAL
Out-of-bounds Write (CWE-787)
2026-08-05 TuranSec GHSA-cjvm-2pqq-6v6h
9.1
CVSS 3.1 · Vendor: TuranSec
View

Attack ChainAIDerived

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

  1. Access
    Reach Modbus TCP service on port 502
  2. Delivery
    Craft MBAP frame with Length 264
  3. Exploit
    Pass off-by-one bounds check
  4. Execution
    recv() overflows aucTCPBuf by 7 bytes
  5. Persist
    Corrupt adjacent usTCPBufPos state
  6. Impact
    Parser 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.

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

AnalysisAIv1 – 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

FreeModbus 0 ≤*

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

Vendor (TuranSec) PRIMARY 9.1 CRITICAL
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H
vuln.today AI 8.2 HIGH

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).

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/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
None
Integrity
High
Availability
High

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

Why It Matters

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.

Business Impact: Severe
Compensating Controls

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

EPSS Score
0.3%
Top 76% exploitable
Prevalence
Low
popular embedded Modbus stack but vulnerable LINUXTCP demo port rarely used in production
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
Partial

Priority Score

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

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.

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