Description
The BigDecimal library in Ruby 1.8.6 before p369 and 1.8.7 before p173 allows context-dependent attackers to cause a denial of service (application crash) via a string argument that represents a large number, as demonstrated by an attempted conversion to the Float data type.
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 5.0 | ruby1.8 | 1.8.7.72-3lenny1 | DSA-1860-1 |
| Debian 5.0 | ruby1.9 | 1.9.0.2-9lenny1 | DSA-1860-1 |
| Debian 4.0 | ruby1.8 | 1.8.5-4etch5 | DSA-1860-1 |
| Debian 4.0 | ruby1.9 | 1.9.0+20060609-1etch5 | DSA-1860-1 |
Red Hat
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| RHEL 5 | ruby +8 | 1.8.5-5.el5_3.7 | RHSA-2009:1140 |
| RHEL 4 | irb +6 | 1.8.1-7.el4_8.3 | RHSA-2009:1140 |
Public exploits
Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.
GitHub 1 repository
-
NZKoz/bigdecimal-segfault-fix ★ 14 · Jun 8, 2009
Provides a quick workaround for the segfault bug in Ruby (CVE-2009-1904)
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
Advisories 2
- RHSA-2009:1140 Red Hat Security Advisory: ruby security update Red Hat Security Advisories (RHSA) · Jun 26, 2026
- DSA-1860-1 ruby1.8 ruby1.9 - several issues Debian Security (DSA / DLA) · Mar 9, 2026
References
- ADV-2009-1563 vdb-entry
- 35937 third-party-advisory
- 35593 third-party-advisory
- http://www.ruby-lang.org/en/news/2009/06/09/dos-vulnerability-in-bigdecimal/
- http://redmine.ruby-lang.org/issues/show/794
- https://bugs.launchpad.net/bugs/cve/2009-1904
- http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=532689
- RHSA-2009:1140 vendor-advisory
- [pkgsrc-changes] 20090610 CVS commit: pkgsrc/lang/ruby18-base mailing-list
- [rubyonrails-security] 20090610 DoS Vulnerability in Ruby (CVE-2009-1904) mailing-list
- 1022371 vdb-entry
- oval:org.mitre.oval:def:9780 vdb-entry signature
- APPLE-SA-2010-03-29-1 vendor-advisory
- 35399 third-party-advisory
- http://github.com/NZKoz/bigdecimal-segfault-fix/tree/master
- http://weblog.rubyonrails.org/2009/6/10/dos-vulnerability-in-ruby/
- USN-805-1 vendor-advisory
- FEDORA-2009-13066 vendor-advisory
- 55031 vdb-entry
- 35278 vdb-entry
- http://bugs.gentoo.org/show_bug.cgi?id=273213
- 37705 third-party-advisory
- http://support.apple.com/kb/HT4077
- 35699 third-party-advisory
- https://bugs.launchpad.net/bugs/385436
- GLSA-200906-02 vendor-advisory
- MDVSA-2009:160 vendor-advisory
- http://www.ruby-forum.com/topic/189071
- ruby-bigdecimal-dos(51032) vdb-entry
- 35527 third-party-advisory
- SSA:2009-170-02 vendor-advisory