CODESYS Development System Engine.plugin ProfileInformation ProfileData Unsafe Deserialization vulnerability
The CODESYS Development System deserialises untrusted data from the profile.auxiliary file within a project using BinaryFormatter, which is unsafe. An attacker can provide a malicious project file to trigger arbitrary command execution.
Originally disclosed on Cisco Talos
An unsafe deserialization vulnerability exists in the Engine.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.
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 application uses BinaryFormatter.Deserialize on data from the profile.auxiliary file without validating or restricting the types that can be deserialised.
Impact
An attacker could execute arbitrary commands on the victim's machine by convincing them to open a malicious project file.
What the attacker needed
Victim opens a malicious project file
How it was found
- Create a CODESYS project containing a profile.auxiliary file.
- Modify the profile.auxiliary file to contain malicious serialised data.
- Open the project in CODESYS Development System.
- The malicious data is deserialised, 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.
When a program loads a file, it sometimes converts stored data back into objects. If that data is not trusted, an attacker can craft it to make the program run their code. Here, opening a malicious project file in CODESYS could let an attacker run commands on the victim's computer.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.