CVE-2023-3670

7.3 HIGH

📋 TL;DR

CVE-2023-3670 is a local privilege escalation vulnerability in CODESYS Development System and CODESYS Scripting where insecure directory permissions allow attackers with local workstation access to place malicious scripts that could be executed by legitimate users. This affects organizations using CODESYS for industrial automation and control systems programming.

💻 Affected Systems

Products:
  • CODESYS Development System
  • CODESYS Scripting
Versions: CODESYS Development System 3.5.9.0 to 3.5.17.0, CODESYS Scripting 4.0.0.0 to 4.1.0.0
Operating Systems: Windows, Linux
Default Config Vulnerable: ⚠️ Yes
Notes: Affects default installations where directory permissions are not hardened. Requires local access to the workstation.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

An attacker gains full control of the CODESYS development environment, potentially compromising industrial control systems by executing arbitrary code with legitimate user privileges, leading to production disruption or safety incidents.

🟠

Likely Case

Local attackers plant disguised scripts that get executed by legitimate users, leading to data theft, malware installation, or lateral movement within the industrial network.

🟢

If Mitigated

With proper access controls and monitoring, impact is limited to isolated workstations without affecting production systems.

🌐 Internet-Facing: LOW - This requires local access to the workstation, not directly exploitable over the internet.
🏢 Internal Only: HIGH - Attackers with local network access or physical access to workstations can exploit this vulnerability.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires local access to the workstation and knowledge of directory structure. No authentication bypass needed once local access is obtained.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: CODESYS Development System 3.5.18.0 and later, CODESYS Scripting 4.2.0.0 and later

Vendor Advisory: https://cert.vde.com/en/advisories/VDE-2023-024

Restart Required: Yes

Instructions:

1. Download latest version from CODESYS website. 2. Backup current installation. 3. Run installer with administrative privileges. 4. Restart workstation after installation completes.

🔧 Temporary Workarounds

Restrict directory permissions

all

Manually secure CODESYS installation directories to prevent unauthorized write access

Windows: icacls "C:\Program Files\CODESYS\" /inheritance:r /grant:r "Users:(OI)(CI)RX" /grant:r "Administrators:(OI)(CI)F"
Linux: chmod 755 /opt/codesys/ && chown root:root /opt/codesys/

Application whitelisting

all

Implement application control to prevent execution of unauthorized scripts

Windows: Configure AppLocker or Windows Defender Application Control policies
Linux: Configure SELinux/AppArmor policies for CODESYS

🧯 If You Can't Patch

  • Implement strict access controls on CODESYS workstations to prevent unauthorized local access
  • Monitor CODESYS directories for unauthorized file modifications using file integrity monitoring

🔍 How to Verify

Check if Vulnerable:

Check CODESYS version in Help > About menu. If Development System is between 3.5.9.0-3.5.17.0 or Scripting is between 4.0.0.0-4.1.0.0, system is vulnerable.

Check Version:

Windows: reg query "HKLM\SOFTWARE\CODESYS\" /v Version | Linux: dpkg -l | grep codesys || rpm -qa | grep codesys

Verify Fix Applied:

Verify version is 3.5.18.0+ for Development System or 4.2.0.0+ for Scripting. Check directory permissions on CODESYS installation folders.

📡 Detection & Monitoring

Log Indicators:

  • Unauthorized file creation in CODESYS directories
  • Unexpected script execution from CODESYS folders
  • Permission changes on CODESYS installation directories

Network Indicators:

  • Unusual outbound connections from CODESYS workstations
  • Lateral movement attempts from CODESYS systems

SIEM Query:

source="windows-security" EventID=4663 ObjectName="*CODESYS*" AccessMask="0x2" OR source="sysmon" EventID=11 TargetFilename="*CODESYS*"

🔗 References

📤 Share & Export