CVE-2013-4073: Medium severity ruby-lang Ruby vulnerability
Ruby’s SSL client implements hostname identity check but it does not properly handle hostnames in the certificate that contain null bytes.
OpenSSL::SSL.verifycertificateidentity implements RFC2818 Server Identity check for Ruby’s SSL client but it does not properly handle hostnames in the subjectAltName X509 extension that contain null bytes.
Existing code in lib/openssl/ssl.rb uses OpenSSL::X509::Extension#value for extracting identity from subjectAltName. Extension#value depends OpenSSL function X509V3EXTprint() and for dNSName of subjectAltName it utilizes sprintf() that is known as null byte unsafe. As the result Extension#value returns ‘www.ruby-lang.org’ if the subjectAltName is ‘www.ruby-lang.org\0.example.com’ and OpenSSL::SSL.verifycertificateidentity wrongly identifies the certificate is for ‘www.ruby-lang.org’.
When a CA a SSL client trusts allows to issue the server certificate that has null byte in subjectAltName, remote attackers can obtain the certificate for ‘www.ruby-lang.org\0.example.com’ from the CA to spoof ‘www.ruby-lang.org’ and do man-in-the-middle between Ruby’s SSL client and SSL servers.
External References:
http://www.ruby-lang.org/en/news/2013/06/27/hostname-check-bypassing-vulnerability-in-openssl-client-cve-2013-4073/
Other sources
The OpenSSL::SSL.verifycertificateidentity function in lib/openssl/ssl.rb in Ruby 1.8 before 1.8.7-p374, 1.9 before 1.9.3-p448, and 2.0 before 2.0.0-p247 does not properly handle a '\0' character in a domain name in the Subject Alternative Name field of an X.509 certificate, which allows man-in-the-middle attackers to spoof arbitrary SSL servers via a crafted certificate issued by a legitimate Certification Authority, a related issue to CVE-2009-2408.
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2013-4073?
The severity of CVE-2013-4073 is classified as medium risk due to improper handling of null bytes in hostnames.
How do I fix CVE-2013-4073?
To fix CVE-2013-4073, upgrade your Ruby version to 2.0.0, 1.9.3, or 1.8.7.
Which versions of Ruby are affected by CVE-2013-4073?
CVE-2013-4073 affects Ruby versions 1.8.6 through 2.0.0, including 1.8.7 and 1.9.3.
What is the impact of CVE-2013-4073?
The impact of CVE-2013-4073 is that it allows an attacker to bypass hostname verification in SSL connections.
Is there a patch for CVE-2013-4073?
No specific patch is provided; users must upgrade to the recommended Ruby versions to mitigate CVE-2013-4073.