Skip to content
Memory corruption Advisory Advanced CVE-2019-5185CVE-2019-5186

WAGO PFC200 iocheckd service "I/O-Check" cache Multiple Memory Corruption Vulnerabilities

The iocheckd service on WAGO PFC200 controllers parses a globally writable XML cache file and copies node values into fixed-size stack buffers without bounds checking, causing stack buffer overflows. An attacker who can write the cache file can crash the service, denying network configuration changes, and potentially achieve code execution depending on compiler and optimisation settings.

Kelly Leuschner Follow

Originally disclosed on Cisco Talos

High 7.0 View original

An exploitable stack buffer overflow vulnerability vulnerability exists in the iocheckd service “I/O-Check” functionality of WAGO PFC 200. A specially crafted xml cache file written to a specific location on the device can cause a stack buffer overflow, resulting in a denial of service and potentially code execution.

Kelly Leuschner, on Cisco Talos

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 sprintf and strcpy to copy XML node contents into fixed-size stack buffers without checking input length, and adjacent buffers lack null termination after overflow.

Impact

Exploitation causes a denial of service for several iocheckd messages, preventing network configuration changes, and could potentially lead to code execution depending on compiler and optimisation level.

What the attacker needed

Write access to /tmp/iocheckCache.xml; ability to send iocheckd messages

The fix

The vulnerability should be fixed by disabling the iocheckd service or its caching, or by adding bounds checking to the buffer copies.

How it was found

  1. Write a malicious XML file to /tmp/iocheckCache.xml with an oversized value in a node such as state or interface.
  2. Send a BC_SaveParameter message to the iocheckd service to trigger parsing of the cache file.
  3. The service overflows a stack buffer and crashes, causing subsequent configuration messages to fail.

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 program on the device reads a settings file that any user can write to. It copies text from that file into a small fixed-size space in memory without checking length, so long text spills over and crashes the program. This stops the device from applying network settings until it is rebooted.

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.

More by Kelly Leuschner

View all

32 more disclosed reports, best first.

More from Cisco Talos

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.