Denial of Service Vulnerability in JRuby: Hash Collision Attack

jruby Updated 02 Oct 2025

Summary

28/11/2012
N/A
Yes i
Unrated
Not published

DEBIAN-CVE-2012-5370: JRuby computes hash values without properly 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... Affects jruby versions < 1.5.6-5. Fixed in 1.5.6-5. How to fix ↓

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

JRuby is an implementation of the Ruby programming language on the Java Virtual Machine (JVM). It allows Ruby applications to run on the JVM, enabling the use of Java libraries and providing performance benefits. However, JRuby has a vulnerability that allows attackers to exploit hash collisions, potentially leading to denial of service (DoS) conditions in applications that utilize hash tables.

Vulnerability Detail

The vulnerability identified as CVE-2012-5370 arises from JRuby's method of computing hash values without adequately restricting the ability to trigger hash collisions. This flaw allows context-dependent attackers to craft specific input that can cause excessive CPU consumption, leading to denial of service. The vulnerability is particularly concerning as it can be exploited through a universal multicollision attack against the MurmurHash2 algorithm, which is used in JRuby's hash table implementation.

How To Fix

Minimum fixed version

1.5.6-5

This is the first release that contains the fix.

sudo apt-get install --only-upgrade jruby

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, developers can implement input validation to limit the types of data that can be processed by the application, thereby reducing the risk of triggering hash collisions. Additionally, consider using alternative hash algorithms that are less susceptible to collision attacks.

Conclusion

The vulnerability CVE-2012-5370 in JRuby poses a significant risk by allowing denial of service attacks through hash collisions. It is crucial for developers to update to the patched version 1.5.6-5 to safeguard their applications. In the meantime, implementing workarounds can help mitigate the risk until an update can be applied.

See every vulnerability recorded for jruby →

Share this vulnerability

FAQ

CVE-2012-5370 is a vulnerability in JRuby that allows attackers to exploit hash collisions, potentially leading to denial of service.

You can check if your application is affected by using the Vulert playground at Vulert Scanner, which analyzes your manifest file for vulnerabilities.

The primary consequence is denial of service, where an attacker can cause the application to consume excessive CPU resources, leading to performance degradation or crashes.

Yes, the patched version of JRuby is 1.5.6-5. Updating to this version will mitigate the vulnerability.

If immediate updates are not possible, implement input validation and consider using alternative hashing algorithms to reduce the risk of exploitation.

Related vulnerabilities

Recent vulnerabilities recorded for jruby.

How To Fix

Minimum fixed version

1.5.6-5

This is the first release that contains the fix.

sudo apt-get install --only-upgrade jruby

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback