Mac OS X : Apple Safari < 9.1.3 WebKit Memory Corruption RCE - Nessus

High   Plugin ID: 93593

This page contains detailed information about the Mac OS X : Apple Safari < 9.1.3 WebKit Memory Corruption RCE Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 93593
Name: Mac OS X : Apple Safari < 9.1.3 WebKit Memory Corruption RCE
Filename: macosx_Safari9_1_3.nasl
Vulnerability Published: 2016-08-25
This Plugin Published: 2016-09-19
Last Modification Time: 2019-11-14
Plugin Version: 1.10
Plugin Type: local
Plugin Family: MacOS X Local Security Checks
Dependencies: macosx_Safari31.nasl
Required KB Items [?]: Host/local_checks_enabled, Host/MacOSX/Version, MacOSX/Safari/Installed

Vulnerability Information


Severity: High
Vulnerability Published: 2016-08-25
Patch Published: 2016-09-01
CVE [?]: CVE-2016-4657
CPE [?]: cpe:/a:apple:safari

Synopsis

A web browser installed on the remote host is affected by a remote code execution vulnerability.

Description

The version of Apple Safari installed on the remote Mac OS X host is prior to 9.1.3. It is, therefore, affected by a remote code execution vulnerability in WebKit due to a memory corruption issue. An unauthenticated, remote attacker can exploit this, by convincing a user to visit a malicious website, to cause a denial of service condition or execution of arbitrary code.

Solution

Upgrade to Apple Safari version 9.1.3 or later.

Public Exploits


Target Network Port(s): N/A
Target Asset(s): N/A
Exploit Available: True (Metasploit Framework, Exploit-DB, GitHub)
Exploit Ease: Exploits are available

Here's the list of publicly known exploits and PoCs for verifying the Mac OS X : Apple Safari < 9.1.3 WebKit Memory Corruption RCE vulnerability:

  1. Metasploit: exploit/apple_ios/browser/webkit_trident
    [WebKit not_number defineProperties UAF]
  2. Exploit-DB: exploits/hardware/dos/44213.html
    [EDB-44213: Nintendo Switch - WebKit Code Execution (PoC)]
  3. Exploit-DB: exploits/ios/remote/44836.rb
    [EDB-44836: WebKit - not_number defineProperties UAF (Metasploit)]
  4. GitHub: https://github.com/Mimoja/CVE-2016-4657-NintendoSwitch
    [CVE-2016-4657: CVE-2016-4657 for NintendoSwitch rwx]
  5. GitHub: https://github.com/geeksniper/reverse-engineering-toolkit
    [CVE-2016-4657]
  6. GitHub: https://github.com/iDaN5x/Switcheroo
    [CVE-2016-4657: Exploiting CVE-2016-4657 to JailBreak the Nintendo Switch]
  7. GitHub: https://github.com/viai957/webkit-vulnerability
    [CVE-2016-4657: CVE-2016-4657 web-kit vulnerability for ios 9.3, nintendo switch browser ...]
  8. GitHub: https://github.com/vigneshyaadav27/webkit-vulnerability
    [CVE-2016-4657: CVE-2016-4657 web-kit vulnerability for ios 9.3, nintendo switch browser ...]
  9. GitHub: https://github.com/Traiver/CVE-2016-4657-Switch-Browser-Binary
    [CVE-2016-4657: Code for webkit exploit, Nintendo Switch]

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-2016-4657
CVSS V2 Vector: AV:N/AC:M/Au:N/C:P/I:P/A:P/E:F/RL:OF/RC:C
CVSS Base Score:6.8 (Medium)
Impact Subscore:6.4
Exploitability Subscore:8.6
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:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H/E:F/RL:O/RC:C
CVSS Base Score:8.8 (High)
Impact Subscore:5.9
Exploitability Subscore:2.8
CVSS Temporal Score:8.2 (High)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:8.2 (High)

Go back to menu.

Plugin Source


This is the macosx_Safari9_1_3.nasl nessus plugin source code. This script is Copyright (C) 2016-2019 and is owned by Tenable, Inc. or an Affiliate thereof.

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

include("compat.inc");

if (description)
{
  script_id(93593);
  script_version("1.10");
  script_cvs_date("Date: 2019/11/14");

  script_cve_id("CVE-2016-4657");
  script_bugtraq_id(92653);
  script_xref(name:"APPLE-SA", value:"APPLE-SA-2016-09-01-1");

  script_name(english:"Mac OS X : Apple Safari < 9.1.3 WebKit Memory Corruption RCE");
  script_summary(english:"Checks the Safari version.");

  script_set_attribute(attribute:"synopsis", value:
"A web browser installed on the remote host is affected by a remote
code execution vulnerability.");
  script_set_attribute(attribute:"description", value:
"The version of Apple Safari installed on the remote Mac OS X host is
prior to 9.1.3. It is, therefore, affected by a remote code execution
vulnerability in WebKit due to a memory corruption issue. An
unauthenticated, remote attacker can exploit this, by convincing a
user to visit a malicious website, to cause a denial of service
condition or execution of arbitrary code.");
  script_set_attribute(attribute:"see_also", value:"https://support.apple.com/en-us/HT207131");
  # http://lists.apple.com/archives/security-announce/2016/Sep/msg00000.html
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?dade65f4");
  script_set_attribute(attribute:"solution", value:
"Upgrade to Apple Safari version 9.1.3 or later.");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:M/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:R/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-2016-4657");

  script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
  script_set_attribute(attribute:"exploit_available", value:"true");
  script_set_attribute(attribute:"metasploit_name", value:'WebKit not_number defineProperties UAF');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"2016/08/25");
  script_set_attribute(attribute:"patch_publication_date", value:"2016/09/01");
  script_set_attribute(attribute:"plugin_publication_date", value:"2016/09/19");

  script_set_attribute(attribute:"plugin_type", value:"local");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:apple:safari");
  script_end_attributes();

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

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

  script_dependencies("macosx_Safari31.nasl");
  script_require_keys("Host/local_checks_enabled", "Host/MacOSX/Version", "MacOSX/Safari/Installed");

  exit(0);
}

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

if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
os = get_kb_item("Host/MacOSX/Version");
if (!os) audit(AUDIT_OS_NOT, "Mac OS X");

if (!ereg(pattern:"Mac OS X 10\.(9|10|11)([^0-9]|$)", string:os)) audit(AUDIT_OS_NOT, "Mac OS X 10.9 / 10.10 / 10.11");

installed = get_kb_item_or_exit("MacOSX/Safari/Installed", exit_code:0);
path    = get_kb_item_or_exit("MacOSX/Safari/Path", exit_code:1);
version = get_kb_item_or_exit("MacOSX/Safari/Version", exit_code:1);

fixed_version = "9.1.3";

if (ver_compare(ver:version, fix:fixed_version, strict:FALSE) == -1)
{
  report = report_items_str(
    report_items:make_array(
      "Path", path,
      "Installed version", version,
      "Fixed version", fixed_version
    ),
    ordered_fields:make_list("Path", "Installed version", "Fixed version")
  );
  security_report_v4(port:0, severity:SECURITY_WARNING, extra:report);
}
else audit(AUDIT_INST_PATH_NOT_VULN, "Safari", version, path);

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

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

Go back to menu.

How to Run


Here is how to run the Mac OS X : Apple Safari < 9.1.3 WebKit Memory Corruption RCE 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 MacOS X Local Security Checks plugin family.
  6. On the right side table select Mac OS X : Apple Safari < 9.1.3 WebKit Memory Corruption RCE plugin ID 93593.
  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 macosx_Safari9_1_3.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

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

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: APPLE-SA | Apple Security Advisory:
  • 2016-09-01-1
See also: Similar and related Nessus plugins:
  • 93124 - Apple iOS < 9.3.5 Multiple Vulnerabilities (Trident)
  • 96406 - Ubuntu 16.04 LTS : webkit2gtk vulnerabilities (USN-3166-1)
  • 57044 - Adobe Reader <= 10.1.1 / 9.4.6 U3D Memory Corruption (APSA11-04, APSB11-28, APSB11-30, APSB12-01) (Mac OS X)
  • 55141 - Flash Player for Mac < 10.3.181.26 Remote Memory Corruption (APSB11-18)
  • 70924 - Google Chrome < 31.0.1650.57 Multiple Memory Corruptions (Mac OS X)
  • 59181 - LibreOffice < 3.5.3 RTF File Handling Remote Memory Corruption (Mac OS X)
  • 69879 - Mac OS X : Apple Safari < 5.1.10 Memory Corruptions

Version


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

Go back to menu.