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 that EEPROM value can overflow the buffer 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 ReadPCBManuNum handler calls strcpy into a 0x28-byte heap buffer using the attacker-writable WAGONRSTR EEPROM value as the source, with no length check.
Impact
An attacker could overwrite heap memory and potentially achieve arbitrary code execution; the report demonstrates only a crash, not a working exploit.
What the attacker needed
Network access to port 6626; no authentication required
The fix
The vulnerability could be mitigated by disabling the iocheckd service via the web-based management application.
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 EEPROM value into the fixed-size heap buffer.
- The oversized copy overflows the 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 value and copies it without checking its length, so someone who can change that value can corrupt memory and possibly run their own code on the device.
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.