CVE-2022-47389

8.8 HIGH

📋 TL;DR

This vulnerability allows authenticated remote attackers to exploit a stack-based out-of-bounds write in the CmpTraceMgr component of CODESYS products. Successful exploitation could lead to denial-of-service, memory corruption, or remote code execution. Organizations using affected CODESYS industrial automation software are at risk.

💻 Affected Systems

Products:
  • CODESYS Control runtime systems
  • CODESYS Development System
  • CODESYS Gateway
Versions: Multiple versions prior to V3.5.19.0
Operating Systems: Windows, Linux, Various real-time operating systems
Default Config Vulnerable: ⚠️ Yes
Notes: Affects CODESYS products with CmpTraceMgr component enabled. Industrial control systems using CODESYS for PLC programming and runtime are vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution with full system compromise, allowing attackers to take control of industrial control systems.

🟠

Likely Case

Denial-of-service conditions disrupting industrial operations, with potential for memory corruption leading to system instability.

🟢

If Mitigated

Limited impact if proper network segmentation and authentication controls prevent attacker access to vulnerable systems.

🌐 Internet-Facing: HIGH - If exposed to internet, attackers could exploit authenticated access to compromise systems.
🏢 Internal Only: MEDIUM - Requires authenticated access, but internal threats or compromised credentials could still lead to exploitation.

🎯 Exploit Status

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

Requires authenticated access. Stack-based buffer overflow exploitation typically requires specific knowledge of memory layout and control flow.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: V3.5.19.0 and later

Vendor Advisory: https://customers.codesys.com/index.php?eID=dumpFile&t=f&f=17554&token=5444f53b4c90fe37043671a100dffa75305d1825&download=

Restart Required: Yes

Instructions:

1. Download latest CODESYS version from official vendor portal. 2. Backup existing configurations. 3. Install update following vendor documentation. 4. Restart affected systems. 5. Verify functionality post-update.

🔧 Temporary Workarounds

Disable CmpTraceMgr component

all

Remove or disable the vulnerable component if not required for operations

Consult CODESYS documentation for component-specific disable procedures

Network segmentation

all

Isolate CODESYS systems from untrusted networks

Implement firewall rules to restrict access to CODESYS ports (typically 1217, 2455)

🧯 If You Can't Patch

  • Implement strict network segmentation to isolate CODESYS systems from general network traffic
  • Enforce strong authentication mechanisms and monitor for suspicious authentication attempts

🔍 How to Verify

Check if Vulnerable:

Check CODESYS version in Control Panel or via CODESYS Development System. Versions below V3.5.19.0 are vulnerable.

Check Version:

In CODESYS Development: Help → About CODESYS. On runtime systems: Check system properties or vendor-specific version commands.

Verify Fix Applied:

Verify installed version is V3.5.19.0 or later through CODESYS about dialog or version check commands.

📡 Detection & Monitoring

Log Indicators:

  • Unusual authentication attempts to CODESYS services
  • CmpTraceMgr component errors or crashes
  • Memory access violation logs

Network Indicators:

  • Traffic to CODESYS ports (1217, 2455) from unexpected sources
  • Patterns suggesting buffer overflow attempts

SIEM Query:

source="codesys" AND (event_type="authentication" OR event_type="crash") | stats count by src_ip

🔗 References

📤 Share & Export