Bug 959916 (CVE-2009-4124)

Summary: CVE-2009-4124 ruby: Heap-based buffer overflow in the rb_str_justify() function
Product: [Other] Security Response Reporter: Jan Lieskovsky <jlieskov>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: bkabrda, jeremy, mmorsi, mtasaka, tagoh, vanmeeuwen+fedora, vondruch
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-05-06 09:12:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jan Lieskovsky 2013-05-06 08:45:27 UTC
Common Vulnerabilities and Exposures assigned an identifier CVE-2009-4124 to the following vulnerability:

Heap-based buffer overflow in the rb_str_justify function in string.c in Ruby 1.9.1 before 1.9.1-p376 allows context-dependent attackers to execute arbitrary code via unspecified vectors involving (1) String#ljust, (2) String#center, or (3) String#rjust. NOTE: some of these details are obtained from third party information. 

References:
[1] http://www.ruby-lang.org/en/news/2009/12/07/heap-overflow-in-string/
[2] http://www.securityfocus.com/bid/37278
[3] http://www.osvdb.org/60880
[4] http://secunia.com/advisories/37660
[5] http://www.vupen.com/english/advisories/2009/3471
[6] http://xforce.iss.net/xforce/xfdb/54674

Other references:
[7] http://swik.net/Ruby/Ruby+Home+Page/Ruby+1.9.1-p376+is+released/ddwsf

Comment 1 Jan Lieskovsky 2013-05-06 08:51:34 UTC
Relevant upstream patch:
[8] https://github.com/ruby/ruby/commit/1c2ef610358af33f9ded3086aa2d70aac03dcac5

Comment 2 Jan Lieskovsky 2013-05-06 08:58:21 UTC
Not vulnerable. This issue did NOT affect the versions of the ruby package, as shipped with Fedora release of 17 and 18 as the current versions already include the upstream patch, which corrected the issue.

Comment 3 Jan Lieskovsky 2013-05-06 09:12:50 UTC
Statement:

Not vulnerable. This issue did not affect the versions of ruby as shipped with Red Hat Enterprise Linux 5 and 6 as it did not affect the Ruby 1.8 series.