CVE-2011-4815: Input Validation

Published Nov 1, 2011
·
Updated

Julian Wälde and Alexander Klink reported a flaw in the hash function used in the implementation of the Ruby arrays implemented using the hash table.

A specially-crafted set of keys could trigger hash function collisions, which degrade hash table performance 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 or meet in the middle techniques.

As various web application frameworks for Ruby automatically pre-fill certain arrays with data from the HTTP request (such as GET or POST parameters) for Ruby web application, a remote attacker could use this flaw to make Ruby interpreter 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

Note: This issue did not affect Ruby 1.9, which already randomizes hash function in a similar way perl does.

Other sources

Ruby (aka CRuby) before 1.8.7-p357 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.

— MITRE

Affected Software

5 affected components
ruby-lang Ruby=1.8.7-p334
ruby-lang Ruby=1.8.7-p330
ruby-lang Ruby=1.8.7-p302
ruby-lang Ruby=1.8.7-p299
ruby-lang Ruby<=1.8.7-p352

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade Ruby to a version that resolves this vulnerability.

    Fixed in 1.8.7-p357

Event History

Nov 1, 2011
Data Sourced
via Red Hat·03:21 PM
DescriptionSeverityAffected Software
Dec 30, 2011
CVE Published
via MITRE·01:00 AM
Data Sourced
via MITRE·01:00 AM
Description
Data Sourced
01:55 AM
DescriptionWeaknessAffected Software
Data Sourced
via NVD·01:55 AM
DescriptionSeverityWeaknessAffected Software
Aug 29, 2017
Data Sourced
01:30 AM
Severity

Frequently Asked Questions

1

What is the severity of CVE-2011-4815?

CVE-2011-4815 is classified as a denial of service vulnerability due to its potential to cause excessive CPU consumption.

2

How do I fix CVE-2011-4815?

To fix CVE-2011-4815, upgrade Ruby to version 1.8.7-p357 or later.

3

What software versions are affected by CVE-2011-4815?

CVE-2011-4815 affects Ruby versions 1.8.7-p299 through 1.8.7-p352.

4

What kind of attack does CVE-2011-4815 facilitate?

CVE-2011-4815 allows context-dependent attackers to trigger hash collisions, leading to denial of service.

5

Is CVE-2011-4815 specific to a certain operating system?

CVE-2011-4815 is related to the Ruby programming language and is not specific to any particular operating system.

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