the last unbiased stronghold

Trustix Secure Linux Security Advisory 2007.6

Trustix Secure Linux Security Advisory 2007.6
Posted Sep 30, 2007
Authored by Chris Clark | Site isecpartners.com

A vulnerability results from the Net::HTTPS library from Ruby versions 1.8.5 and 1.8.6 failing to validate the name on the SSL certificate against the DNS name requested by the user. By not validating the name, the library allows an attacker to present a cryptographically valid certificate with an invalid CN.

tags | advisory, web, ruby
MD5 | f43ab01ee2c728fcf04ea146cfb06364

Trustix Secure Linux Security Advisory 2007.6

Change Mirror Download
iSEC Partners Security Advisory - 2007-006-RubySSL
http://www.isecpartners.com
--------------------------------------------

Ruby Net::HTTPS library does not validate server certificate CN

Vendor: Ruby
Vendor URL: http://www.ruby-lang.org
Versions affected: 1.8.5, 1.8.6, Trunk Ruby
Systems Affected: All Ruby Platforms
Severity: Medium - Compromise of SSL connection integrity
Author: Chris Clark <cclark[at]isecpartners[dot]com>

Vendor notified: Yes
Public release: Yes
Advisory URL: http://www.isecpartners.com/advisories/2007-006-rubyssl.txt

Summary:
--------
The Ruby Net::HTTP and Net::HTTPS library can be used to make HTTP or HTTPS
connections to remote websites. There are several methods for performing these
types of connections within the Ruby standard library but the Net::HTTP library
is recommended going forward.

A vulnerability results from the Net::HTTPS library failing to validate the name
on the SSL certificate agains the DNS name requested by the user. By not
validating the name, the library allows an attacker to present a
cryptographically valid certificate with an invalid CN.

Details:
--------
The vulnerability is caused by the method connect within http.rb file failing to
call post_connection_check after the SSL connection has been negotiated. Since
the server certificates CN is not validated against the requested DNS name,
the attacker can impersonate the target server in a SSL connection. The
integrity and confidentiality benefits of SSL are removed by this vulnerability.

Example:

If the application uses the following code to connect to the ip address of
https://www.citicards.com:

url = "192.193.222.24" #www.citicards.com IP
path = "/"
http = Net::HTTP.new(url, 443)
http.use_ssl = true
http.ca_file = "verisign.pem"
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
resp, data = http.get(path, nil)

The connection will succeed. This is an obvious failure as the certificate
presented has a CN of www.citicards.com. One caveat is that the attacker must
possess a certificate signed by the CA specified in the ca_file attribute.


Fix Information:
----------------
This issue has been addressed by adding the appropriate post connection check
within http.rb. These patches add the enable_post_connection parameter, which
if set to true, will cause the Net::HTTP library to raise an exception when the
post connection check fails.

The following trunk Ruby checkin contains the related changes:
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=13499
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=13500

Ruby 1.8.5:
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=13502

Ruby 1.8.6:
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=13504


Thanks to:
----------
Rachel Engel, GOTOU Yuuzou, and Minero Aoki

About iSEC Partners:
--------------------
iSEC Partners is a full-service security consulting firm that provides
penetration testing, secure systems development, security education
and software design verification, with offices in San Francisco,
Seattle, Ewa Beach, and Los Angeles.

http://www.isecpartners.com
info@isecpartners.com

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

May 2012

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    37 Files
  • 2
    May 2nd
    53 Files
  • 3
    May 3rd
    33 Files
  • 4
    May 4th
    4 Files
  • 5
    May 5th
    10 Files
  • 6
    May 6th
    17 Files
  • 7
    May 7th
    19 Files
  • 8
    May 8th
    36 Files
  • 9
    May 9th
    34 Files
  • 10
    May 10th
    35 Files
  • 11
    May 11th
    20 Files
  • 12
    May 12th
    18 Files
  • 13
    May 13th
    11 Files
  • 14
    May 14th
    27 Files
  • 15
    May 15th
    58 Files
  • 16
    May 16th
    54 Files
  • 17
    May 17th
    25 Files
  • 18
    May 18th
    53 Files
  • 19
    May 19th
    9 Files
  • 20
    May 20th
    15 Files
  • 21
    May 21st
    25 Files
  • 22
    May 22nd
    32 Files
  • 23
    May 23rd
    35 Files
  • 24
    May 24th
    26 Files
  • 25
    May 25th
    25 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2012 Packet Storm. All rights reserved.

close