SSD Advisory – Oracle Knowledge Management XXE Leading to a RCE

Credit to Author: Maor Schwartz| Date: Sun, 19 Mar 2017 08:05:05 +0000

Vulnerability Summary
The following advisory describe Information Disclosure found in Oracle Knowledge Management version 8.5.1.

By enabling searches across a wide variety of sources, Oracle’s InQuira knowledge management products offer simple and convenient ways for users to access knowledge that was once hidden in the myriad systems, applications, and databases used to store enterprise content.

Oracle’s products for knowledge management help users find useful knowledge contained in corporate information stores.

Credit
An independent security researcher, Steven Seeley, has reported this vulnerability to Beyond Security’s SecuriTeam Secure Disclosure program.

Vendor response
Oracle has released patches to address this vulnerability, for more details see: http://www.oracle.com/technetwork/security-advisory/cpujul2016-2881720.html.

Vulnerability Details
The vulnerable code can be found in /imws/Result.jsp which when calls, can be used to access an XML from a third-party server, this third-party server which can be under our control can be used to reference files locally present on the victim’s server.

Proof of Concept

To exploit the vulnerability, we will run the following 5 steps (the first 2 need to be run in the background):

  1. ‘Malicious’ XML External Entity (XXE) server
  2. Listener for the gopher protocol
  3. Attacker who steal the ‘custom.xml’ file
  4. Decrypt/crack the encrypted AES password
  5. Shell on the machine

This image illustrates the steps this attack requires and the sequence of events that happen (behind the scenes):

Step 1 – setup a ‘malicious’ XML External Entity (XXE) server:

Step 2 – setup a listener for the gopher protocol:

Step 3 – steal the ‘custom.xml’ file

Step 4 – decrypt/crack the encrypted AES password:

Step 5 – get a shell
Using the database information, login to the database remotely and execute code. You may also find another configuration file on the system that will allow you a more ‘direct’ way to obtain a SYSTEM shell.

xxeserve.rb

gopher.py

poc.py

decrypt.sh

CVE Details
CVE-2016-3542

Affected Products
Oracle Knowledge Management versions 12.1.1, 12.1.2, 12.1.3, 12.2.3, 12.2.4, and 12.2.5.

https://blogs.securiteam.com/index.php/feed