Skip to content
Memory corruption Advisory Advanced CVE-2019-5074

WAGO PFC200 iocheckd service "I/O-Check" BC_ProductLabel remote code execution vulnerability

The iocheckd service on WAGO PFC200 controllers copies the QS-STRING system value into a 32-byte stack buffer using a 64-byte length, causing a stack buffer overflow. An unauthenticated attacker can send a crafted packet to control the copied data and overwrite the saved return address, leading to remote code execution.

Kelly Leuschner Follow

Originally disclosed on Cisco Talos

Critical 9.8 View original

An exploitable stack 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 stack buffer overflow, resulting in 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 code uses a copy length of 0x40 bytes for a stack buffer that is only 0x20 bytes, so the copy overflows the buffer.

Impact

An unauthenticated attacker could achieve remote code execution on the controller.

What the attacker needed

Network access to the iocheckd service; no authentication required

The fix

The vulnerability should be fixed by disabling the iocheckd service via the web-based management application.

How it was found

  1. Send an unauthenticated iocheckd protocol packet to set the QS-STRING system value to attacker-controlled data.
  2. Send a BC_ProductLabel message to trigger the vulnerable copy of QS-STRING into the stack buffer.
  3. The oversized copy overwrites the saved registers and return address, leading to code execution.

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 stack buffer is a small fixed-size area of memory used to hold temporary data. The program copies more data into it than it can hold, so the extra data spills over and overwrites nearby memory, including the address the program will jump to next. Because an attacker can choose the data that spills over, they can redirect the program to 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.

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.