CODESYS Control CmpChannelMgr Out-of-Order Block Out-of-Bounds Write (CVE-2026-127148)
Published: 2026-12-03 • Researcher: Nicolas Krassas (dinosn); CODESYS Security Advisory 2026-17 / CERT@VDE VDE-2026-169
- Severity
- Critical
- CVE
- CVE-2026-127148
- Category
- network
- Affected product
- CODESYS Control runtime system — CmpChannelMgr / CmpChannelMgrEmbedded
- Affected versions
- Windows product family before 3.5.22.50; Linux product family before 4.24.0.0
- Disclosed
- 2026-12-03
- Patch status
- Patched
Tags
References
Archive entry
intelseclab/poc-archiveOn this page
Metadata
| Field | Value |
|---|---|
| Date Added | 2026-12-03 |
| Last Updated | 2026-12-03 |
| Author / Researcher | Nicolas Krassas (dinosn); CODESYS Security Advisory 2026-17 / CERT@VDE VDE-2026-169 |
| CVE / Advisory | CVE-2026-127148 |
| Category | network |
| Severity | Critical |
| CVSS Score | 9.8 (CVSSv3.1) |
| Status | Weaponized |
| Tags | codesys, plc, ics, ot, cmpchannelmgr, out-of-bounds-write, unauthenticated, rce, network, cwe-787 |
| Related | Separate in-order full-size-block overflow, no CVE assigned |
Affected Target
| Field | Value |
|---|---|
| Software / System | CODESYS Control runtime system — CmpChannelMgr / CmpChannelMgrEmbedded |
| Versions Affected | Windows product family before 3.5.22.50; Linux product family before 4.24.0.0 |
| Tested Builds | CODESYS Control Win 64 3.5.22.40; CODESYS Virtual Control for Linux SL 4.23.0.0, runtime 3.5.22.40 |
| Fixed Versions | Windows 3.5.22.50; Linux 4.24.0.0 |
| Language / Platform | CODESYS online protocol over TCP 11740; Python 3.8+ PoC |
| Authentication Required | No |
| Network Access Required | Yes |
Summary
CVE-2026-127148 is an unauthenticated out-of-bounds write in CODESYS Control’s CmpChannelMgr online service. The runtime accepts a maximum-size out-of-order L4 data block without verifying that the block fits in the channel communication buffer. The copy extends beyond the declared buffer into reserved channel memory, poisoning the channel state; the repository’s bounded detector distinguishes that vulnerable state from a fixed runtime without crashing it. The same repository also contains build-specific network-only RCE chains for Linux and Windows that derive addresses, install a fake object/vtable and invoke system or WinExec. The CVE is fixed in CODESYS Control Win 64 3.5.22.50 and the Linux 4.24.0.0 family.
Vulnerability Details
Root Cause
The CmpChannelMgr and CmpChannelMgrEmbedded components perform improper length checking when handling online service packets. An out-of-order block whose length equals the channel’s maximum block size is copied without checking whether it fits the declared communication buffer (CWE-787). In the tested build the copy extends 392 bytes past a 95,752-byte communication buffer but remains inside reserved channel memory, which is why the bounded detector can observe the poisoned state without crashing the service.
Attack Vector
An unauthenticated attacker connects to the CODESYS runtime on TCP 11740 and opens a channel with a 95,752-byte communication buffer. The PoC sends a valid first block and a full-size out-of-order block 202, completes blocks 2 through 201, and sends the proper final block. A vulnerable runtime accepts the oversized out-of-order block and enters the poisoned state; a fixed runtime rejects it and accepts the final block normally.
Impact
Out-of-bounds write in the runtime process, enabling memory corruption and, with the build-specific chains, native code execution as the runtime user (root on the tested Linux image, SYSTEM on the tested Windows service). A malformed sequence can also destabilize or crash the runtime. The network-only Linux and Windows chains run id / whoami marker commands and leave the service running.
Environment / Lab Setup
OS: Linux or Windows CODESYS runtime
Target: CODESYS Control runtime with online protocol on TCP 11740
Attacker: Python 3.8+ on a reachable network path
Tools: python3, socket/struct/zlib; build-specific RCE chains in subdirectoriesSetup Steps
| |
For the network-only RCE chains, the target must be the exact tested build and the lab endpoint must be forwarded to runtime port 11740. See:
Both chains require build-specific offsets; they are not generic one-click exploits.
Proof of Concept
Step-by-Step Reproduction
- Confirm the runtime is reachable on TCP 11740 and has free channel slots.
- Run the bounded detector; exit code 0 indicates the vulnerable poisoned state, 1 indicates the fixed runtime, and 2 means undetermined (for example, all four slots occupied).
- For the RCE proof, use the Linux or Windows chain matching the tested runtime and follow its README. The Linux chain uses a response disclosure, absolute reads, a preserved special-protocol registry, a fake object/vtable and a packet-dispatched JOP path to run
id>/tmp/n. The Windows chain uses a response disclosure, KERNEL32 resolution and a fake object/vtable to runwhoami>C:\c. - Confirm the marker and that the CODESYS service remains running.
Exploit Code
See
poc.py,poc-inorder.pyand thelinux-network-rce/andwindows-network-rce/directories.
The separate in-order full-size-block overflow is a distinct bug. It remains present in every tested build, including Control Win 64 3.5.22.50, and is not evidence that the CVE-2026-127148 fix failed.
Expected Output
| |
Detection & Indicators of Compromise
- CODESYS online protocol traffic on TCP 11740 with maximum-size out-of-order L4 blocks or block 202 before blocks 2–201.
- Channel state corruption, unexpected runtime restarts, crashes, or unavailable channel slots.
- Unexpected child processes from the CODESYS runtime:
/bin/sh,id,hostname,cmd.exe,whoami. - New marker files such as
/tmp/norC:\con runtime hosts. - CODESYS runtime versions below 3.5.22.50 (Windows) or 4.24.0.0 (Linux).
SIEM / IDS rule (example):
| |
Remediation
| Action | Detail |
|---|---|
| Patch | Upgrade CODESYS Control Win 64 to 3.5.22.50 or later; upgrade the Linux product family to 4.24.0.0 or later. |
| Workaround | Restrict TCP 11740 to trusted engineering networks; do not expose CODESYS runtimes directly to untrusted networks. |
| Config Hardening | Monitor channel exhaustion and runtime crashes; limit PLC/engineering protocol access at the network boundary. |
References
Notes
Reviewed 2026-12-03 from the linked repository. The detectors are bounded and non-crashing; the Linux and Windows network-only chains are build-specific and were verified upstream against Virtual Control Linux SL 4.23.0.0 and Control Win 64 3.5.22.40. They run only marker commands (id, whoami) and do not contain persistence, credential theft, C2 or worm behavior.
No CVE is assigned to the separate in-order overflow, which is included only as a related detector. The gdb-assisted sibling harness (poc-rce.py, rce.sh, build_rce_payload.py), geometry measurement scripts, __pycache__ binaries, pcaps and captured evidence were not copied; the entry keeps the CVE detector, both network RCE chains, the oracles and their READMEs/provenance/verification notes. The repository has no license file; the code is archived with attribution for authorized research only. No exploit code was executed during archival; only Python syntax checks were used.
| |