Socomec DIRIS Digiware M-70 Modbus TCP buffer overflow vulnerability
The Modbus TCP server on the device mishandles the length field in incoming packets, so a crafted sequence of packets overflows a fixed-size receive buffer and corrupts adjacent memory. An unauthenticated attacker can send three packets in one TCP session to corrupt a linked-list pointer and crash the device, causing a denial of service.
Originally disclosed on Cisco Talos
A buffer overflow vulnerability exists in the Modbus TCP functionality of Socomec DIRIS Digiware M-70 1.6.9. A specially crafted set of network packets can lead to denial of service.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The length check compares the packet length against the received size, but the code then adds 6 to that length and uses it as the copy size into a smaller 256-byte destination buffer, so the check does not bound the copy.
Impact
The corrupted pointer causes the device to crash and reboot, giving a denial of service; the text does not claim code execution.
What the attacker needed
Network access to port 502; no authentication needed
The fix
The length check should account for the added 6 bytes and the smaller destination buffer; the vendor released a patch and advises disabling Modbus over Ethernet as a mitigation.
How it was found
- Open a TCP session to the Modbus TCP server on port 502.
- Send a first packet whose length field passes the check but overflows the destination buffer, overwriting the next object's pointer.
- Send a second packet so the server fetches the next list object and writes data into its buffer.
- Send a third packet so the server follows the partially attacker-controlled pointer and attempts a write, which fails and crashes the device.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
This device listens for Modbus, an industrial protocol used to read meters and sensors. It trusts a length number in each message but then adds six to it before copying data into a fixed-size buffer, so slightly oversized messages spill into memory next to the buffer. By sending a few messages in a row, an attacker can corrupt a pointer the device later follows, which makes it crash and restart.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.