SecurityReason.com - Our Reason is

Security

Register | Forget Password | Login
Search :
SecurityReason
WLB
Services
RSS
Corporate
Note

If you have found a vulnerability, please send to our SecurityAlert Database :
secalert()securityreason()com

Also if you have new ( 0-day ) exploit, please send to our ExploitAlert Archive :
exploit()securityreason()com

Home arrow SecurityAlert Database

Arrow  Topic :

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


Arrow  SecurityAlert : 3180
Arrow  CVE : CVE-2007-5162
Arrow  SecurityRisk : Low  Security Risk Low  (About)
Arrow  Remote Exploit : Yes
Arrow  Local Exploit : No
Arrow  Exploit Given : Yes
Arrow  Credit : Chris Clark
Arrow  Published : 01.10.2007

Arrow  Affected Software : Ruby 1.8.5, 1.8.6, Trunk Ruby



Arrow  Advisory Text :  

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 (at) isecpartners (dot) com [email concealed]





Arrow  Feedback :

If you have additional information or notice any errors regarding this security advisory, please use contact form or email us at info()securityreason()com.
Alert

Multiple Vendors libc/gdtoa printf(3) Array Overrun

Security Risk High- 2009-05-30

SecurityReason realised new advisory about vulnerabilities libc/gdtoa...

Apache RSS Apache Alert

» Apache Tomcat
   RequestDispatcher
   directory traversal
   vulnerability

» Apache mod_dav / svn
   Remote Denial of Service
   Exploit

» Apache Tomcat Information
   disclosure

» Apache Tomcat User
   enumeration vulnerability
   with FORM authentication

PHP RSS PHP Alert

» PHP 5.2.9 curl safe_mode
   & open_basedir bypass

» PHP 5.2.6 SAPI
   php_getuid() overload

» PHP
   ZipArchive::extractTo()
   Directory Traversal
   Vulnerability

» PHP 5.2.6 dba_replace()
   destroying file

Copyright © SecurityReason.com. All Rights Reserved.