ICS Advisory

3S CODESYS Gateway Use After Free

Last Revised
Alert Code


Independent researcher Nicholas Miles has identified a vulnerability in the 3S CODESYS Gateway application that can result in a denial-of-service (DoS) condition. 3S has produced an update that mitigates this vulnerability. Nicholas Miles has tested this update and validates that it resolves the vulnerability.

Successful exploitation of this vulnerability could cause a DoS condition and may also allow the possibility of remote execution of arbitrary code.

The Gateway-Server is a third-party component found in multiple control systems manufacturer’s products. This vulnerability could be exploited remotely.


The following 3S products are affected:

CODESYS Gateway, Version

This product is also used in many products sold by other vendors. Control systems vendors should review their products, identify those that incorporate the affected software, and take appropriate steps to update their products and notify customers.


If exploited, an attacker could use this vulnerability to remotely cause a DoS with a system crash within the Gateway server application. Remote execution of arbitrary code may also be possible.

Impact to individual organizations depends on many factors that are unique to each organization. ICS‑CERT recommends that organizations evaluate the impact of this vulnerability based on their operational environment, architecture, and product implementation.


According to the 3S-Smart Software Solutions GmbH Web site,http://www.3s-software.com Web site last accessed May 22, 2013. CODESYS is used in virtually all sectors of the automation industry by manufacturers of industrial controllers or intelligent automation devices, by end users in many different industries, or by system integrators who offer automation solutions with CODESYS.

This vulnerability affects products primarily found in the energy, critical manufacturing, and industrial automation industries.



USE AFTER FREECWE-416: Use After Free, http://cwe.mitre.org/data/definitions/416.html, Web site last accessed May 22, 2013.

The vulnerability is caused by referencing memory that has been previously freed by the process. This condition commonly causes a system crash and may also present the possibility for execution of arbitrary code.

CVE-2013-2781NVD, http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2013-2781, NIST uses this advisory to create the CVE Web site report. This Web site will be active sometime after publication of this advisory. has been assigned to this vulnerability. A CVSS v2 base score of 10.0 has been assigned; the CVSS vector string is (AV:N/AC:L/Au:N/C:C/I:C/A:C).CVSS Calculator, http://nvd.nist.gov/cvss.cfm?version=2&vector=(AV:N/AC:L/Au:N/C:C/I:C/A:C), Web site last accessed May 22, 2013.



This vulnerability could be exploited remotely.


No known public exploits specifically target this vulnerability.


An attacker with a low skill would be able to exploit this vulnerability.


3S has produced a patch that is available for download from the 3S CODESYS Download page:


Please contact CODESYS Support for any additional questions concerning the update.

ICS‑CERT encourages asset owners to take additional defensive measures to protect against this and other cybersecurity risks.

  • Minimize network exposure for all control system devices and/or systems. Critical devices and/or systems should not directly face the Internet.
  • Locate control system networks and remote devices behind firewalls, and isolate them from the business network.
  • When remote access is required, use secure methods, such as Virtual Private Networks (VPNs), recognizing that VPN is only as secure as the connected devices.

ICS-CERT also provides a section for control systems security recommended practices on the ICS-CERT Web page. Several recommended practices are available for reading and download, including Improving Industrial Control Systems Cybersecurity with Defense-in-Depth Strategies. ICS‑CERT reminds organizations to perform proper impact analysis and risk assessment prior to taking defensive measures.

Additional mitigation guidance and recommended practices are publicly available in the ICS‑CERT Technical Information Paper, ICS-TIP-12-146-01B—Targeted Cyber Intrusion Detection and Mitigation Strategies, that is available for download from the ICS-CERT Web page (http://ics-cert.us-cert.gov/).

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


3S-Smart Software Solutions