CVE-2012-5370: JRuby Denial of Service via Hash Collision
Summary
CVE-2012-5370: JRuby denial of service via Hash Collision. Affects org.jruby:jruby-parent versions < 1.7.1. Fixed in 1.7.1. How to fix ↓
Also tracked for
- jruby · Debian:12
The same CVE-2012-5370 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
JRuby is an implementation of the Ruby programming language that runs on the Java Virtual Machine (JVM). It provides a seamless integration between Ruby and Java, allowing developers to leverage the power of both languages. The 'org.jruby:jruby-parent' package is a Maven package that serves as the parent POM for JRuby projects, providing common configuration and dependencies. This vulnerability affects versions of JRuby prior to 1.7.1.
Vulnerability Detail
The vulnerability in JRuby stems from its computation of hash values without properly restricting the ability to trigger hash collisions predictably. This allows context-dependent attackers to cause a denial of service (CPU consumption) by exploiting crafted input to an application that maintains a hash table. The vulnerability is demonstrated through a universal multicollision attack against the MurmurHash2 algorithm. It is important to note that this vulnerability is different from CVE-2011-4838.
How To Fix
Minimum fixed version
1.7.1
This is the first release that contains the fix.
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
There is no specific workaround mentioned for this vulnerability. However, as a general best practice, it is recommended to follow secure coding practices and input validation to minimize the risk of exploitation.
Conclusion
The vulnerability in JRuby versions prior to 1.7.1 allows context-dependent attackers to cause a denial of service by exploiting hash collisions. To mitigate this vulnerability, it is crucial to update the 'org.jruby:jruby-parent' package to version 1.7.1 or later. Additionally, following secure coding practices and input validation can help minimize the risk of exploitation. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for org.jruby:jruby-parent →
FAQ
JRuby is an implementation of the Ruby programming language that runs on the Java Virtual Machine (JVM). It provides a seamless integration between Ruby and Java.
The 'org.jruby:jruby-parent' package is a Maven package that serves as the parent POM for JRuby projects, providing common configuration and dependencies.
A hash collision occurs when two different inputs produce the same hash value. In this vulnerability, the ability to trigger hash collisions predictably can lead to a denial of service.
A denial of service (DoS) attack is an attempt to make a computer system or network unavailable to its intended users by overwhelming it with a flood of illegitimate requests or by exploiting vulnerabilities to consume excessive resources.
You can use Vulert's playground (https://vulert.com/scanner) to check if your application is affected by this vulnerability. Vulert monitors and alerts in real-time for open-source vulnerabilities in software using just the pom.xml file, without requiring access to the code or installation.