WAGO PFC200 iocheckd service "I/O-Check" ReadPSN remote code execution vulnerability
The iocheckd service on WAGO PFC200 controllers copies the EEPROM-stored PSN value into a fixed-size heap buffer without checking its length. An unauthenticated attacker who first overwrites the PSN value can then trigger a heap overflow that may lead to arbitrary code execution.
Originally disclosed on Cisco Talos
An exploitable heap buffer overflow vulnerability exists in the iocheckd service “I/O-Check” functionality of WAGO PFC 200. A specially crafted set of packets can cause a heap buffer overflow, potentially resulting in code execution.
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 service uses strcpy to copy an attacker-influenced EEPROM value into a heap buffer of only 0x28 bytes without any length check.
Impact
An attacker could overwrite heap memory and potentially achieve arbitrary code execution on the controller; the report demonstrates a crash rather than a working exploit.
What the attacker needed
Network access to port 6626; no authentication required
The fix
The vulnerability should be fixed by disabling the iocheckd service via the web-based management application, or by bounding the copy to the buffer size.
How it was found
- Send an unauthenticated packet to the iocheckd service on port 6626 to overwrite the PSN value in EEPROM with a long value.
- Send a ReadPSN message so the service copies the oversized PSN value into the 0x28-byte heap buffer.
- The copy overflows into the adjacent heap chunk, and the crash occurs when the destination buffer is freed.
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.
The device runs a small network service that reads a stored text value (the PSN) and copies it into a memory area of fixed size. If the text is longer than that area, it spills into neighbouring memory, which can crash the device or let an attacker run their own code. No login is needed to send these messages.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.