WAGO PFC200 iocheckd service "I/O-Check" cache Multiple Command Injection Vulnerabilities
The iocheckd service on WAGO PFC200 controllers parses a globally writable XML cache file and passes several of its values to shell commands without sanitisation. An attacker who can write that file could inject OS commands that run as root, leading to privilege escalation.
Originally disclosed on Cisco Talos
An exploitable command injection vulnerability exists in the iocheckd service “I/O-Check” function of the WAGO PFC 200. A specially crafted XML cache file written to a specific location on the device can be used to inject OS commands.
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 builds shell command strings with sprintf() using unsanitised XML node contents and then executes them via system().
Impact
Any local user could escalate to root by writing the cache file and triggering its parsing, and the text notes the service can also be reached over the network.
What the attacker needed
Write access to /tmp on the device; ability to send a BC_SaveParameter message
The fix
The report only offers mitigations: disable the iocheckd service or disable its caching; it does not describe a code fix.
How it was found
- Write a malicious XML file to /tmp/iocheckCache.xml containing command injection in a network parameter.
- Send a BC_SaveParameter message to the iocheckd service to trigger parsing of the cache file.
- The injected commands execute as the root user.
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 background service that reads a settings file stored in a shared temporary folder. That folder is writable by any user, and the service inserts the file's values directly into commands it runs as the administrator account. So anyone who can put a file there can make the device run their own commands with the highest privileges.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.