# Oracle Database TNS Poisoning Attacks (CVE-2012-1675)

- URL: https://www.integrigy.com/security-resources/oracle-database-tns-poisoning-attacks-cve-2012-1675
- Published: 2016-09-29
- Type: Webinar
- Products: Oracle Database
- Focus areas: Vulnerabilities
- Applies to: DB 10g, DB 11g, DB 12c
- CVE IDs: CVE-2012-1675
- PDF: https://www.integrigy.com/sites/default/files/Integrigy%20Oracle%20TNS%20Poisoning%20Attacks.pdf
- Recording: https://www.youtube.com/watch?v=0IKltOBXiII

> Webinar on the TNS Poison attack (CVE-2012-1675), which lets an unauthenticated attacker intercept and modify traffic between Oracle Database clients and servers, and the manual listener changes that fix it.

In 2012, details were published of a vulnerability in the Oracle Database listener, CVE-2012-1675, that lets an attacker register with the listener and intercept and modify TNS network traffic between the client and the database server. This "TNS Poison" attack needs only network connectivity, with no authentication. The fix Oracle announced in April 2012 was not in a Critical Patch Update: databases before 12c need manual changes to the listener, and in 2016, 60% of the databases we assessed were still vulnerable.

We demonstrate a TNS poison attack that compromises an Oracle database without any database authentication, and cover the remediation each database version requires and how to check whether a database is protected, so DBAs can secure every listener.

## Key Points

- Listener registration lets a database register dynamically with the TNS listener, and remote registration, used by RAC, lets an attacker register the same service, so that the listener "load balances" user connections to the attacker's TNS proxy, which captures and injects traffic and forwards it to the database.
- Reported to Oracle in 2008, CVE-2012-1675 (CVSS 2.0 base score 7.5, no privileges or authentication needed) affects all versions of Oracle Database and is not patched by an SPU or PSU: Oracle's April 30, 2012 one-off advisory gave only work-arounds, and in June 2014 Oracle confirmed 11.2.0.4 vulnerable, so the listener configuration must be secured.
- Mitigation depends on the version: SSL encryption with certificates (see the Advanced Security Option) works on all, Class of Secure Transport (COST, MOS Doc ID 1453883.1, or 1340831.1 for RAC) from 10.2.0.3 and is required for 10.2.0.3 through 11.2.0.3, and valid node checking registration (VNCR, Doc ID 1600630.1) from 11.2.0.4; all these releases are now desupported.
- `VALID_NODE_CHECKING_REGISTRATION_<listener_name>` takes `OFF` (0), the 11.2.0.4 default, `ON` or `LOCAL` (1), the 12.1.0.x default, or `SUBNET` (2), which lets every machine in the subnet register, and `REGISTRATION_INVITED_NODES_<listener-name>` lists the hosts allowed to register as IPs, hostnames, CIDR subnets or IPv4 wildcards (*).
- Use the actual listener name: the `VALID_NODE_CHECKING_REGISTRATION_LISTENER` in many examples works only if the listener is named LISTENER, `VALID_NODE_CHECKING_REGISTRATION` without a listener name does not work, and although 12c is secure by default, some My Oracle Support (MOS) notes recommended disabling VNCR.
- Check `listener.ora` for the mitigation steps or scan with nmap's `oracle-tns-poison` script, for example `nmap -Pn -sT --script=+oracle-tns-poison -p 1521 192.168.2.18`; the public proof of concept poisons the listener with `tnspoisonv1.py` and forwards client connections through `proxy.py`.
