Matt Posted July 22, 2013 Report Posted July 22, 2013 Author : SEC ConsultSource : Sybase EAServer 6.3.1 - Multiple VulnerabilitiesCode : SEC Consult Vulnerability Lab Security Advisory < 20130719-0 >======================================================================= title: Multiple vulnerabilities product: Sybase EAServer vulnerable version: <=6.3.1 fixed version: vendor did not supply version information CVE number: - impact: critical homepage: [url=http://www.sybase.com]Enterprise Data Management, Analysis and Mobilization Software - Sybase Inc[/url] found: 10/2012 by: Gerhard Wagner, Bernhard Mueller SEC Consult Vulnerability Lab [url]https://www.sec-consult.com[/url]=======================================================================Vendor description:-------------------Sybase EAServer fully supports all the Web services standards and enablesenterprises to rapidly expose business functions as Web services. EAServer alsoprovides a graphical interface to automate the publication and management ofyour company’s Web services. Today, EAServer supports EJB and Java/CORBAcomponents, CICS integrator, and database stored procedures. These storedprocedures can be from all Sybase’s databases including ASE, SQL Anywhere,and IQ; in addition, they will support IBM, Oracle, and Microsoft. EAServer canalso support iAnywhere messaging services, enabling the developer to exposethese components as Web services.Business recommendation:------------------------The default applications that are deployed by default during the installationof Sybase EAServer should be removed. Further, it is recommended to test thepatches provided by Sybase.Vulnerability overview/description:-----------------------------------1) Directory traversalIn order to use a common web server such as IIS as a fronted and forward onlycertain requests to the Sybase EAServer it is a common practice to install andconfigure the EAServer redirector plug-in. An incoming request will be receivedby the web server, validated if it matches any context configured within theredirector plug-in and if so forwarded to the appropriate application context.So a request such as the following will be forwarded by the redirector plug-inin case the configuration contains such an application.[url]https://example.com/myapp[/url] -> [url]https://myEAServer/myapp[/url]If the request contains a path like "/\.." the redirector plug-in is notnormalising the path as a part of the "myapp" application. Therefore, therequest will be passed on to the Sybase EAServer where backslash as well asforward slash are valid directory separators and therefore using such a methodit is possible to access all deployed applications.[url]https://example.com/myapp/%5C../another_application[/url]2) XML entity injectionDue to insufficient input validation it is possible to pass external entitydefinitions to the server-side XML processor for REST requests with an XMLmedia type. By calling the built-in function testDataTypes() an attacker canlist directories and display arbitrary files on the affected system, as long asthe files don't conflict with the UTF-8 encoding.3) OS command executionThe WSH service allows to run OS commands and it can only be accessed providingadministrative credentials. Using the XXE vulnerability mentioned before it ispotentially possible to retrieve the credentials from configuration files andrun OS commands using the WSH service.Proof of concept:-----------------1) Directory traversalThe following request allows to access the Sybase EAServer managementapplication:[url]https://example.com/myapp/%5C../console/Login.jsp[/url]Also the other applications that come by default with Sybase EAServer can beaccessed using their respective context for example:/rest/wsh/wsf...2) XML entity injectionThe following XML message displays the contents of the drive C: on a Windowssystem:<?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE foo [ <!ELEMENT foo ANY > <!ENTITY xxe SYSTEM "file:///C:\">]><lol><dt><stringValue>&xxe;</stringValue><booleanValue>0</booleanValue></dt></lol>3) OS command executionDue to the potential impact the proof-of-concept has been removed.Vulnerable / tested versions:-----------------------------The issues have been tested in Sybase EAServer 6.3.1 on Windows.Vendor contact timeline:------------------------2013-03-11: Contact the vendor and provide vulnerability information2013-06-11: Vendor fixes the issues2013-06-28: Agreement on disclosure date 2013-07-192013-07-19: Public disclosureSolution:---------According to the vendor customers can download the latest patches from[url=http://www.sybase.com/downloads]Sybase Software Downloads and Code Samples - Database and Mobility Software - Sybase Inc[/url]. The patches have not been tested bySEC Consult.Advisory URL:-------------[url]https://www.sec-consult.com/en/Vulnerability-Lab/Advisories.htm[/url]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~SEC Consult Vulnerability LabSEC ConsultVienna - Bangkok - Frankfurt/Main - Montreal - Singapore - VilniusHeadquarter:Mooslackengasse 17, 1190 Vienna, AustriaPhone: +43 1 8903043 0Fax: +43 1 8903043 15Mail: research at sec-consult dot comWeb: [url]https://www.sec-consult.com[/url]Blog: [url=http://blog.sec-consult.com]SEC Consult[/url]Twitter: [url]https://twitter.com/sec_consult[/url]EOF G. Wagner / @2013] Quote