EulerOS Virtualization 3.0.2.6 : PyYAML (EulerOS-SA-2021-2902) - Nessus

Critical   Plugin ID: 156538

This page contains detailed information about the EulerOS Virtualization 3.0.2.6 : PyYAML (EulerOS-SA-2021-2902) Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 156538
Name: EulerOS Virtualization 3.0.2.6 : PyYAML (EulerOS-SA-2021-2902)
Filename: EulerOS_SA-2021-2902.nasl
Vulnerability Published: 2021-01-21
This Plugin Published: 2022-01-06
Last Modification Time: 2022-01-06
Plugin Version: 1.2
Plugin Type: local
Plugin Family: Huawei Local Security Checks
Dependencies: ssh_get_info.nasl
Required KB Items [?]: Host/cpu, Host/EulerOS/release, Host/EulerOS/rpm-list, Host/EulerOS/uvp_version, Host/local_checks_enabled

Vulnerability Information


Severity: Critical
Vulnerability Published: 2021-01-21
Patch Published: 2021-12-30
CVE [?]: CVE-2020-14343
CPE [?]: cpe:/o:huawei:euleros:uvp:3.0.2.6, p-cpe:/a:huawei:euleros:PyYAML

Synopsis

The remote EulerOS Virtualization host is missing a security update.

Description

According to the versions of the PyYAML package installed, the EulerOS Virtualization installation on the remote host is affected by the following vulnerabilities :

- A vulnerability was discovered in the PyYAML library in versions before 5.4, where it is susceptible to arbitrary code execution when it processes untrusted YAML files through the full_load method or with the FullLoader loader. Applications that use the library to process untrusted input may be vulnerable to this flaw. This flaw allows an attacker to execute arbitrary code on the system by abusing the python/object/new constructor. This flaw is due to an incomplete fix for CVE-2020-1747. (CVE-2020-14343)

Note that Tenable Network Security has extracted the preceding description block directly from the EulerOS security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues.

Solution

Update the affected PyYAML packages.

Public Exploits


Target Network Port(s): N/A
Target Asset(s): N/A
Exploit Available: True (GitHub)
Exploit Ease: Exploits (PoCs) are available

Here's the list of publicly known exploits and PoCs for verifying the EulerOS Virtualization 3.0.2.6 : PyYAML (EulerOS-SA-2021-2902) vulnerability:

  1. GitHub: https://github.com/SugarP1g/LearningSecurity
    [CVE-2020-14343]
  2. GitHub: https://github.com/j4k0m/loader-CVE-2020-14343
    [CVE-2020-14343: A web application vulnerable to CVE-2020-14343 insecure deserialization leading to ...]
  3. GitHub: https://github.com/raul23/pyyaml-CVE-2020-14343
    [CVE-2020-14343: Experimenting with the CVE-2020-14343 PyYAML vulnerability]

Before running any exploit against any system, make sure you are authorized by the owner of the target system(s) to perform such activity. In any other case, this would be considered as an illegal activity.

WARNING: Beware of using unverified exploits from sources such as GitHub or Exploit-DB. These exploits and PoCs could contain malware. For more information, see how to use exploits safely.

Risk Information


CVSS Score Source [?]: CVE-2020-14343
CVSS V2 Vector: AV:N/AC:L/Au:N/C:C/I:C/A:C/E:U/RL:OF/RC:C
CVSS Base Score:10.0 (High)
Impact Subscore:10.0
Exploitability Subscore:10.0
CVSS Temporal Score:7.4 (High)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:7.4 (High)
CVSS V3 Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:U/RL:O/RC:C
CVSS Base Score:9.8 (Critical)
Impact Subscore:5.9
Exploitability Subscore:3.9
CVSS Temporal Score:8.5 (High)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:8.5 (High)
STIG Severity [?]: I
STIG Risk Rating: High

Go back to menu.

Plugin Source


This is the EulerOS_SA-2021-2902.nasl nessus plugin source code. This script is Copyright (C) 2022 and is owned by Tenable, Inc. or an Affiliate thereof.

#%NASL_MIN_LEVEL 70300
##
# (C) Tenable Network Security, Inc.
##

include('deprecated_nasl_level.inc');
include('compat.inc');

if (description)
{
  script_id(156538);
  script_version("1.2");
  script_set_attribute(attribute:"plugin_modification_date", value:"2022/01/06");

  script_cve_id("CVE-2020-14343");
  script_xref(name:"IAVA", value:"2021-A-0463");

  script_name(english:"EulerOS Virtualization 3.0.2.6 : PyYAML (EulerOS-SA-2021-2902)");

  script_set_attribute(attribute:"synopsis", value:
"The remote EulerOS Virtualization host is missing a security update.");
  script_set_attribute(attribute:"description", value:
"According to the versions of the PyYAML package installed, the EulerOS Virtualization installation on the remote host is
affected by the following vulnerabilities :

  - A vulnerability was discovered in the PyYAML library in versions before 5.4, where it is susceptible to
    arbitrary code execution when it processes untrusted YAML files through the full_load method or with the
    FullLoader loader. Applications that use the library to process untrusted input may be vulnerable to this
    flaw. This flaw allows an attacker to execute arbitrary code on the system by abusing the
    python/object/new constructor. This flaw is due to an incomplete fix for CVE-2020-1747. (CVE-2020-14343)

Note that Tenable Network Security has extracted the preceding description block directly from the EulerOS security
advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional
issues.");
  # https://developer.huaweicloud.com/ict/en/site-euleros/euleros/security-advisories/EulerOS-SA-2021-2902
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?328d84bd");
  script_set_attribute(attribute:"solution", value:
"Update the affected PyYAML packages.");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:C/I:C/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:H/I:H/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-2020-14343");

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

  script_set_attribute(attribute:"vuln_publication_date", value:"2021/01/21");
  script_set_attribute(attribute:"patch_publication_date", value:"2021/12/30");
  script_set_attribute(attribute:"plugin_publication_date", value:"2022/01/06");

  script_set_attribute(attribute:"plugin_type", value:"local");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:huawei:euleros:PyYAML");
  script_set_attribute(attribute:"cpe", value:"cpe:/o:huawei:euleros:uvp:3.0.2.6");
  script_set_attribute(attribute:"stig_severity", value:"I");
  script_end_attributes();

  script_category(ACT_GATHER_INFO);
  script_family(english:"Huawei Local Security Checks");

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

  script_dependencies("ssh_get_info.nasl");
  script_require_keys("Host/local_checks_enabled", "Host/cpu", "Host/EulerOS/release", "Host/EulerOS/rpm-list", "Host/EulerOS/uvp_version");

  exit(0);
}

include("audit.inc");
include("global_settings.inc");
include("rpm.inc");

if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);

var release = get_kb_item("Host/EulerOS/release");
if (isnull(release) || release !~ "^EulerOS") audit(AUDIT_OS_NOT, "EulerOS");
var uvp = get_kb_item("Host/EulerOS/uvp_version");
if (uvp != "3.0.2.6") audit(AUDIT_OS_NOT, "EulerOS Virtualization 3.0.2.6");
if (!get_kb_item("Host/EulerOS/rpm-list")) audit(AUDIT_PACKAGE_LIST_MISSING);

var cpu = get_kb_item("Host/cpu");
if (isnull(cpu)) audit(AUDIT_UNKNOWN_ARCH);
if ("x86_64" >!< cpu && cpu !~ "^i[3-6]86$" && "aarch64" >!< cpu) audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, "EulerOS", cpu);
if ("x86_64" >!< cpu && cpu !~ "^i[3-6]86$") audit(AUDIT_ARCH_NOT, "i686 / x86_64", cpu);

var flag = 0;

var pkgs = [
  "PyYAML-3.10-11.h5.eulerosv2r7"
];

foreach (var pkg in pkgs)
  if (rpm_check(release:"EulerOS-2.0", reference:pkg)) flag++;

if (flag)
{
  security_report_v4(
    port       : 0,
    severity   : SECURITY_HOLE,
    extra      : rpm_report_get()
  );
  exit(0);
}
else
{
  var tested = pkg_tests_get();
  if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
  else audit(AUDIT_PACKAGE_NOT_INSTALLED, "PyYAML");
}

The latest version of this script can be found in these locations depending on your platform:

  • Linux / Unix:
    /opt/nessus/lib/nessus/plugins/EulerOS_SA-2021-2902.nasl
  • Windows:
    C:\ProgramData\Tenable\Nessus\nessus\plugins\EulerOS_SA-2021-2902.nasl
  • Mac OS X:
    /Library/Nessus/run/lib/nessus/plugins/EulerOS_SA-2021-2902.nasl

Go back to menu.

How to Run


Here is how to run the EulerOS Virtualization 3.0.2.6 : PyYAML (EulerOS-SA-2021-2902) as a standalone plugin via the Nessus web user interface (https://localhost:8834/):

  1. Click to start a New Scan.
  2. Select Advanced Scan.
  3. Navigate to the Plugins tab.
  4. On the top right corner click to Disable All plugins.
  5. On the left side table select Huawei Local Security Checks plugin family.
  6. On the right side table select EulerOS Virtualization 3.0.2.6 : PyYAML (EulerOS-SA-2021-2902) plugin ID 156538.
  7. Specify the target on the Settings tab and click to Save the scan.
  8. Run the scan.

Here are a few examples of how to run the plugin in the command line. Note that the examples below demonstrate the usage on the Linux / Unix platform.

Basic usage:

/opt/nessus/bin/nasl EulerOS_SA-2021-2902.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

/opt/nessus/bin/nasl -a EulerOS_SA-2021-2902.nasl -t <IP/HOST>

Run the plugin with trace script execution written to the console (useful for debugging):

/opt/nessus/bin/nasl -T - EulerOS_SA-2021-2902.nasl -t <IP/HOST>

Run the plugin with using a state file for the target and updating it (useful for running multiple plugins on the target):

/opt/nessus/bin/nasl -K /tmp/state EulerOS_SA-2021-2902.nasl -t <IP/HOST>

Go back to menu.

References


IAVA | Information Assurance Vulnerability Alert:
  • 2021-A-0463
See also: Similar and related Nessus plugins:
  • 157659 - AlmaLinux 8 : python38:3.8 and python38-devel:3.8 (ALSA-2021:2583)
  • 151145 - CentOS 8 : python38:3.8 and python38-devel:3.8 (CESA-2021:2583)
  • 145771 - EulerOS 2.0 SP8 : PyYAML (EulerOS-SA-2021-1168)
  • 147051 - EulerOS Virtualization for ARM 64 3.0.6.0 : PyYAML (EulerOS-SA-2021-1565)
  • 148626 - EulerOS Virtualization 2.9.1 : PyYAML (EulerOS-SA-2021-1723)
  • 148591 - EulerOS Virtualization 2.9.0 : pyyaml (EulerOS-SA-2021-1755)
  • 149578 - EulerOS 2.0 SP5 : PyYAML (EulerOS-SA-2021-1912)
  • 150211 - EulerOS 2.0 SP9 : pyyaml (EulerOS-SA-2021-1937)
  • 150205 - EulerOS 2.0 SP9 : PyYAML (EulerOS-SA-2021-1958)
  • 151250 - EulerOS Virtualization 3.0.6.6 : PyYAML (EulerOS-SA-2021-2031)
  • 151330 - EulerOS Virtualization for ARM 64 3.0.2.0 : PyYAML (EulerOS-SA-2021-2078)
  • 145367 - Fedora 33 : PyYAML (2021-3342569a0f)
  • 145763 - Fedora 32 : PyYAML (2021-eed7193502)
  • 150230 - FreeBSD : PyYAML -- arbitrary code execution (c7ec6375-c3cf-11eb-904f-14dae9d5a9d2)
  • 151279 - Oracle Linux 8 : python38:3.8 / and / python38-devel:3.8 (ELSA-2021-2583)
  • 146772 - Photon OS 1.0: Pyyaml PHSA-2021-1.0-0361
  • 146067 - Photon OS 3.0: Pyyaml PHSA-2021-3.0-0190
  • 155377 - RHEL 7 : Satellite 6.10 Release (Moderate) (RHSA-2021:4702)
  • 157771 - Rocky Linux 8 : python38:3.8 and python38-devel:3.8 (RLSA-2021:2583)
  • 152809 - SUSE SLES12 Security Update : python-PyYAML (SUSE-SU-2021:2818-1)
  • 149417 - Ubuntu 20.04 LTS / 20.10 : PyYAML vulnerability (USN-4940-1)
  • 146036 - CentOS 8 : python38:3.8 (CESA-2020:4641)
  • 142431 - RHEL 8 : python38:3.8 (RHSA-2020:4641)

Version


This page has been produced using Nessus Professional 10.1.2 (#68) LINUX, Plugin set 202205072148.
Plugin file EulerOS_SA-2021-2902.nasl version 1.2. For more plugins, visit the Nessus Plugin Library.

Go back to menu.