Lucene search

K
nessusThis script is Copyright (C) 2023-2024 and is owned by Tenable, Inc. or an Affiliate thereof.TENABLE_OT_ABB_CVE-2021-3711.NASL
HistorySep 29, 2023 - 12:00 a.m.

ABB RTU500 Series Buffer Overflow in embedded OpenSSL (CVE-2021-3711)

2023-09-2900:00:00
This script is Copyright (C) 2023-2024 and is owned by Tenable, Inc. or an Affiliate thereof.
www.tenable.com
25
openssl
rtu500 series
buffer overflow
vulnerability
sm2
decryption
heap allocation
tenable.ot
scanner

CVSS2

7.5

Attack Vector

NETWORK

Attack Complexity

LOW

Authentication

NONE

Confidentiality Impact

PARTIAL

Integrity Impact

PARTIAL

Availability Impact

PARTIAL

AV:N/AC:L/Au:N/C:P/I:P/A:P

CVSS3

9.8

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

AI Score

10

Confidence

High

EPSS

0.068

Percentile

93.9%

A vulnerability exists in the OpenSSL Version 1.0.2 that affects the RTU500 Series product versions listed below.

RTU500 series CMU Firmware versions 12.0.1 – 12.0.14 12.2.1 – 12.2.11 12.4.1 – 12.4.11 12.6.1 – 12.6.8 12.7.1 – 12.7.5 13.2.1 – 13.2.5 13.3.1 – 13.3.3 13.4.1

In order to decrypt SM2 encrypted data an application is expected to call the API function EVP_PKEY_decrypt(). Typically an application will call this function twice. The first time, on entry, the out parameter can be NULL and, on exit, the outlen parameter is populated with the buffer size required to hold the decrypted plaintext. The application can then allocate a sufficiently sized buffer and call EVP_PKEY_decrypt() again, but this time passing a non- NULL value for the out parameter. A bug in the implementation of the SM2 decryption code means that the calculation of the buffer size required to hold the plaintext returned by the first call to EVP_PKEY_decrypt() can be smaller than the actual size required by the second call. This can lead to a buffer overflow when EVP_PKEY_decrypt() is called by the application a second time with a buffer that is too small. A malicious attacker who is able present SM2 content for decryption to an application could cause attacker chosen data to overflow the buffer by up to a maximum of 62 bytes altering the contents of other data held after the buffer, possibly changing application behaviour or causing the application to crash. The location of the buffer is application dependent but is typically heap allocated. Fixed in OpenSSL 1.1.1l (Affected 1.1.1-1.1.1k).

This plugin only works with Tenable.ot.
Please visit https://www.tenable.com/products/tenable-ot for more information.

#%NASL_MIN_LEVEL 80900
##
# (C) Tenable, Inc.
##

include('compat.inc');

if (description)
{
  script_id(501742);
  script_version("1.2");
  script_set_attribute(attribute:"plugin_modification_date", value:"2024/09/04");

  script_cve_id("CVE-2021-3711");
  script_xref(name:"ICSA", value:"23-143-02");
  script_xref(name:"DSA", value:"DSA-4963");
  script_xref(name:"GLSA", value:"GLSA-202209-02");
  script_xref(name:"GLSA", value:"GLSA-202210-02");

  script_name(english:"ABB RTU500 Series Buffer Overflow in embedded OpenSSL (CVE-2021-3711)");

  script_set_attribute(attribute:"synopsis", value:
"The remote OT asset is affected by a vulnerability.");
  script_set_attribute(attribute:"description", value:
"A vulnerability exists in the OpenSSL Version 1.0.2 that affects
the RTU500 Series product versions listed below.

RTU500 series CMU Firmware versions
12.0.1 – 12.0.14
12.2.1 – 12.2.11
12.4.1 – 12.4.11
12.6.1 – 12.6.8
12.7.1 – 12.7.5
13.2.1 – 13.2.5
13.3.1 – 13.3.3
13.4.1

In order to decrypt SM2 encrypted data an application is expected to
call the API function EVP_PKEY_decrypt(). Typically an application
will call this function twice. The first time, on entry, the out
parameter can be NULL and, on exit, the outlen parameter is
populated with the buffer size required to hold the decrypted
plaintext. The application can then allocate a sufficiently sized
buffer and call EVP_PKEY_decrypt() again, but this time passing a non-
NULL value for the out parameter. A bug in the implementation of the
SM2 decryption code means that the calculation of the buffer size
required to hold the plaintext returned by the first call to
EVP_PKEY_decrypt() can be smaller than the actual size required by the
second call. This can lead to a buffer overflow when
EVP_PKEY_decrypt() is called by the application a second time with a
buffer that is too small. A malicious attacker who is able present SM2
content for decryption to an application could cause attacker chosen
data to overflow the buffer by up to a maximum of 62 bytes altering
the contents of other data held after the buffer, possibly changing
application behaviour or causing the application to crash. The
location of the buffer is application dependent but is typically heap
allocated. Fixed in OpenSSL 1.1.1l (Affected 1.1.1-1.1.1k).

This plugin only works with Tenable.ot.
Please visit https://www.tenable.com/products/tenable-ot for more information.");
  script_set_attribute(attribute:"see_also", value:"https://www.openssl.org/news/secadv/20210824.txt");
  # https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=59f5e75f3bced8fc0e130d72a3f582cf7b480b46
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?4e69aead");
  script_set_attribute(attribute:"see_also", value:"https://www.cisa.gov/news-events/ics-advisories/icsa-23-143-02");
  # https://publisher.hitachienergy.com/preview?DocumentID=8DBD000153&LanguageCode=en&DocumentPartId=&Action=Launch
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?10034489");
  script_set_attribute(attribute:"solution", value:
"Refer to the vendor advisory.");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:P/A:P");
  script_set_cvss_temporal_vector("CVSS2#E:F/RL:OF/RC:C");
  script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H");
  script_set_cvss3_temporal_vector("CVSS:3.0/E:F/RL:O/RC:C");
  script_set_attribute(attribute:"cvss_score_source", value:"CVE-2021-3711");

  script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
  script_set_attribute(attribute:"exploit_available", value:"true");
  script_cwe_id(120);

  script_set_attribute(attribute:"vuln_publication_date", value:"2021/08/24");
  script_set_attribute(attribute:"patch_publication_date", value:"2021/08/24");
  script_set_attribute(attribute:"plugin_publication_date", value:"2023/09/29");

  script_set_attribute(attribute:"plugin_type", value:"remote");
  script_set_attribute(attribute:"cpe", value:"cpe:/o:hitachienergy:rtu500_firmware:-");
  script_set_attribute(attribute:"generated_plugin", value:"former");
  script_end_attributes();

  script_category(ACT_GATHER_INFO);
  script_family(english:"Tenable.ot");

  script_copyright(english:"This script is Copyright (C) 2023-2024 and is owned by Tenable, Inc. or an Affiliate thereof.");

  script_dependencies("tenable_ot_api_integration.nasl");
  script_require_keys("Tenable.ot/ABB");

  exit(0);
}


include('tenable_ot_cve_funcs.inc');

get_kb_item_or_exit('Tenable.ot/ABB');

var asset = tenable_ot::assets::get(vendor:'ABB');

var vuln_cpes = {
    "cpe:/o:hitachienergy:rtu500_firmware:12.0" :
        {"versionEndIncluding" : "12.0.14", "versionStartIncluding" : "12.0.1", "family" : "AbbRTU500"},
    "cpe:/o:hitachienergy:rtu500_firmware:12.2" :
        {"versionEndIncluding" : "12.2.11", "versionStartIncluding" : "12.2.1", "family" : "AbbRTU500"},
    "cpe:/o:hitachienergy:rtu500_firmware:12.4" :
        {"versionEndIncluding" : "12.4.11", "versionStartIncluding" : "12.4.1", "family" : "AbbRTU500"},
    "cpe:/o:hitachienergy:rtu500_firmware:12.6" :
        {"versionEndIncluding" : "12.6.8", "versionStartIncluding" : "12.6.1", "family" : "AbbRTU500"},
    "cpe:/o:hitachienergy:rtu500_firmware:12.7" :
        {"versionEndIncluding" : "12.7.5", "versionStartIncluding" : "12.7.1", "family" : "AbbRTU500"},
    "cpe:/o:hitachienergy:rtu500_firmware:13.2" :
        {"versionEndIncluding" : "13.2.5", "versionStartIncluding" : "13.2.1", "family" : "AbbRTU500"},
    "cpe:/o:hitachienergy:rtu500_firmware:13.3" :
        {"versionEndIncluding" : "13.3.3", "versionStartIncluding" : "13.3.1", "family" : "AbbRTU500"},
    "cpe:/o:hitachienergy:rtu500_firmware:13.4.1" :
        {"versionEndIncluding" : "13.4.1", "versionStartIncluding" : "13.4.1", "family" : "AbbRTU500"}
};

tenable_ot::cve::compare_and_report(asset:asset, cpes:vuln_cpes, severity:SECURITY_HOLE);
VendorProductVersionCPE
hitachienergyrtu500_firmware-cpe:/o:hitachienergy:rtu500_firmware:-

CVSS2

7.5

Attack Vector

NETWORK

Attack Complexity

LOW

Authentication

NONE

Confidentiality Impact

PARTIAL

Integrity Impact

PARTIAL

Availability Impact

PARTIAL

AV:N/AC:L/Au:N/C:P/I:P/A:P

CVSS3

9.8

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

AI Score

10

Confidence

High

EPSS

0.068

Percentile

93.9%