Digital Security Research Group [DSecRG] Advisory #DSECRG-08-018
Application: Ruby 1.8.6 (WEBrick Web server Toolkit and applications that used WEBrick, like Metasploit 3.1)
Versions Affected: Ruby
1.8.4 and all prior versions
1.8.5-p114 and all prior versions
1.8.6-p113 and all prior versions
1.9.0-1 and all prior version
Vendor URL: http://www.ruby-lang.org/
Bugs: Directory traversal File Download
Vendor response: 22.02.2008
Date of Public Advisory: 06.03.2008
Authors: Alexandr Polyakov, Stas Svistunovich
Digital Security Research Group [DSecRG] (research [at] dsec [dot] ru)
WEBrick Httpd server has directory traversal security vulnerability.
WEBrick is an HTTP server library written in Ruby that uses servlets to extend its capabilities.
Built into WEBrick are four servlets, handling CGI, ERb, file directories, and a generic Proc servlet.
Ruby on Rails uses WEBrick as a quick and easy webserver to start developing your Rails applications.
However, for whatever ease of development WEBrick adds to your application, it is generally considered not suitable for any production environment.
The following programs are vulnerable.
Programs that publish files using WEBrick::HTTPServer.new with the :DocumentRoot option
Programs that publish files using WEBrick::HTTPServlet::FileHandler
Affected systems are:
1. Systems that accept backslash (\) as a path separator, such as Windows.
2. Systems that use case insensitive filesystems such as NTFS on Windows, HFS on Mac OS X.
This vulnerability has the following impacts.
1. Attacker can access private files by sending a url with url encoded backslash (\). This exploit works only on systems that accept backslash as a path separator.
2. Attacker can access files that matches to the patterns specified by the :NondisclosureName option (the default value is [".ht*", "*~"]). This exploit works only on systems that use case insensitive filesystems.
WEBrick is used to build own HTTP servers and used in many applications such as Metasploit 3.1 and Karma Tools
fixed on 03.03.2008.
Patches can be downloaded here:
Please upgrade to 1.8.5-p115 or 1.8.6-p114.