Lucene search

K
nessusThis script is Copyright (C) 2023-2024 and is owned by Tenable, Inc. or an Affiliate thereof.TENABLE_OT_SIEMENS_CVE-2022-4450.NASL
HistoryDec 19, 2023 - 12:00 a.m.

Siemens SCALANCE W1750D Devices Double Free (CVE-2022-4450)

2023-12-1900:00:00
This script is Copyright (C) 2023-2024 and is owned by Tenable, Inc. or an Affiliate thereof.
www.tenable.com
12
siemens scalance w1750d
openssl
vulnerability
double free
denial of service
tenable.ot

8.1 High

AI Score

Confidence

High

A vulnerability exists in the OpenSSL that affects SCALANCE W1750D device.

The function PEM_read_bio_ex() reads a PEM file from a BIO and parses and decodes the ‘name’ (e.g. ‘CERTIFICATE’), any header data and the payload data. If the function succeeds then the ‘name_out’, ‘header’ and ‘data’ arguments are populated with pointers to buffers containing the relevant decoded data. The caller is responsible for freeing those buffers. It is possible to construct a PEM file that results in 0 bytes of payload data.
In this case PEM_read_bio_ex() will return a failure code but will populate the header argument with a pointer to a buffer that has already been freed.
If the caller also frees this buffer then a double free will occur. This will most likely lead to a crash. This could be exploited by an attacker who has the ability to supply malicious PEM files for parsing to achieve a denial of service attack. The functions PEM_read_bio() and PEM_read() are simple wrappers around PEM_read_bio_ex() and therefore these functions are also directly affected.
These functions are also called indirectly by a number of other OpenSSL functions including PEM_X509_INFO_read_bio_ex() and SSL_CTX_use_serverinfo_file() which are also vulnerable. Some OpenSSL internal uses of these functions are not vulnerable because the caller does not free the header argument if PEM_read_bio_ex() returns a failure code. These locations include the PEM_read_bio_TYPE() functions as well as the decoders introduced in OpenSSL 3.0. The OpenSSL asn1parse command line application is also impacted by this issue.

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(501842);
  script_version("1.2");
  script_set_attribute(attribute:"plugin_modification_date", value:"2024/04/13");

  script_cve_id("CVE-2022-4450");

  script_name(english:"Siemens SCALANCE W1750D Devices Double Free (CVE-2022-4450)");

  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 that affects SCALANCE W1750D device.

The function PEM_read_bio_ex() reads a PEM file from a BIO and parses and
decodes the 'name' (e.g. 'CERTIFICATE'), any header data and the payload
data. If the function succeeds then the 'name_out', 'header' and 'data'
arguments are populated with pointers to buffers containing the relevant
decoded data. The caller is responsible for freeing those buffers. It is
possible to construct a PEM file that results in 0 bytes of payload data.
In this case PEM_read_bio_ex() will return a failure code but will populate
the header argument with a pointer to a buffer that has already been freed.
If the caller also frees this buffer then a double free will occur. This will
most likely lead to a crash. This could be exploited by an attacker who has the
ability to supply malicious PEM files for parsing to achieve a denial of 
service attack. The functions PEM_read_bio() and PEM_read() are simple wrappers
around PEM_read_bio_ex() and therefore these functions are also directly affected.
These functions are also called indirectly by a number of other OpenSSL functions
including PEM_X509_INFO_read_bio_ex() and SSL_CTX_use_serverinfo_file() which are
also vulnerable. Some OpenSSL internal uses of these functions are not vulnerable
because the caller does not free the header argument if PEM_read_bio_ex() returns
a failure code. These locations include the PEM_read_bio_TYPE() functions as well
as the decoders introduced in OpenSSL 3.0. The OpenSSL asn1parse command line
application is also impacted by this issue.

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/20230207.txt");
  script_set_attribute(attribute:"see_also", value:"https://cert-portal.siemens.com/productcert/html/ssa-203374.html");
  script_set_attribute(attribute:"see_also", value:"https://www.cisa.gov/news-events/ics-advisories/icsa-23-075-04");
  script_set_attribute(attribute:"solution", value:
"The following text was originally created by the Cybersecurity and Infrastructure Security Agency (CISA). The original
can be found at CISA.gov.

Siemens has identified the following specific workarounds and mitigations users can apply to reduce risk:
- CVE-2022-4450: Do not import or configure certificate files in PEM format from untrusted sources.

As a general security measure, Siemens recommends protecting network access to devices with appropriate mechanisms. To
operate the devices in a protected IT environment, Siemens recommends configuring the environment according to Siemens'
operational guidelines for Industrial Security. Additional information on Siemens Industrial Security can be found here.

For more information, see the associated Siemens security advisory SSA-203374 in HTML and CSAF.");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:N/I:N/A:C");
  script_set_cvss_temporal_vector("CVSS2#E:U/RL:OF/RC:C");
  script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H");
  script_set_cvss3_temporal_vector("CVSS:3.0/E:U/RL:O/RC:C");
  script_set_attribute(attribute:"cvss_score_source", value:"CVE-2022-4450");

  script_set_attribute(attribute:"exploitability_ease", value:"No known exploits are available");
  script_set_attribute(attribute:"exploit_available", value:"false");
  script_cwe_id(415);

  script_set_attribute(attribute:"vuln_publication_date", value:"2023/03/14");
  script_set_attribute(attribute:"plugin_publication_date", value:"2023/12/19");

  script_set_attribute(attribute:"plugin_type", value:"remote");
  script_set_attribute(attribute:"cpe", value:"cpe:/o:siemens:scalance_w1750d_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/Siemens");

  exit(0);
}


include('tenable_ot_cve_funcs.inc');

get_kb_item_or_exit('Tenable.ot/Siemens');

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

var vuln_cpes = {
    "cpe:/o:siemens:scalance_w1750d_firmware" :
        {"versionEndExcluding": "8.10.0.9", "family" : "SCALANCEW", "orderNumbers" : ["6GK5750-2HX01-1AD0","6GK5750-2HX01-1AA0","6GK5750-2HX01-1AB0"]}
};

tenable_ot::cve::compare_and_report(asset:asset, cpes:vuln_cpes, severity:SECURITY_HOLE);
VendorProductVersionCPE
siemensscalance_w1750d_firmwarecpe:/o:siemens:scalance_w1750d_firmware