CVE-2023-3662
📋 TL;DR
This vulnerability in CODESYS Development System allows attackers to execute arbitrary binaries from the current working directory with the user's privileges. It affects users running vulnerable versions of CODESYS Development System, potentially leading to unauthorized code execution.
💻 Affected Systems
- CODESYS Development System
📦 What is this software?
⚠️ Risk & Real-World Impact
Worst Case
Full system compromise through remote code execution leading to data theft, ransomware deployment, or lateral movement within the network.
Likely Case
Local privilege escalation or execution of malicious payloads when users open malicious projects or files.
If Mitigated
Limited impact if proper file permissions and user account controls restrict binary execution.
🎯 Exploit Status
Exploitation requires user interaction such as opening a malicious project file or navigating to a compromised directory.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 3.5.19.20
Vendor Advisory: https://cert.vde.com/en/advisories/VDE-2023-021/
Restart Required: Yes
Instructions:
1. Download CODESYS Development System version 3.5.19.20 or later from the official CODESYS website. 2. Run the installer and follow the upgrade process. 3. Restart the system after installation completes.
🔧 Temporary Workarounds
Restrict directory permissions
allLimit write and execute permissions on directories where CODESYS projects are stored to prevent unauthorized binary placement.
chmod 755 /path/to/codesys/projects (Linux)
icacls "C:\path\to\codesys\projects" /deny Everyone:(OI)(CI)(W) (Windows)
Use least privilege accounts
allRun CODESYS Development System with non-administrative user accounts to limit potential damage from exploitation.
🧯 If You Can't Patch
- Monitor for suspicious binary execution from CODESYS working directories using endpoint detection tools.
- Implement application allowlisting to prevent execution of unauthorized binaries from CODESYS directories.
🔍 How to Verify
Check if Vulnerable:
Check CODESYS Development System version in Help > About menu. If version is between 3.5.17.0 and 3.5.19.20 (exclusive), the system is vulnerable.
Check Version:
codesys --version (Linux) or check Help > About in GUI (Windows)
Verify Fix Applied:
Verify version is 3.5.19.20 or higher in Help > About menu.
📡 Detection & Monitoring
Log Indicators:
- Unexpected binary execution from CODESYS working directories
- Process creation events from CODESYS.exe with unusual parent processes
Network Indicators:
- Outbound connections from CODESYS process to unexpected destinations
SIEM Query:
ProcessName="codesys.exe" AND (CommandLine="*.exe" OR ParentProcess!="explorer.exe")