alosafuzz
ICS/OT protocol security research — fuzzing, scanning, and coordinated disclosure.

A Researcher's Guide to EtherCAT (and SOEM)

Vendor: cross · Sector: manufacturing, cross · Transport: ethernet, eoe · Project: fieldbusfuzzer

Part of the alosafuzz ICS protocol-guide series — written for fuzzing and vulnerability researchers. Defensive posture: wire format, fuzz surface, and published bug classes only; no weaponized exploit or DoS code.


1. What it is & where it runs

EtherCAT (Ethernet for Control Automation Technology, IEC 61158) is a real-time fieldbus that runs directly on standard Ethernet (EtherType 0x88A4), originated by Beckhoff and managed by the EtherCAT Technology Group. It is pervasive in motion control, robotics, CNC, packaging, and semiconductor tooling — anywhere a controller must clock many I/O nodes with microsecond determinism.

The single most important thing for a researcher: EtherCAT is strongly master-centric. One master drives the segment; slaves only ever respond. Frames are forwarded slave-to-slave “on the fly,” each node reading and writing its slice as the frame passes. That design decides where the attack surface is: the master’s parser of slave-supplied data, not the slave firmware. On a bus with one malicious, counterfeit, or compromised device, every byte the master reads back is attacker-influenced.

2. Frame & datagram model

An EtherCAT frame carries one or more datagrams, each with a command (read/write to a logical/physical/auto-increment address), an address, a length, and a working counter (WKC) that slaves increment to prove they processed it. A fuzzer reaching the master exercises: WKC/offset handling in frame processing, and the mailbox.

3. The mailbox — the richest surface

Acyclic, larger exchanges use the mailbox, a length-prefixed envelope that multiplexes several protocols over the same framing:

Sub-protocol Purpose
CoE (CANopen-over-EtherCAT) SDO object dictionary read/write — config, parameters
SoE (Servo/Sercos-over-EtherCAT) servo drive parameters (IDNs)
FoE (File-over-EtherCAT) firmware/file transfer, segmented
EoE (Ethernet-over-EtherCAT) tunneled Ethernet/IP, incl. a set-IP request

Each sub-protocol carries its own length field, supplied by the slave, and each handler computes a payload size from it. That shared shape — slave-supplied length, minus a fixed header, used to size a copy — is the recurring fuzz target.

4. The fuzz surface, mapped to SOEM

SOEM (RT-Labs) is the open-source master most products embed. The surface a researcher drives:

In-process libFuzzer + ASan/UBSan reaches all of these; a veth two-process setup (a real master vs. a minimal malicious-slave) confirms reachability on the wire.

5. Published bug classes (SOEM, ≤2.0.0; fixed in 2.0.1)

RT-Labs advisory RRTL-260921-1 consolidated multiple researchers’ reports into six CVEs, all AV:A, all fixed in SOEM 2.0.1:

The fix is instructive: a single validation in the central mailbox-receive function — check each message’s length against the per-protocol minimum and the physical mailbox size before any parser runs — closes the underflow across all four sub-protocols. One guard in the shared path beats four per-parser patches.

6. Defensive notes

7. Further reading

GPIB-style caveats don’t apply here: EtherCAT is genuinely on the wire, and the master is genuinely reachable from any device on the segment.