CVE-2022-32142

8.1 HIGH

📋 TL;DR

CVE-2022-32142 is an out-of-bounds read/write vulnerability in multiple CODESYS products that allows low-privileged remote attackers to cause denial-of-service or potentially modify local files without user interaction. This affects industrial control systems using vulnerable CODESYS software versions.

💻 Affected Systems

Products:
  • CODESYS Control runtime systems
  • CODESYS Development System
  • CODESYS Gateway
Versions: Multiple versions prior to specific patches (exact ranges depend on product - see vendor advisory)
Operating Systems: Windows, Linux, Various real-time operating systems
Default Config Vulnerable: ⚠️ Yes
Notes: Affects CODESYS V3 products with network access enabled. Industrial control systems in manufacturing, energy, and infrastructure sectors are particularly at risk.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote attacker gains ability to overwrite local files, potentially leading to system compromise, data manipulation, or persistent backdoor installation in industrial control environments.

🟠

Likely Case

Denial-of-service conditions disrupting industrial operations, with potential for limited file modification in specific configurations.

🟢

If Mitigated

Isolated network segments and proper access controls limit impact to availability issues within affected control systems.

🌐 Internet-Facing: HIGH - Remote exploitation without authentication makes internet-facing systems extremely vulnerable.
🏢 Internal Only: MEDIUM - Internal attackers or malware could exploit this, but network segmentation reduces exposure.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Remote exploitation requires network access but no authentication. The vulnerability is in protocol handling, making exploitation relatively straightforward for attackers with network access.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Varies by product - see CODESYS Security Advisory for specific version mappings

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

Restart Required: Yes

Instructions:

1. Review CODESYS Security Advisory for affected products. 2. Download appropriate patches from CODESYS customer portal. 3. Apply patches following vendor instructions. 4. Restart affected systems. 5. Verify patch installation.

🔧 Temporary Workarounds

Network Segmentation

all

Isolate CODESYS systems from untrusted networks using firewalls and VLANs

Access Control Lists

all

Restrict network access to CODESYS services to authorized IP addresses only

# Example firewall rule (Linux iptables): iptables -A INPUT -p tcp --dport 1217 -s trusted_ip_range -j ACCEPT
# Windows Firewall: New-NetFirewallRule -DisplayName "CODESYS Restrict" -Direction Inbound -Protocol TCP -LocalPort 1217 -RemoteAddress trusted_ip_range -Action Allow

🧯 If You Can't Patch

  • Implement strict network segmentation to isolate CODESYS systems from untrusted networks
  • Deploy intrusion detection systems monitoring for anomalous CODESYS protocol traffic

🔍 How to Verify

Check if Vulnerable:

Check CODESYS version against affected versions in vendor advisory. For runtime systems: Check version in CODESYS Control System Manager or via CODESYS CLI tools.

Check Version:

# CODESYS Control CLI: codesyscontrol --version
# Or check via CODESYS Development System: Project -> Device -> Online -> Device Info

Verify Fix Applied:

Verify installed version matches patched versions listed in CODESYS Security Advisory. Check that patch installation was successful in system logs.

📡 Detection & Monitoring

Log Indicators:

  • Unexpected CODESYS service restarts
  • Memory access violation errors in CODESYS logs
  • Anomalous network connections to CODESYS ports (typically 1217, 1218)

Network Indicators:

  • Malformed CODESYS protocol packets
  • Unexpected traffic to CODESYS ports from unauthorized sources
  • Protocol anomalies in CODESYS CMP communication

SIEM Query:

source="*codesys*" AND (event_type="crash" OR event_type="memory_violation" OR event_type="service_restart")

🔗 References

📤 Share & Export