Skip to content
RCE Advisory Advanced CVE-2019-5161

WAGO PFC200 Cloud Connectivity Remote Code Execution Vulnerability

The Cloud Connectivity service of WAGO PFC200 does not validate the path, file name, or type of files downloaded during a remote firmware update. An attacker with web administrator privileges can configure the service to connect to a malicious Azure IoT Hub and supply an XML file that causes a shell script to be written to a specific location and executed as root.

Kelly Leuschner Follow

Originally disclosed on Cisco Talos

Critical 9.1 View original

An exploitable remote code execution vulnerability exists in the Cloud Connectivity functionality of WAGO PFC200. A specially crafted XML file will direct the Cloud Connectivity service to download and execute a shell script with root privileges.

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

Likely the firmware update process trusts the TargetPath and file type from an XML file without validating them, allowing an attacker to write a script to a fixed hook location that is executed before signature verification.

Impact

An attacker with web administrator privileges could execute arbitrary shell commands as root on the device.

What the attacker needed

Web administrator privileges; attacker-controlled Azure IoT Hub

The fix

The vulnerability could be mitigated by disabling the Cloud Connectivity feature via the web-based management application.

How it was found

  1. Configure the Cloud Connectivity service to connect to an attacker-controlled Azure IoT Hub node.
  2. Provide an XML file with a File Type of 'rauc' and a TargetPath pointing to /tmp/fwupdate/fwupdate_hook.sh.
  3. The service downloads the file from the URL specified in the XML to the TargetPath.
  4. The fwupdate_background_service script finds the hook file, makes it executable, and runs it as root.

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's cloud update feature downloads files from a server and runs a script without checking where the files go or what they are. An attacker who can change the cloud server settings can make the device download a malicious script and run it with the highest permissions.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

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.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.