CVE-2012-2739: Medium severity Oracle JDK vulnerability

Published Nov 1, 2011
·
Updated

Julian Wälde and Alexander Klink reported that the String.hashCode() hash function is not sufficiently collision resistant. hashCode() value is used in the implementations of HashMap and Hashtable classes:

http://docs.oracle.com/javase/6/docs/api/java/util/HashMap.html http://docs.oracle.com/javase/6/docs/api/java/util/Hashtable.html

A specially-crafted set of keys could trigger hash function collisions, which can degrade performance of HashMap or Hashtable by changing hash table operations complexity from an expected/average O(1) to the worst case O(n). Reporters were able to find colliding strings efficiently using equivalent substrings and meet in the middle techniques.

This problem can be used to start a denial of service attack against Java applications that use untrusted inputs as HashMap or Hashtable keys. An example of such application is web application server (such as tomcat, see bug #750521) that may fill hash tables with data from HTTP request (such as GET or POST parameters). A remote attack could use that to make JVM use excessive amount of CPU time by sending a POST request with large amount of parameters which hash to the same value.

This problem is similar to the issue that was previously reported for and fixed in e.g. perl: http://www.cs.rice.edu/~scrosby/hash/CrosbyWallachUsenixSec2003.pdf

Other sources

Oracle Java SE before 7 Update 6, and OpenJDK 7 before 7u6 build 12 and 8 before build 39, computes hash values without restricting the ability to trigger hash collisions predictably, which allows context-dependent attackers to cause a denial of service (CPU consumption) via crafted input to an application that maintains a hash table.

Affected Software

15 affected components
Oracle JDK<=1.7.0
Oracle JDK=1.7.0
Oracle JDK=1.7.0-update1
Oracle JDK=1.7.0-update2
Oracle JDK=1.7.0-update3
Oracle JDK=1.7.0-update4
ORACLE JRE<=1.7.0
ORACLE JRE=1.7.0
ORACLE JRE=1.7.0-update1
ORACLE JRE=1.7.0-update2
ORACLE JRE=1.7.0-update3
ORACLE JRE=1.7.0-update4
ORACLE OpenJDK<=1.7.0
ORACLE OpenJDK=1.6.0
ORACLE OpenJDK=1.8.0

Event History

Nov 1, 2011
Data Sourced
02:13 PM
DescriptionSeverityAffected Software
Nov 28, 2012
CVE Published
via MITRE·11:00 AM
Data Sourced
via MITRE·11:00 AM
Description

Frequently Asked Questions

1

What is the severity of CVE-2012-2739?

CVE-2012-2739 has been assigned a medium severity rating due to its potential for denial of service attacks through hash collisions.

2

How do I fix CVE-2012-2739?

To remediate CVE-2012-2739, upgrade to the latest version of Oracle JDK, Oracle JRE, or OpenJDK that is not affected by this vulnerability.

3

What are the potential impacts of CVE-2012-2739?

CVE-2012-2739 could allow attackers to execute denial of service attacks by exploiting hash collision vulnerabilities, which could degrade application performance.

4

Which software versions are affected by CVE-2012-2739?

CVE-2012-2739 affects Oracle JDK versions 1.7.0 and earlier, along with Oracle JRE and OpenJDK versions up to 1.7.0.

5

Can CVE-2012-2739 be exploited remotely?

Yes, CVE-2012-2739 can be exploited remotely if an application uses the vulnerable String.hashCode() method in its data structure handling.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203