Lucene search

K
securityvulnsSecurityvulnsSECURITYVULNS:DOC:9222
HistoryJul 19, 2005 - 12:00 a.m.

Run any OS Command via unauthorized Oracle Reports

2005-07-1900:00:00
vulners.com
67

Name Run any OS Command via unauthorized Oracle Reports
Systems Affected Oracle Reports 6.0, 6i, 9i, 10g
Severity High Risk
Category OS command execution
Vendor URL http://www.oracle.com
Author Alexander Kornbrust (ak at red-database-security.com)
Date 19 July 2005 (V 1.00)
Advisory AKSEC2003-014
Inital bug report 663 days ago

Details
Oracle Reports is Oracle's award-winning, high-fidelity enterprise reporting tool. It enables businesses to give immediate access to information to all levels within and outside of the organization in an unrivaled scalable and secure environment.
Oracle Reports, a component of the Oracle Application Server, is used by Oracle itself for the E-Business Suite. Many large customers are using Oracle Reports as reporting tool for their enterprise applications.

Oracle Reports starts reports executables (*.rep or *.rdf) from any directory and any user on the application server. These reports are executed as user Oracle or System (Windows). An attacker which is able to upload a specially crafted reports executable to the application server is able to run any OS command or read and write text files on the application server (e.g. wdbsvr.app containing Oracle passwords). He can overtake the application server. The upload could be done via Webdav (Part of the Oracle Application Server), Webutil, SMB, SAMBA, NFS, FTP, …

By using the report parameter with an absolute path it is possible to execute reports executables from ANY directory and ANY user.

Testcase:

  1. Create or modify a simple report and add an ORA_FFI call to run OS commands or a TEXT_IO call to create or read text files on the application server.
    Details how to call OS Program/Command from Reports (Metalink ID: 181086.1) or Read and Write Textfiles Using TEXT_IO (Metalink: 33247.1) are available on Oracle Metalink.

  2. Generate the reports executable (e.g. hacker.rdf or hacker.rep) for the destination platform (e.g. Linux, Solaris, Windows, …)

  3. Copy the reports executable hacker.rdf to a directory on the Oracle Application Server
    (e.g. via SMB, file upload, Webdav, Samba, NFS, Webutil, FTP, …)

  4. Run the report "hacker.rdf" as user Oracle and specify an absolute path for the reports executable
    http://myserver.com:7779/reports/rwservlet?server=repserv+report=/tmp/hacker.rdf+destype=cache+desformat=PDF

  5. The host command is executed (ORA_FFI) or a file could be read/write (TEXT_IO) as user Oracle (Unix) or user SYTEM (Windows).

Workaround for Oracle Reports 6.0, 6i, 9i and 10g
Do not allow users to upload content to the Application Server (e.g. via SMB, Webdav, SAMBA, FTP, …)

or

Use URLRewrite to block potential dangerous URLs with report parameter and absolute or relative paths.
Block the following strings: "report=…", "report=/","report=c:\", "report=d:\" …

If you need different locations for your reports you could specify these locations in the REPORTS90_PATH / REPORTS60_PATH.

Patch Information
This bug is NOT FIXED with Critical Patch Update July 2005 (CPU July 2005). It seems that Oracle is NOT INTERESTED to fix this issue and provide patches.

History
25-sep-2003 Oracle secalert was informed

26-sep-2003 Bug confirmed

15-apr-2005 Red-Database-Security informed Oracle secalert that this vulnerability will publish after CPU July 2005
Red-Database-Security offered Oracle more time if it is not possible to provide a fix ==> NO FEEDBACK.

12-jul-2005 Oracle published CPU July 2005 without fixing this issue

18-jul-2005 Red-Database-Security published this advisory