-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

===========================================================================
             AUSCERT External Security Bulletin Redistribution

                               ESB-2021.2215
        Advisories (icsa-21-173-02, icsa-21-173-03, icsa-21-173-04)
                CODESYS Control V2 product vulnerabilities
                               23 June 2021

===========================================================================

        AusCERT Security Bulletin Summary
        ---------------------------------

Product:           CODESYS V2 web server
                   CODESYS Control V2 communication
                   CODESYS Control V2 Linux SysFile library
Publisher:         ICS-CERT
Operating System:  Windows
                   Linux variants
Impact/Access:     Execute Arbitrary Code/Commands -- Remote/Unauthenticated
                   Create Arbitrary Files          -- Remote/Unauthenticated
                   Denial of Service               -- Remote/Unauthenticated
                   Access Confidential Data        -- Remote/Unauthenticated
                   Unauthorised Access             -- Remote/Unauthenticated
Resolution:        Patch/Upgrade
CVE Names:         CVE-2021-30195 CVE-2021-30194 CVE-2021-30193
                   CVE-2021-30192 CVE-2021-30191 CVE-2021-30190
                   CVE-2021-30189 CVE-2021-30188 CVE-2021-30187
                   CVE-2021-30186  

Original Bulletin: 
   https://us-cert.cisa.gov/ics/advisories/icsa-21-173-02
   https://us-cert.cisa.gov/ics/advisories/icsa-21-173-03
   https://us-cert.cisa.gov/ics/advisories/icsa-21-173-04

Comment: This bulletin contains three (3) ICS-CERT security advisories.

- --------------------------BEGIN INCLUDED TEXT--------------------

ICS Advisory (ICSA-21-173-02)

CODESYS V2 web server

Original release date: June 22, 2021

Legal Notice

All information products included in https://us-cert.cisa.gov/ics are provided
"as is" for informational purposes only. The Department of Homeland Security
(DHS) does not provide any warranties of any kind regarding any information
contained within. DHS does not endorse any commercial product or service,
referenced in this product or otherwise. Further dissemination of this product
is governed by the Traffic Light Protocol (TLP) marking in the header. For more
information about TLP, see https://us-cert.cisa.gov/tlp/ .



1. EXECUTIVE SUMMARY

  o CVSS v3 9.8
  o ATTENTION: Exploitable remotely/low attack complexity
  o Vendor: CODESYS, GmbH
  o Equipment: CODESYS V2 web server
  o Vulnerabilities: Stack-based Buffer Overflow, Improper Access Control,
    Buffer Copy without Checking Size of Input, Improperly Implemented Security
    Check, Out-of-bounds Write, Out-of-bounds Read

2. RISK EVALUATION

Successful exploitation of these vulnerabilities may allow an attacker to read
or write arbitrary memory or files in the CODESYS Control runtime system, cause
invalid memory accesses to execute code, or crash the CODESYS web server or
CODESYS Control runtime system.

3. TECHNICAL DETAILS

3.1 AFFECTED PRODUCTS

CODESYS reports all CODESYS V2 web servers running stand-alone or as part of
the CODESYS runtime system prior to Version 1.1.9.20 are affected.

3.2 VULNERABILITY OVERVIEW

3.2.1 STACK-BASED BUFFER OVERFLOW CWE-121

Crafted web server requests may cause a stack-based buffer overflow. This could
allow an attacker to execute arbitrary code on the CODESYS web server or
trigger a denial-of-service condition due to a crash in the CODESYS web server.

CVE-2021-30189 has been assigned to this vulnerability. A CVSS v3 base score of
9.8 has been calculated; the CVSS vector string is ( AV:N/AC:L/PR:N/UI:N/S:U/
C:H/I:H/A:H ).

3.2.2 IMPROPER ACCESS CONTROL CWE-284

The user management of the CODESYS v2.3 WebVisu allows user dependent control
of access to the visualization pages. However, subordinate requests to read or
write values are forwarded to the CODESYS Control runtime system regardless of
successful authentication. This enables crafted web server requests to bypass
user management and read or write values on the PLC without authentication.

CVE-2021-30190 has been assigned to this vulnerability. A CVSS v3 base score of
9.8 has been calculated; the CVSS vector string is ( AV:N/AC:L/PR:N/UI:N/S:U/
C:H/I:H/A:H ).

3.2.3 CLASSIC BUFFER OVERFLOW CWE-120

Crafted web server requests can cause an over-read or over-write of a buffer in
the CODESYS web server, which typically leads to a denial-of-service condition.

CVE-2021-30191 has been assigned to this vulnerability. A CVSS v3 base score of
7.5 has been calculated; the CVSS vector string is ( AV:N/AC:L/PR:N/UI:N/S:U/
C:N/I:N/A:H ).

3.2.4 IMPROPERLY IMPLEMENTED SECURITY CHECK CWE-358

Crafted web server requests can bypass the security checks for boot
project-related files on the CODESYS Control runtime system and be uploaded
from the CODESYS Control runtime system.

CVE-2021-30192 has been assigned to this vulnerability. A CVSS v3 base score of
9.8 has been calculated; the CVSS vector string is ( AV:N/AC:L/PR:N/UI:N/S:U/
C:H/I:H/A:H ).

3.2.5 OUT-OF-BOUNDS WRITE CWE-787

Crafted web server requests can be utilized to write arbitrary memory in the
CODESYS Control runtime system. This could allow an attacker to execute code on
the CODESYS Control runtime system or cause a denial-of-service condition due
to a crash of the CODESYS Control runtime system.

CVE-2021-30193 has been assigned to this vulnerability. A CVSS v3 base score of
9.8 has been calculated; the CVSS vector string is ( AV:N/AC:L/PR:N/UI:N/S:U/
C:H/I:H/A:H ).

3.2.6 OUT-OF-BOUNDS READ CWE-125

Crafted web server requests can be utilized to read arbitrary memory in the
CODESYS Control runtime system or crash the CODESYS web server.

CVE-2021-30194 has been assigned to this vulnerability. A CVSS v3 base score of
9.1 has been calculated; the CVSS vector string is ( AV:N/AC:L/PR:N/UI:N/S:U/
C:H/I:N/A:H ).

3.3 BACKGROUND

  o CRITICAL INFRASTRUCTURE SECTORS: Critical Manufacturing
  o COUNTRIES/AREAS DEPLOYED: Worldwide
  o COMPANY HEADQUARTERS LOCATION: Germany

3.4 RESEARCHER

Vyacheslav Moskvin, Sergey Fedonin, and Anton Dorfman of Positive Technologies
reported these vulnerabilities to CODESYS.

4. MITIGATIONS

CODESYS GmbH has released Version 1.1.9.20 of the CODESYS V2 web server to
address these vulnerabilities. This version of the CODESYS V2 web server is
also part of the CODESYS Development System setup Version 2.3.9.66

Please visit the CODESYS update area for more information on how to obtain the
software updates.

As part of a security strategy, CODESYS recommends the following general
defense measures to reduce the risk of exploits:

  o Use controllers and devices only in a protected environment to minimize
    network exposure, ensuring they are not accessible from outside.
  o Use firewalls to protect and separate the control system network from other
    networks.
  o Use VPN (virtual private network) tunnels if remote access is required.
  o Activate and apply user management and password features.
  o Use encrypted communication links.
  o Limit access to both development and control system by physical means,
    operating system features, etc.
  o Protect both development and control system operations by using up to date
    virus detecting solutions.

For more information and general recommendations for protecting machines and
plants, see also the CODESYS Security Whitepaper .

Please see CODESYS Advisory 2021-07 for more information.

CISA recommends users take defensive measures to minimize the risk of
exploitation of these vulnerabilities. CISA reminds organizations to perform
proper impact analysis and risk assessment prior to deploying defensive
measures.

CISA also provides a section for control systems security recommended practices
on the ICS webpage on us-cert.cisa.gov . Several recommended practices are
available for reading and download, including Improving Industrial Control
Systems Cybersecurity with Defense-in-Depth Strategies .

Additional mitigation guidance and recommended practices are publicly available
on the ICS webpage on us-cert.cisa.gov in the Technical Information Paper,
ICS-TIP-12-146-01B--Targeted Cyber Intrusion Detection and Mitigation
Strategies .

Organizations observing any suspected malicious activity should follow their
established internal procedures and report their findings to CISA for tracking
and correlation against other incidents.

No known public exploits specifically target these vulnerabilities.

For any questions related to this report, please contact the CISA at:

Email: CISAservicedesk@cisa.dhs.gov
Toll Free: 1-888-282-0870

CISA continuously strives to improve its products and services. You can help by
choosing one of the links below to provide feedback about this product.

- --------------------------------------------------------------------------------

ICS Advisory (ICSA-21-173-03)

CODESYS Control V2 communication

Original release date: June 22, 2021

Legal Notice

All information products included in https://us-cert.cisa.gov/ics are provided
"as is" for informational purposes only. The Department of Homeland Security
(DHS) does not provide any warranties of any kind regarding any information
contained within. DHS does not endorse any commercial product or service,
referenced in this product or otherwise. Further dissemination of this product
is governed by the Traffic Light Protocol (TLP) marking in the header. For more
information about TLP, see https://us-cert.cisa.gov/tlp/ .



1. EXECUTIVE SUMMARY

  o CVSS v3 9.8
  o ATTENTION: Exploitable remotely/low attack complexity
  o Vendor: CODESYS, GmbH
  o Equipment: CODESYS V2 Runtime Toolkit, CODESYS PLCWinNT
  o Vulnerabilities: Stack-based Buffer Overflow, Heap-based Buffer Overflow,
    Improper Input Validation

2. RISK EVALUATION

Successful exploitation of these vulnerabilities may cause a heap-based buffer
overflow, a stack-based buffer overflow, or a buffer over-read in the affected
CODESYS products. This could result in a denial-of-service condition or allow
remote code execution.

3. TECHNICAL DETAILS

3.1 AFFECTED PRODUCTS

CODESYS reports the following CODESYS V2 runtime systems are affected,
regardless of the CPU type or operating system:

  o CODESYS Runtime Toolkit 32-bit full prior to v2.4.7.55
  o CODESYS PLCWinNT prior to v2.4.7.55

3.2 VULNERABILITY OVERVIEW

3.2.1 HEAP-BASED BUFFER OVERFLOW CWE-122

A crafted request may cause a heap-based buffer overflow in the affected
CODESYS products, resulting in a denial-of-service condition.

CVE-2021-30186 has been assigned to this vulnerability. A CVSS v3 base score of
7.5 has been calculated; the CVSS vector string is ( AV:N/AC:L/PR:N/UI:N/S:U/
C:N/I:N/A:H ).

3.2.2 STACK-BASED BUFFER OVERFLOW CWE-121

A crafted request may cause a stack-based buffer overflow in the affected
CODESYS products, resulting in a denial-of-service condition or remote code
execution.

CVE-2021-30188 has been assigned to this vulnerability. A CVSS v3 base score of
9.8 has been calculated; the CVSS vector string is ( AV:N/AC:L/PR:N/UI:N/S:U/
C:H/I:H/A:H ).

3.2.3 IMPROPER INPUT VALIDATION CWE-20

A crafted request may cause a buffer over-read in the affected CODESYS
products, resulting in a denial-of-service condition.

CVE-2021-30195 has been assigned to this vulnerability. A CVSS v3 base score of
7.5 has been calculated; the CVSS vector string is ( AV:N/AC:L/PR:N/UI:N/S:U/
C:N/I:N/A:H ).

3.3 BACKGROUND

  o CRITICAL INFRASTRUCTURE SECTORS: Critical Manufacturing
  o COUNTRIES/AREAS DEPLOYED: Worldwide
  o COMPANY HEADQUARTERS LOCATION: Germany

3.4 RESEARCHER

Sergey Fedonin, Denis Goryushev, and Anton Dorfman of Positive Technologies;
and Yossi Reuven of SCADAfence independently reported these vulnerabilities to
CODESYS.

4. MITIGATIONS

CODESYS GmbH has released the following product versions to solve the noted
vulnerability issues for the affected CODESYS products:

  o CODESYS Runtime Toolkit 32-bit full v2.4.7.55
  o CODESYS PLCWinNT v2.4.7.55. This will also be part of the CODESYS
    Development System setup v2.3.9.66

Please visit the CODESYS update area for more information on how to obtain the
software updates.

As part of a security strategy, CODESYS recommends the following general
defense measures to reduce the risk of exploits:

  o Use controllers and devices only in a protected environment to minimize
    network exposure, ensuring they are not accessible from outside.
  o Use firewalls to protect and separate the control system network from other
    networks.
  o Use VPN (virtual private network) tunnels if remote access is required.
  o Activate and apply user management and password features.
  o Use encrypted communication links.
  o Limit access to both development and control system by physical means,
    operating system features, etc.
  o Protect both development and control system operations by using up to date
    virus detecting solutions.

For more information and general recommendations for protecting machines and
plants, see also the CODESYS Security Whitepaper .

Please see CODESYS Advisory 2021-06 for more information.

CISA recommends users take defensive measures to minimize the risk of
exploitation of these vulnerabilities. CISA reminds organizations to perform
proper impact analysis and risk assessment prior to deploying defensive
measures.

CISA also provides a section for control systems security recommended practices
on the ICS webpage on us-cert.cisa.gov . Several recommended practices are
available for reading and download, including Improving Industrial Control
Systems Cybersecurity with Defense-in-Depth Strategies .

Additional mitigation guidance and recommended practices are publicly available
on the ICS webpage on us-cert.cisa.gov in the Technical Information Paper,
ICS-TIP-12-146-01B--Targeted Cyber Intrusion Detection and Mitigation
Strategies .

Organizations observing any suspected malicious activity should follow their
established internal procedures and report their findings to CISA for tracking
and correlation against other incidents.

No known public exploits specifically target these vulnerabilities.

For any questions related to this report, please contact the CISA at:

Email: CISAservicedesk@cisa.dhs.gov
Toll Free: 1-888-282-0870

CISA continuously strives to improve its products and services. You can help by
choosing one of the links below to provide feedback about this product.

- --------------------------------------------------------------------------------

ICS Advisory (ICSA-21-173-04)

CODESYS Control V2 Linux SysFile library

Original release date: June 22, 2021

Legal Notice

All information products included in https://us-cert.cisa.gov/ics are provided
"as is" for informational purposes only. The Department of Homeland Security
(DHS) does not provide any warranties of any kind regarding any information
contained within. DHS does not endorse any commercial product or service,
referenced in this product or otherwise. Further dissemination of this product
is governed by the Traffic Light Protocol (TLP) marking in the header. For more
information about TLP, see https://us-cert.cisa.gov/tlp/ .



1. EXECUTIVE SUMMARY

  o CVSS v3 5.3
  o ATTENTION: Exploitable remotely/low attack complexity
  o Vendor: CODESYS, GmbH
  o Equipment: CODESYS V2 Runtime Toolkit
  o Vulnerability: OS Command Injection

2. RISK EVALUATION

Successful exploitation of this vulnerability may allow the control programmer
to call additional OS functions from the PLC logic utilizing the SysFile system
library.

3. TECHNICAL DETAILS

3.1 AFFECTED PRODUCTS

CODESYS reports all runtime systems for Linux based on a CODESYS V2 Runtime
Toolkit 32-bit full prior Version 2.4.7.55 are affected.

3.2 VULNERABILITY OVERVIEW

3.2.1 OS COMMAND INJECTION CWE-78

The CODESYS Control runtime system enables embedded or PC-based devices to
operate as programmable industrial controllers. Control programs can access
local or remote input/output (I/O) locations, communication interfaces such as
serial ports or sockets, and local system functions such as the file system,
real-time clock, and other OS functions. An attacker could exploit this
vulnerability to call additional OS functions via the SysFile system library.

CVE-2021-30187 has been assigned to this vulnerability. A CVSS v3 base score of
5.3 has been calculated; the CVSS vector string is ( AV:L/AC:L/PR:L/UI:N/S:U/
C:L/I:L/A:L ).

3.3 BACKGROUND

  o CRITICAL INFRASTRUCTURE SECTORS: Critical Manufacturing
  o COUNTRIES/AREAS DEPLOYED: Worldwide
  o COMPANY HEADQUARTERS LOCATION: Germany

3.4 RESEARCHER

Sergey Fedonin and Ivan Kurnak, of Positive Technologies reported this
vulnerability to CODESYS.

4. MITIGATIONS

CODESYS GmbH has released CODESYS Runtime Toolkit 32-bit full Version 2.4.7.55
to solve the noted vulnerability issue for the affected CODESYS products.

Please visit the CODESYS update area for more information on how to obtain
software updates.

As part of a security strategy, CODESYS recommends the following general
defense measures to reduce the risk of exploits:

  o Use controllers and devices only in a protected environment to minimize
    network exposure, ensuring they are not accessible from outside.
  o Use firewalls to protect and separate the control system network from other
    networks.
  o Use VPN (virtual private network) tunnels if remote access is required.
  o Activate and apply user management and password features.
  o Use encrypted communication links.
  o Limit access to both development and control system by physical means,
    operating system features, etc.
  o Protect both development and control system operations by using up to date
    virus detecting solutions.

For more information and general recommendations for protecting machines and
plants, see also the CODESYS Security Whitepaper .

Please see CODESYS Advisory 2021-08 for more information.

CISA recommends users take defensive measures to minimize the risk of
exploitation of this vulnerability. CISA reminds organizations to perform
proper impact analysis and risk assessment prior to deploying defensive
measures.

CISA also provides a section for control systems security recommended practices
on the ICS webpage on us-cert.cisa.gov . Several recommended practices are
available for reading and download, including Improving Industrial Control
Systems Cybersecurity with Defense-in-Depth Strategies .

Additional mitigation guidance and recommended practices are publicly available
on the ICS webpage on us-cert.cisa.gov in the Technical Information Paper,
ICS-TIP-12-146-01B--Targeted Cyber Intrusion Detection and Mitigation
Strategies .

Organizations observing any suspected malicious activity should follow their
established internal procedures and report their findings to CISA for tracking
and correlation against other incidents.

No known public exploits specifically target this vulnerability.

For any questions related to this report, please contact the CISA at:

Email: CISAservicedesk@cisa.dhs.gov
Toll Free: 1-888-282-0870

CISA continuously strives to improve its products and services. You can help by
choosing one of the links below to provide feedback about this product.

- --------------------------END INCLUDED TEXT--------------------

You have received this e-mail bulletin as a result of your organisation's
registration with AusCERT. The mailing list you are subscribed to is
maintained within your organisation, so if you do not wish to continue
receiving these bulletins you should contact your local IT manager. If
you do not know who that is, please send an email to auscert@auscert.org.au
and we will forward your request to the appropriate person.

NOTE: Third Party Rights
This security bulletin is provided as a service to AusCERT's members.  As
AusCERT did not write the document quoted above, AusCERT has had no control
over its content. The decision to follow or act on information or advice
contained in this security bulletin is the responsibility of each user or
organisation, and should be considered in accordance with your organisation's
site policies and procedures. AusCERT takes no responsibility for consequences
which may arise from following or acting on information or advice contained in
this security bulletin.

NOTE: This is only the original release of the security bulletin.  It may
not be updated when updates to the original are made.  If downloading at
a later date, it is recommended that the bulletin is retrieved directly
from the author's website to ensure that the information is still current.

Contact information for the authors of the original document is included
in the Security Bulletin above.  If you have any questions or need further
information, please contact them directly.

Previous advisories and external security bulletins can be retrieved from:

        https://www.auscert.org.au/bulletins/

===========================================================================
Australian Computer Emergency Response Team
The University of Queensland
Brisbane
Qld 4072

Internet Email: auscert@auscert.org.au
Facsimile:      (07) 3365 7031
Telephone:      (07) 3365 4417 (International: +61 7 3365 4417)
                AusCERT personnel answer during Queensland business hours
                which are GMT+10:00 (AEST).
                On call after hours for member emergencies only.
===========================================================================
-----BEGIN PGP SIGNATURE-----
Comment: http://www.auscert.org.au/render.html?it=1967

iQIVAwUBYNKfKuNLKJtyKPYoAQhKTw/+NZa60XK8+H9iAmCHnryCkQwCFP5yJ6m6
iNDs8cDL8xHCs1WIhtya9b0mSNH4Mb389LCCoB3NMV2ZWwIJ3kDQduS2mMTJqnb9
iPhbJ2m0Km1SrGLZYF6no3PKJLL+EWiC4UWsHAntvj4JvRBSMeV7Vo9vrkbEiPDg
SKkATTWGP9NjpufJCqT9W1g2gb5gw+EMLB1amveIabqYJryJDNbaVP1OXEGJWdWW
9riMi+eMXWgCo+lrFKSlwU13TZgnta++MeHtjuqs8KCZDaM8VoQFkObo97zxSA1r
ASzaAKCJGL8QwB3cArnv0UcGj4Ytg+cRhNy7Z0UD/BKenFidqFckx/0UQKvY0JG0
av8Bw6ofoKx4e6YjM70OOAECqjkegwrzNPIGBY2d/StgVD73RpBBhXKq9dYV8qY3
h8vr/FFFg0Fh9PWTECUsR3G+0jCsf8pySp/esk8Rl+nfg7S59iUVziLl9G4+tf08
CY2gOpuQ06kVb6d2osYDs8GcAKiRpCufWXW1IyxQkROgr9RMpoYyFFoHyOuxhZVP
msIqheDnHv9RFTocOSsS8eNwRL6PW0cJMvhKxbDLIL6LA65L2jA2SYDB5ldnsJA8
zp6tLx8BIw638KKASWcHP51WoEpHdYChpQU73mtq+U8h8T9bDidUKMmiouqs14m9
nJAml79WCOI=
=DbxG
-----END PGP SIGNATURE-----