Skip to content
RCE Advisory Intermediate CVE-2021-21866

CODESYS Development System ObjectManager.plugin ProfileInformation.ProfileData Unsafe Deserialization vulnerability

The CODESYS Development System deserialises the ProfileData property of a profile object using .NET BinaryFormatter without validating the input. An attacker who supplies a crafted project file or template containing a malicious profile.auxiliary file could achieve arbitrary command execution when the victim opens it.

Patrick DeSantis Follow

Originally disclosed on Cisco Talos

High 8.8 View original

An unsafe deserialization vulnerability exists in the ObjectManager.plugin ProfileInformation.ProfileData functionality of CODESYS GmbH CODESYS Development System 3.5.16 and 3.5.17. A specially crafted file can lead to arbitrary command execution.

Patrick DeSantis, 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 ProfileData setter passes untrusted bytes straight to BinaryFormatter.Deserialize, which is unsafe for untrusted input.

Impact

An attacker could achieve arbitrary command execution with the privileges of the user who opens the crafted project file.

What the attacker needed

Victim opens a crafted project file; affected CODESYS version installed

How it was found

  1. Create or obtain a project file or project template.
  2. Embed a malicious profile.auxiliary file inside it.
  3. Open the project in the affected CODESYS Development System version.
  4. The profile data is deserialised and the attacker's code runs.

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.

Some programs save data by turning objects into a byte stream and later turning that stream back into objects, a process called deserialisation. If the program trusts whatever bytes it is given, an attacker can craft bytes that make the program build dangerous objects and run their code. Here, opening a project file with a tampered profile section could let an attacker run commands on the victim's machine.

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 Patrick DeSantis

View all

35 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.