CyberSecBulletin
CVE-2022-47384NVD status: Analyzed

CODESYS Control RTE (SL): Out-of-bounds Write

CVE-2022-47384 is a high-severity out-of-bounds write vulnerability in CODESYS Control RTE (SL) from Codesys, with a CVSS 3.1 base score of 8.8 out of 10. It can be exploited remotely over the network by an attacker with a low-privileged account, without any action from a user. The record lists version V3.5.19.0 as the first without the flaw, so updating CODESYS Control RTE (SL) to that release or later removes the exposure. There is no confirmed exploitation so far. EPSS estimates a 1.32% chance of exploitation within 30 days, higher than 71% of scored CVEs.

Next patch cycle

High severity with no evidence of exploitation so far.

What to do

  1. Update CODESYS Control RTE (SL) to V3.5.19.0 or a later version.
  2. Update CODESYS Control RTE (for Beckhoff CX) SL to V3.5.19.0 or a later version.
  3. Update CODESYS Control Win (SL) to V3.5.19.0 or a later version.
  4. Read the advisory on customers.codesys.com for workarounds and exact fixed builds.

Affected products and versions

VendorProductAffected versionsFixed in
CODESYSCODESYS Control RTE (SL)V0.0.0.0 up to, but not including, V3.5.19.0V3.5.19.0
CODESYSCODESYS Control RTE (for Beckhoff CX) SLV0.0.0.0 up to, but not including, V3.5.19.0V3.5.19.0
CODESYSCODESYS Control Win (SL)V0.0.0.0 up to, but not including, V3.5.19.0V3.5.19.0
CODESYSCODESYS Control Runtime System ToolkitV0.0.0.0 up to, but not including, V3.5.19.0V3.5.19.0
CODESYSCODESYS Safety SIL2 Runtime ToolkitV0.0.0.0 up to, but not including, V3.5.19.0V3.5.19.0
CODESYSCODESYS Safety SIL2 PSPV0.0.0.0 up to, but not including, V3.5.19.0V3.5.19.0
CODESYSCODESYS HMI (SL)V0.0.0.0 up to, but not including, V3.5.19.0V3.5.19.0
CODESYSCODESYS Development System V3V0.0.0.0 up to, but not including, V3.5.19.0V3.5.19.0
CODESYSCODESYS Control for BeagleBone SLV0.0.0.0 up to, but not including, V4.8.0.0V4.8.0.0
CODESYSCODESYS Control for emPC-A/iMX6 SLV0.0.0.0 up to, but not including, V4.8.0.0V4.8.0.0
CODESYSCODESYS Control for IOT2000 SLV0.0.0.0 up to, but not including, V4.8.0.0V4.8.0.0
CODESYSCODESYS Control for Linux SLV0.0.0.0 up to, but not including, V4.8.0.0V4.8.0.0
CODESYSCODESYS Control for PFC100 SLV0.0.0.0 up to, but not including, V4.8.0.0V4.8.0.0
CODESYSCODESYS Control for PFC200 SLV0.0.0.0 up to, but not including, V4.8.0.0V4.8.0.0
CODESYSCODESYS Control for PLCnext SLV0.0.0.0 up to, but not including, V4.8.0.0V4.8.0.0
CODESYSCODESYS Control for Raspberry Pi SLV0.0.0.0 up to, but not including, V4.8.0.0V4.8.0.0
CODESYSCODESYS Control for WAGO Touch Panels 600 SLV0.0.0.0 up to, but not including, V4.8.0.0V4.8.0.0
CodesysControl For Beaglebone Slbefore 4.8.0.04.8.0.0
CodesysControl For Empc-a/imx6 Slbefore 4.8.0.04.8.0.0
CodesysControl For Iot2000 Slbefore 4.8.0.04.8.0.0
CodesysControl For Linux Slbefore 4.8.0.04.8.0.0
CodesysControl For Pfc100 Slbefore 4.8.0.04.8.0.0
CodesysControl For Pfc200 Slbefore 4.8.0.04.8.0.0
CodesysControl For Plcnext Slbefore 4.8.0.04.8.0.0
CodesysControl For Raspberry Pi Slbefore 4.8.0.04.8.0.0

Version data comes from the organisation that assigned the CVE; 9 further products are omitted here. Confirm against the vendor advisory before deciding you are unaffected.

How the severity score breaks down

Attack vector
NetworkCan be exploited remotely over a network, including the internet.
Attack complexity
LowNo special conditions are needed; the attack works reliably.
Privileges required
LowA basic user account is enough.
User interaction
NoneNo action by a victim is required.
Scope
UnchangedImpact stays within the vulnerable component.
Confidentiality
HighAll data handled by the component can be read.
Integrity
HighData or code can be modified at will.
Availability
HighThe component can be taken down completely.

Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H. Scored by CNA (cert.vde.com).

Official description

An authenticated remote attacker may use a stack based out-of-bounds write vulnerability in the CmpTraceMgr Component of multiple CODESYS products in multiple versions to write data into the stack which can lead to a denial-of-service condition, memory overwriting, or remote code execution.

Source: the CVE record as published by its numbering authority, via NVD and CVE.org.

The underlying weakness: Out-of-bounds Write

The product writes data past the end, or before the beginning, of the intended buffer.

How developers prevent this class of flaw

  • Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. For example, many languages that perform their own memory management, such as Java and Perl, are not subject to buffer overflows. Other languages, such as Ada and C#, typically provide overflow protection, but the protection can be disabled by the programmer. Be wary that a language's interface to native code may still be subject to overflows, even if the language itself is theoretically safe.
  • Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. Examples include the Safe C String Library (SafeStr) by Messier and Viega, and the Strsafe.h library from Microsoft. These libraries provide safer versions of overflow-prone string-handling functions.
  • Use automatic buffer overflow detection mechanisms that are offered by certain compilers or compiler extensions. Examples include: the Microsoft Visual Studio /GS flag, Fedora/Red Hat FORTIFY_SOURCE GCC flag, StackGuard, and ProPolice, which provide various mechanisms including canary-based detection and range/index checking. D3-SFCV (Stack Frame Canary Validation) from D3FEND discusses canary-based detection in detail.

More Out-of-bounds Write vulnerabilities (CWE-787)

Timeline

  1. CVE record published.
  2. CISA published its SSVC assessment (exploitation: none, automatable: no, technical impact: total).
  3. Record last changed materially (score, affected products, status or references).

References

Other vulnerabilities in CODESYS Control RTE (SL)

All CODESYS Control RTE (SL) vulnerabilities

Recent Out-of-bounds Write vulnerabilities

Spotted an error? Tell us.