Register | Forget Password | Login
Search :
SecurityReason

News

Search

SecurityAlert

About SecurityAlert

ExploitAlert

SecurityReason Research

WLB

WLB Database

Send to WLB

About WLB

RSS

News

SecurityAlert

World Laboratory of Bugtraq

ExploitAlert

Apache

PHP

Corporate

Contact

About us

Services

SecurePHP

Note

If you have found a vulnerability, please send to our SecurityAlert Database :
secalert()securityreason()com

Also if you have new ( 0-day ) exploit, please send to our ExploitAlert Archive :
exploit()securityreason()com

Details : WLB-2008070006          

  Topic : Vuln name: Ruby rb_ary_fill() DOS
  WLB : WLB-2008070006  (About)
  SecurityAlert : None
  Date : 2008-07-02
  Credit          : snagg
  SecurityRisk : High  alert  (About)
  Remote : No
  Local     : Yes
  Status   : Bug

  History :
[2008-07-02] Started

  Text :  

The advisory could be found here:
http://securenetwork.it/ricerca/advisory/download/SN-2008-02.txt

Secure Network - Security Research Advisory

Vuln name: Ruby rb_ary_fill() DOS
Systems affected: ruby 1.8.x, 1.9.x
Systems not affected: -
Severity: Medium
Local/Remote: Local/Remote
Vendor URL: http://www.ruby-lang.org/
Author(s): Vincenzo "snagg" Iozzo -
snagg_at_securenetwork.it
Vendor disclosure: 23rd June 2008
Vendor acknowledged: 25th June 2008
Vendor patch release: 25th June 2008
Public disclosure: 30th June 2008
Advisory number: SN-2008-02
Advisory URL: http://www.securenetwork.it/advisories/

*** SUMMARY ***

Ruby is an interpreted language, used in a wide range of applications.
The specific issue is a Denial of Services vulnerability, caused by an
integer overflow. However it doesn't allow arbitrary code execution.
On Ruby on Rails, an attacker may craft specific requests and by XSS (for
example) can cause a legitimate user to crash the web server.


*** VULNERABILITY DETAILS ***

Integer overflow (Dos).
The vulnerability was found in rb_ary_fill().

Looking inside the application source code:
###### CUT HERE ######
rb_ary_modify(ary);
end = beg + len;
if (end < 0) {
rb_raise(rb_eArgError, "argument too big");
}
if (end > RARRAY(ary)->len) {
if (end >= RARRAY(ary)->aux.capa) {
REALLOC_N(RARRAY(ary)->ptr, VALUE, end);
RARRAY(ary)->aux.capa = end;
}

###### CUT HERE ######

The len value is incremented by one in a previous function and it is
specified by the user. The lack of sanity check on the input, leads to an
integer overflow here:

###### CUT HERE ######
REALLOC_N(RARRAY(ary)->ptr, VALUE, end);
###### CUT HERE ######

This macro, in fact, will allocate end * VALUE. On 32bit architectures
VALUE is 4. If an attacker specifies a value of 0x3fffffff, this macro
will allocate a memory region of 0, so that next time ary->ptr is
accessed, it will raise a SIGSEGV.(NULL referencing)


*** EXPLOIT ***
a = []
a.fill("A",0..0x3fffffff)

*** FIX INFORMATION ***

http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/array.c?view=markup

*********************
*** LEGAL NOTICES ***
*********************

Secure Network (www.securenetwork.it) is an information security company,
which provides consulting and training services, and engages in security
research and development.

We are committed to open, full disclosure of vulnerabilities, cooperating
with software developers for properly handling disclosure issues.

This advisory is copyright 2008 Secure Network S.r.l. Permission is
hereby granted for the redistribution of this alert, provided that it is
not altered except by reformatting it, and that due credit is given. It
may not be edited in any way without the express consent of Secure Network
S.r.l. Permission is explicitly given for insertion in vulnerability
databases and similars, provided that due credit is given to Secure
Network

The information in the advisory is believed to be accurate at the time of
publishing based on currently available information. This information is
provided as-is, as a free service to the community by Secure Network
research staff. There are no warranties with regard to this information.
Secure Network does not accept any liability for any direct, indirect,
or consequential loss or damage arising from use of, or reliance on,
this information.

If you have any comments or inquiries, or any issue with what is reported
in this advisory, please inform us as soon as possible.

E-mail: securenetwork_at_securenetwork&#46;it
GPG/PGP key: http://www.securenetwork.it/pgpkeys/Secure%20Network.asc
Phone: +39 02 24126788

If you want change this note, please use UCP


Alert

*BSD libc (strfmon) Multiple vulnerabilities

high- 2008-03-25

Maksymilian Arciemowicz discovered a Integer Overflow vulnerability in the libc library "strfmon()" function.A vulnerability could allow an attacker who successfully exploits this vulnerability to take control of the affected *BSD systems.

Apache rss

» Apache Tomcat <=
   6.0.18 UTF8 Directory
   Traversal Vulnerability

» Apache Tomcat information
   disclosure vulnerability

» Apache Tomcat XSS
   vulnerability

» Apache-SSL memory
   disclosure

PHP rss

» PHP 5.2.6 chdir(),ftok()
   (standard ext) safe_mode
   bypass

» PHP 5.2.6 posix_access()
   (posix ext) safe_mode
   bypass

» PHP 5.2.5 and prior :
   *printf() functions
   Integer Overflow

» PHP 5.2.5 cURL safe_mode
   bypass

Copyright © SecurityReason. All Rights Reserved.