Xen Hypervisor XENMEM_exchange Memory Disclosure (XSA-212) - Nessus

High   Plugin ID: 99399

This page contains detailed information about the Xen Hypervisor XENMEM_exchange Memory Disclosure (XSA-212) Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 99399
Name: Xen Hypervisor XENMEM_exchange Memory Disclosure (XSA-212)
Filename: xen_server_XSA-212.nasl
Vulnerability Published: 2017-04-04
This Plugin Published: 2017-04-14
Last Modification Time: 2021-06-03
Plugin Version: 1.5
Plugin Type: local
Plugin Family: Misc.
Dependencies: xen_server_detect.nbin
Required KB Items [?]: installed_sw/Xen Hypervisor, Settings/ParanoidReport

Vulnerability Information


Severity: High
Vulnerability Published: 2017-04-04
Patch Published: 2017-04-04
CVE [?]: CVE-2017-7228
CPE [?]: cpe:/o:xen:xen

Synopsis

The remote Xen hypervisor installation is missing a security update.

Description

According to its self-reported version number, the Xen hypervisor installed on the remote host is affected by an out-of-array memory access error in the memory_exchange() function in file common/memory.c due to improper checking of XENMEM_exchange input. An attacker on a 64-bit PV guest VM who has administrative privileges can exploit this issue to access arbitrary system memory locations, which can then be potentially used for further compromising the host.

Note that Nessus has checked the changeset versions based on the xen.git change log. Nessus did not check guest hardware configurations or if patches were applied manually to the source code before a recompile and reinstall.

Solution

Apply the appropriate patch according to the vendor advisory.

Public Exploits


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

Here's the list of publicly known exploits and PoCs for verifying the Xen Hypervisor XENMEM_exchange Memory Disclosure (XSA-212) vulnerability:

  1. GitHub: https://github.com/jhembree/IACapstone
    [CVE-2017-7228]

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 V2 Vector [?]: AV:L/AC:L/Au:N/C:C/I:C/A:C/E:POC/RL:OF/RC:C
CVSS Base Score:7.2 (High)
Impact Subscore:10.0
Exploitability Subscore:3.9
CVSS Temporal Score:5.6 (Medium)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:5.6 (Medium)
CVSS V3 Vector: CVSS:3.0/AV:L/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H/E:P/RL:O/RC:C
CVSS Base Score:8.2 (High)
Impact Subscore:6.0
Exploitability Subscore:1.5
CVSS Temporal Score:7.4 (High)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:7.4 (High)
STIG Severity [?]: I
STIG Risk Rating: High

Go back to menu.

Plugin Source


This is the xen_server_XSA-212.nasl nessus plugin source code. This script is Copyright (C) 2017-2021 Tenable Network Security, Inc.

#
# (C) Tenable Network Security, Inc.
#

include("compat.inc");

if (description)
{
  script_id(99399);
  script_version("1.5");
  script_set_attribute(attribute:"plugin_modification_date", value:"2021/06/03");

  script_cve_id("CVE-2017-7228");
  script_bugtraq_id(97375);
  script_xref(name:"IAVB", value:"2017-B-0042-S");

  script_name(english:"Xen Hypervisor XENMEM_exchange Memory Disclosure (XSA-212)");
  script_summary(english:"Checks 'xl info' output for the Xen hypervisor version.");

  script_set_attribute(attribute:"synopsis", value:
"The remote Xen hypervisor installation is missing a security update.");
  script_set_attribute(attribute:"description", value:
"According to its self-reported version number, the Xen hypervisor
installed on the remote host is affected by an out-of-array memory
access error in the memory_exchange() function in file common/memory.c
due to improper checking of XENMEM_exchange input. An attacker on a
64-bit PV guest VM who has administrative privileges can exploit this
issue to access arbitrary system memory locations, which can then be
potentially used for further compromising the host.

Note that Nessus has checked the changeset versions based on the
xen.git change log. Nessus did not check guest hardware configurations
or if patches were applied manually to the source code before a
recompile and reinstall.");
  script_set_attribute(attribute:"see_also", value:"https://xenbits.xen.org/xsa/advisory-212.html");
  script_set_attribute(attribute:"see_also", value:"https://xenbits.xen.org/gitweb/?p=xen.git;a=summary");
  script_set_attribute(attribute:"solution", value:
"Apply the appropriate patch according to the vendor advisory.");
  script_set_cvss_base_vector("CVSS2#AV:L/AC:L/Au:N/C:C/I:C/A:C");
  script_set_cvss_temporal_vector("CVSS2#E:POC/RL:OF/RC:C");
  script_set_cvss3_base_vector("CVSS:3.0/AV:L/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H");
  script_set_cvss3_temporal_vector("CVSS:3.0/E:P/RL:O/RC:C");
  script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
  script_set_attribute(attribute:"exploit_available", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"2017/04/04");
  script_set_attribute(attribute:"patch_publication_date", value:"2017/04/04");
  script_set_attribute(attribute:"plugin_publication_date", value:"2017/04/14");

  script_set_attribute(attribute:"plugin_type", value:"local");
  script_set_attribute(attribute:"cpe", value:"cpe:/o:xen:xen");
  script_set_attribute(attribute:"potential_vulnerability", value:"true");
  script_set_attribute(attribute:"stig_severity", value:"I");
  script_end_attributes();

  script_category(ACT_GATHER_INFO);
  script_family(english:"Misc.");

  script_copyright(english:"This script is Copyright (C) 2017-2021 Tenable Network Security, Inc.");

  script_dependencies("xen_server_detect.nbin");
  script_require_keys("installed_sw/Xen Hypervisor", "Settings/ParanoidReport");

  exit(0);
}

include("audit.inc");
include("global_settings.inc");
include("install_func.inc");
include("misc_func.inc");

app_name = "Xen Hypervisor";
install  = get_single_install(app_name:app_name);
if (report_paranoia < 2) audit(AUDIT_PARANOID);

version         = install['version'];
display_version = install['display_version'];
path            = install['path'];
managed_status  = install['Managed status'];
changeset       = install['Changeset'];

if (!empty_or_null(changeset))
  display_version += " (changeset " + changeset + ")";

# Installations that are vendor-managed are handled by OS-specific local package checks
if (managed_status == "managed")
  audit(AUDIT_INST_PATH_NOT_VULN, app_name, display_version, path);

fixes['4.5']['fixed_ver']           = '4.5.5';
fixes['4.5']['fixed_ver_display']   = '4.5.5 (changeset cde86fc)';
fixes['4.5']['affected_ver_regex']  = '^4\\.5\\.';
fixes['4.5']['affected_changesets'] = make_list("1678521", "83cb2db",
  "43d06ef", "2b17bf4", "1a2bda5", "0bd7faf", "e3426e2", "37281bc",
  "27be856", "bdf3ef1", "cc325c0", "8e7b84d", "387b8ae", "34fbae7",
  "1530da2", "274a1f6", "b679cfa", "877b760", "cfe165d", "84e4e56",
  "e4ae4b0");

fixes['4.6']['fixed_ver']           = '4.6.6';
fixes['4.6']['fixed_ver_display']   = '4.6.6-pre (changeset ef63a62)';
fixes['4.6']['affected_ver_regex']  = '^4\\.6\\.';
fixes['4.6']['affected_changesets'] = make_list("f96efeb", "7ff6d9f",
  "7017321", "541ad61", "4f96171", "9eb0aa2", "ac4c5d4", "18949dc",
  "eea0742", "90ae9a7", "ef5eb08", "48c3bd0");

fixes['4.7']['fixed_ver']           = '4.7.3';
fixes['4.7']['fixed_ver_display']   = '4.7.3-pre (changeset 4bd66bc)';
fixes['4.7']['affected_ver_regex']  = '^4\\.7\\.';
fixes['4.7']['affected_changesets'] = make_list("47ba140", "4a1dc28",
  "5466c77", "25f3d95", "e5e7f35", "683b886", "9f2540d", "9d9be1e",
  "ac8d90e", "bc868a2", "d5f9489", "b2a180e", "01abcc0", "9c404df",
  "ddc0cfe", "9a54dcd", "4351611", "c782e61", "d166f07", "099f67b",
  "d756bf1", "10debc0", "461dba2", "188809f", "3daa62a");

fixes['4.8']['fixed_ver']           = '4.8.1';
fixes['4.8']['fixed_ver_display']   = '4.8.1-pre (changeset 06403aa)';
fixes['4.8']['affected_ver_regex']  = '^4\\.8\\.';
fixes['4.8']['affected_changesets'] = make_list("f3623bd", "c95bad9",
  "4ec1cb0", "093a1f1", "47501b6", "2859b25", "ca41491", "26dec7a",
  "eca97a4", "c75fe64", "af18ca9", "30c2dd7", "1780ea7", "42290f0",
  "bd684c2", "783b670", "07f9ddf", "d31d0cd", "b2e678e", "05946b5",
  "e020ff3", "308c646", "fceae91", "f667393", "768b250", "049b13d",
  "e26a2a0", "866f363", "354c3e4", "8c2da8f", "6289c3b", "2e68fda",
  "f85fc97", "9967251", "34305da", "437a8e6", "9028ba8", "1c28394",
  "c246296", "10baa19", "4582c2b", "a20300b", "23e3303", "95f1f99",
  "9b0e6d3", "b843de7", "ba7e250", "6240d92", "b378b1f", "b29aed8",
  "e1cefed", "53c3a73", "daf491d", "a654228", "c581ead", "67e9679",
  "080a31b", "1febe8d", "7713ee2", "b76a796", "e298344", "6933092",
  "af6534e", "297cf3d", "3e902dd", "c5efe95", "63c68c7", "3667bc0",
  "86e54be", "e7ad85e", "bdbfca0", "443264e", "d575902", "24ccfc3",
  "7628c7e", "b996efb", "7967daf", "1f4ea16");

fix = NULL;
foreach ver_branch (keys(fixes))
{
  if (version =~ fixes[ver_branch]['affected_ver_regex'])
  {
    ret = ver_compare(ver:version, fix:fixes[ver_branch]['fixed_ver']);
    if (ret < 0)
      fix = fixes[ver_branch]['fixed_ver_display'];
    else if (ret == 0)
    {
      if (empty_or_null(changeset))
        fix = fixes[ver_branch]['fixed_ver_display'];
      else
        foreach affected_changeset (fixes[ver_branch]['affected_changesets'])
          if (changeset == affected_changeset)
            fix = fixes[ver_branch]['fixed_ver_display'];
    }
  }
}

if (empty_or_null(fix))
  audit(AUDIT_INST_PATH_NOT_VULN, app_name, display_version, path);

items  = make_array("Installed version", display_version,
                    "Fixed version", fix,
                    "Path", path);
order  = make_list("Path", "Installed version", "Fixed version");
report = report_items_str(report_items:items, ordered_fields:order) + '\n';

security_report_v4(port:0, extra:report, severity:SECURITY_HOLE);

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

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

Go back to menu.

How to Run


Here is how to run the Xen Hypervisor XENMEM_exchange Memory Disclosure (XSA-212) 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 Misc. plugin family.
  6. On the right side table select Xen Hypervisor XENMEM_exchange Memory Disclosure (XSA-212) plugin ID 99399.
  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 xen_server_XSA-212.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

/opt/nessus/bin/nasl -a xen_server_XSA-212.nasl -t <IP/HOST>

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

/opt/nessus/bin/nasl -T - xen_server_XSA-212.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 xen_server_XSA-212.nasl -t <IP/HOST>

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: IAVB | Information Assurance Vulnerability Bulletin:
  • 2017-B-0042-S
See also: Similar and related Nessus plugins:
  • 99377 - Citrix XenServer multiple vulnerabilities (CTX222565)
  • 99601 - Debian DLA-907-1 : xen security update
  • 100071 - Debian DSA-3847-1 : xen - security update
  • 99405 - Fedora 24 : xen (2017-03dc811be6)
  • 99256 - Fedora 25 : xen (2017-054729ab08)
  • 99240 - FreeBSD : xen-kernel -- broken check in memory_exchange() permits PV guest breakout (90becf7c-1acf-11e7-970f-002590263bf5)
  • 99559 - openSUSE Security Update : xen (openSUSE-2017-492)
  • 99975 - OracleVM 3.4 : xen (OVMSA-2017-0094)
  • 99976 - OracleVM 3.3 : xen (OVMSA-2017-0095)
  • 99977 - OracleVM 3.2 : xen (OVMSA-2017-0096)
  • 102835 - OracleVM 3.4 : xen (OVMSA-2017-0142)
  • 103830 - OracleVM 3.4 : xen (OVMSA-2017-0153)
  • 111992 - OracleVM 3.4 : xen (OVMSA-2018-0248) (Bunker Buster) (Foreshadow) (Meltdown) (POODLE) (Spectre)
  • 140019 - OracleVM 3.4 : xen (OVMSA-2020-0039) (Bunker Buster) (Foreshadow) (MDSUM/RIDL) (MFBDS/RIDL/ZombieLoad) (MLPDS/RIDL) (MSBDS/Fallout) (Meltdown) (POODLE) (Spectre)
  • 99302 - SUSE SLED12 / SLES12 Security Update : xen (SUSE-SU-2017:0983-1)
  • 99507 - SUSE SLES11 Security Update : xen (SUSE-SU-2017:1058-1)
  • 99579 - SUSE SLES12 Security Update : xen (SUSE-SU-2017:1080-1)
  • 99580 - SUSE SLES11 Security Update : xen (SUSE-SU-2017:1081-1)
  • 95630 - Xen Multiple Vulnerabilities (XSA-191 - XSA-198)
  • 106902 - Xen Multiple Vulnerabilities (Spectre) (Meltdown) (XSA-254)
  • 109727 - Xen Intel Architecture Debug Exception Handling Local Privilege Escalation (XSA-260)
  • 112159 - Xen Project Speculative Execution Side Channel Vulnerability (XSA-273) (Foreshadow)
  • 125389 - Xen Project Microarchitectural Data Sampling Speculative Side-Channel Vulnerabilities (MDSUM/RIDL) (MFBDS/RIDL/ZombieLoad) (MLPDS/RIDL) (MSBDS/Fallout) (XSA-297)
  • 134172 - Xen Denial of Service vulnerability (XSA-304)
  • 134174 - Xen Information Disclosure Vulnerability (XSA-305)
  • 149085 - Xen Speculative Side Channel Information Disclosure (XSA-320)
  • 159518 - Xen IOMMU page mapping issues on x86 (XSA-378)
  • 159892 - No memory limit for dom0less domUs (XSA-383)

Version


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

Go back to menu.