WAGO PFC200 iocheckd service "I/O-Check" ReadPCBManuNum remote code execution vulnerability
The iocheckd service on WAGO PFC200 controllers copies an EEPROM value into a fixed-size heap buffer without checking its length. An unauthenticated attacker who can write the WAGONRSTR value could overflow the heap and potentially execute arbitrary code.
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 code copies the EEPROM value for WAGONRSTR into a 0x28-byte heap buffer using strcpy, which performs no length check.
Impact
An attacker could potentially achieve arbitrary code execution on the device, though the report only demonstrates a heap corruption crash.
What the attacker needed
Network access to port 6626; no authentication needed
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 WAGONRSTR value in EEPROM with data longer than the buffer.
- Trigger the ReadPCBManuNum message so the service copies that value into the heap buffer.
- The oversized copy corrupts the adjacent heap chunk and the process aborts when the 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.
A buffer overflow happens when a program copies more data into a fixed-size memory space than it can hold, so the extra data spills into neighbouring memory. Here the controller trusts a stored setting and copies it without checking its length, so a long value can corrupt memory and possibly let an attacker run their own code.
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.