Vulnerabilities > CVE-2012-3132 - SQL Injection vulnerability in Oracle Database Server

047910
CVSS 6.5 - MEDIUM
Attack vector
NETWORK
Attack complexity
LOW
Privileges required
SINGLE
Confidentiality impact
PARTIAL
Integrity impact
PARTIAL
Availability impact
PARTIAL
network
low complexity
oracle
CWE-89
nessus

Summary

SQL injection vulnerability in Oracle Database Server 10.2.0.3, 10.2.0.4, 10.2.0.5, 11.1.0.7, 11.2.0.2, and 11.2.0.3 allows remote authenticated users to execute arbitrary SQL commands via vectors involving CREATE INDEX with a CTXSYS.CONTEXT INDEXTYPE and DBMS_STATS.GATHER_TABLE_STATS.

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Command Line Execution through SQL Injection
    An attacker uses standard SQL injection methods to inject data into the command line for execution. This could be done directly through misuse of directives such as MSSQL_xp_cmdshell or indirectly through injection of data into the database that would be interpreted as shell commands. Sometime later, an unscrupulous backend application (or could be part of the functionality of the same application) fetches the injected data stored in the database and uses this data as command line arguments without performing proper validation. The malicious data escapes that data plane by spawning new commands to be executed on the host.
  • Object Relational Mapping Injection
    An attacker leverages a weakness present in the database access layer code generated with an Object Relational Mapping (ORM) tool or a weakness in the way that a developer used a persistence framework to inject his or her own SQL commands to be executed against the underlying database. The attack here is similar to plain SQL injection, except that the application does not use JDBC to directly talk to the database, but instead it uses a data access layer generated by an ORM tool or framework (e.g. Hibernate). While most of the time code generated by an ORM tool contains safe access methods that are immune to SQL injection, sometimes either due to some weakness in the generated code or due to the fact that the developer failed to use the generated access methods properly, SQL injection is still possible.
  • SQL Injection through SOAP Parameter Tampering
    An attacker modifies the parameters of the SOAP message that is sent from the service consumer to the service provider to initiate a SQL injection attack. On the service provider side, the SOAP message is parsed and parameters are not properly validated before being used to access a database in a way that does not use parameter binding, thus enabling the attacker to control the structure of the executed SQL query. This pattern describes a SQL injection attack with the delivery mechanism being a SOAP message.
  • Expanding Control over the Operating System from the Database
    An attacker is able to leverage access gained to the database to read / write data to the file system, compromise the operating system, create a tunnel for accessing the host machine, and use this access to potentially attack other machines on the same network as the database machine. Traditionally SQL injections attacks are viewed as a way to gain unauthorized read access to the data stored in the database, modify the data in the database, delete the data, etc. However, almost every data base management system (DBMS) system includes facilities that if compromised allow an attacker complete access to the file system, operating system, and full access to the host running the database. The attacker can then use this privileged access to launch subsequent attacks. These facilities include dropping into a command shell, creating user defined functions that can call system level libraries present on the host machine, stored procedures, etc.
  • SQL Injection
    This attack exploits target software that constructs SQL statements based on user input. An attacker crafts input strings so that when the target software constructs SQL statements based on the input, the resulting SQL statement performs actions other than those the application intended. SQL Injection results from failure of the application to appropriately validate input. When specially crafted user-controlled input consisting of SQL syntax is used without proper validation as part of SQL queries, it is possible to glean information from the database in ways not envisaged during application design. Depending upon the database and the design of the application, it may also be possible to leverage injection to have the database execute system-related commands of the attackers' choice. SQL Injection enables an attacker to talk directly to the database, thus bypassing the application completely. Successful injection can cause information disclosure as well as ability to add or modify data in the database. In order to successfully inject SQL and retrieve information from a database, an attacker:

Nessus

  • NASL familyDatabases
    NASL idORACLE_RDBMS_CPU_JUL_2012.NASL
    descriptionThe remote Oracle database server is missing the July 2012 Critical Patch Update (CPU) and is, therefore, potentially affected by security issues in the following components : - Enterprise Manager - Network Layer - Core RDBMS
    last seen2020-06-02
    modified2012-07-19
    plugin id60048
    published2012-07-19
    reporterThis script is Copyright (C) 2012-2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/60048
    titleOracle Database Multiple Vulnerabilities (July 2012 CPU)
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    
    
    include("compat.inc");
    
    if (description)
    {
      script_id(60048);
      script_version("1.18");
      script_set_attribute(attribute:"plugin_modification_date", value:"2020/06/01");
    
      script_cve_id(
        "CVE-2012-1737",
        "CVE-2012-1745",
        "CVE-2012-1746",
        "CVE-2012-1747",
        "CVE-2012-3132",
        "CVE-2012-3134"
      );
      script_bugtraq_id(54496, 54501, 54507, 54518, 54569, 54884);
    
      script_name(english:"Oracle Database Multiple Vulnerabilities (July 2012 CPU)");
      script_summary(english:"Checks installed patch info");
    
      script_set_attribute(attribute:"synopsis", value:
    "The remote database server is affected by multiple
    vulnerabilities.");
    
      script_set_attribute(attribute:"description", value:
    "The remote Oracle database server is missing the July 2012 Critical
    Patch Update (CPU) and is, therefore, potentially affected by security
    issues in the following components :
    
      - Enterprise Manager
    
      - Network Layer
    
      - Core RDBMS");
    
       # https://www.oracle.com/technetwork/topics/security/cpujul2012-392727.html
      script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?07dc310c");
      script_set_attribute(attribute:"solution", value:
    "Apply the appropriate patch according to the July 2012 Oracle Critical
    Patch Update advisory.");
      script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:N/C:P/I:P/A:P");
      script_set_cvss_temporal_vector("CVSS2#E:U/RL:OF/RC:C");
      script_set_attribute(attribute:"exploitability_ease", value:"No known exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"false");
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2012/07/17");
      script_set_attribute(attribute:"patch_publication_date", value:"2012/07/17");
      script_set_attribute(attribute:"plugin_publication_date", value:"2012/07/19");
    
      script_set_attribute(attribute:"cpe", value:"cpe:/a:oracle:database_server");
      script_set_attribute(attribute:"plugin_type", value:"combined");
      script_set_attribute(attribute:"agent", value:"all");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_family(english:"Databases");
    
      script_copyright(english:"This script is Copyright (C) 2012-2020 and is owned by Tenable, Inc. or an Affiliate thereof.");
    
      script_dependencies("oracle_rdbms_query_patch_info.nbin", "oracle_rdbms_patch_info.nbin");
    
      exit(0);
    }
    
    include("oracle_rdbms_cpu_func.inc");
    
    ################################################################################
    # JUL2012
    patches = make_nested_array();
    
    # RDBMS 11.1.0.7
    patches["11.1.0.7"]["db"]["nix"] = make_array("patch_level", "11.1.0.7.12", "CPU", "14038803, 13923474");
    patches["11.1.0.7"]["db"]["win32"] = make_array("patch_level", "11.1.0.7.47", "CPU", "14109867");
    patches["11.1.0.7"]["db"]["win64"] = make_array("patch_level", "11.1.0.7.47", "CPU", "14109868");
    # RDBMS 11.2.0.2
    patches["11.2.0.2"]["db"]["nix"] = make_array("patch_level", "11.2.0.2.7", "CPU", "14038791, 13923804");
    patches["11.2.0.2"]["db"]["win32"] = make_array("patch_level", "11.2.0.2.20", "CPU", "14134042");
    patches["11.2.0.2"]["db"]["win64"] = make_array("patch_level", "11.2.0.2.20", "CPU", "14134043");
    # RDBMS 11.2.0.3
    patches["11.2.0.3"]["db"]["nix"] = make_array("patch_level", "11.2.0.3.3", "CPU", "14038787, 13923374");
    patches["11.2.0.3"]["db"]["win32"] = make_array("patch_level", "11.2.0.3.7", "CPU", "14223717");
    patches["11.2.0.3"]["db"]["win64"] = make_array("patch_level", "11.2.0.3.7", "CPU", "14223718");
    # RDBMS 10.2.0.5
    patches["10.2.0.5"]["db"]["nix"] = make_array("patch_level", "10.2.0.5.8", "CPU", "14038805, 13923855");
    patches["10.2.0.5"]["db"]["win32"] = make_array("patch_level", "10.2.0.5.17", "CPU", "14134051");
    patches["10.2.0.5"]["db"]["win64"] = make_array("patch_level", "10.2.0.5.17", "CPU", "14134053");
    # RDBMS 10.2.0.4
    patches["10.2.0.4"]["db"]["nix"] = make_array("patch_level", "10.2.0.4.13", "CPU", "14038814, 13923851");
    
    check_oracle_database(patches:patches);
    
  • NASL familyDatabases
    NASL idORACLE_RDBMS_CPU_OCT_2012.NASL
    descriptionThe remote Oracle database server is missing the October 2012 Critical Patch Update (CPU) and is, therefore, potentially affected by security issues in the Core RDBMS.
    last seen2020-06-02
    modified2012-10-23
    plugin id62662
    published2012-10-23
    reporterThis script is Copyright (C) 2012-2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/62662
    titleOracle Database Multiple Vulnerabilities (October 2012 CPU)
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    
    
    
    
    include("compat.inc");
    
    if (description)
    {
      script_id(62662);
      script_version("1.16");
      script_set_attribute(attribute:"plugin_modification_date", value:"2020/06/01");
    
      script_cve_id(
        "CVE-2012-1751",
        "CVE-2012-3132",
        "CVE-2012-3137",
        "CVE-2012-3146",
        "CVE-2012-3151"
      );
      script_bugtraq_id(
        54884,
        55651,
        55947,
        55949,
        55950
      );
    
      script_name(english:"Oracle Database Multiple Vulnerabilities (October 2012 CPU)");
      script_summary(english:"Checks installed patch info");
    
      script_set_attribute(attribute:"synopsis", value:
    "The remote database server is affected by multiple vulnerabilities.");
      script_set_attribute(attribute:"description", value:
    "The remote Oracle database server is missing the October 2012 Critical
    Patch Update (CPU) and is, therefore, potentially affected by security
    issues in the Core RDBMS.");
      script_set_attribute(attribute:"see_also", value:"https://www.securityfocus.com/archive/1/525765/30/0/threaded");
      script_set_attribute(attribute:"see_also", value:"https://www.securityfocus.com/archive/1/525766/30/0/threaded");
      # https://www.oracle.com/technetwork/topics/security/cpuoct2012-1515893.html
      script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?87547c81");
      script_set_attribute(attribute:"solution", value:
    "Apply the appropriate patch according to the October 2012 Oracle
    Critical Patch Update advisory.");
      script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:S/C:P/I:P/A:P");
      script_set_cvss_temporal_vector("CVSS2#E:POC/RL:OF/RC:C");
      script_set_attribute(attribute:"cvss_score_source", value:"CVE-2012-3132");
    
      script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"true");
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2012/07/28");
      script_set_attribute(attribute:"patch_publication_date", value:"2012/10/18");
      script_set_attribute(attribute:"plugin_publication_date", value:"2012/10/23");
    
      script_set_attribute(attribute:"plugin_type", value:"combined");
      script_set_attribute(attribute:"cpe", value:"cpe:/a:oracle:database_server");
      script_set_attribute(attribute:"agent", value:"all");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_family(english:"Databases");
    
      script_copyright(english:"This script is Copyright (C) 2012-2020 and is owned by Tenable, Inc. or an Affiliate thereof.");
    
      script_dependencies("oracle_rdbms_query_patch_info.nbin", "oracle_rdbms_patch_info.nbin");
    
      exit(0);
    }
    
    include("oracle_rdbms_cpu_func.inc");
    
    ################################################################################
    # OCT2012
    patches = make_nested_array();
    
    # RDBMS 11.1.0.7
    patches["11.1.0.7"]["db"]["nix"] = make_array("patch_level", "11.1.0.7.13", "CPU", "14390384, 14275623");
    patches["11.1.0.7"]["db"]["win32"] = make_array("patch_level", "11.1.0.7.50", "CPU", "14672312");
    patches["11.1.0.7"]["db"]["win64"] = make_array("patch_level", "11.1.0.7.50", "CPU", "14672313");
    # RDBMS 11.2.0.2
    patches["11.2.0.2"]["db"]["nix"] = make_array("patch_level", "11.2.0.2.8", "CPU", "14390377, 14275621");
    patches["11.2.0.2"]["db"]["win32"] = make_array("patch_level", "11.2.0.2.22", "CPU", "14672267");
    patches["11.2.0.2"]["db"]["win64"] = make_array("patch_level", "11.2.0.2.22", "CPU", "14672268");
    # RDBMS 11.2.0.3
    patches["11.2.0.3"]["db"]["nix"] = make_array("patch_level", "11.2.0.3.4", "CPU", "14390252, 14275605");
    patches["11.2.0.3"]["db"]["win32"] = make_array("patch_level", "11.2.0.3.11", "CPU", "14613222");
    patches["11.2.0.3"]["db"]["win64"] = make_array("patch_level", "11.2.0.3.11", "CPU", "14613223");
    # RDBMS 10.2.0.5
    patches["10.2.0.5"]["db"]["nix"] = make_array("patch_level", "10.2.0.5.9", "CPU", "14390396, 14275629");
    patches["10.2.0.5"]["db"]["win32"] = make_array("patch_level", "10.2.0.5.19", "CPU", "14553356");
    patches["10.2.0.5"]["db"]["win64"] = make_array("patch_level", "10.2.0.5.19", "CPU", "14553358");
    # RDBMS 10.2.0.4
    patches["10.2.0.4"]["db"]["nix"] = make_array("patch_level", "10.2.0.4.14", "CPU", "14390410, 14275630");
    
    check_oracle_database(patches:patches);