CVE-2013-4073: Medium severity ruby-lang Ruby vulnerability

Published Jun 28, 2013
·
Updated

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

45 affected componentsFixes available
redhat/ruby<2.0.0
2.0.0
redhat/ruby<1.9.3
1.9.3
redhat/ruby<1.8.7
1.8.7
ruby-lang Ruby=1.8.6-26
ruby-lang Ruby=1.8.7
ruby-lang Ruby=1.8.7-p160
ruby-lang Ruby=1.8.7-p17
ruby-lang Ruby=1.8.7-p173
ruby-lang Ruby=1.8.7-p174
ruby-lang Ruby=1.8.7-p22
ruby-lang Ruby=1.8.7-p248
ruby-lang Ruby=1.8.7-p249
ruby-lang Ruby=1.8.7-p299
ruby-lang Ruby=1.8.7-p301
ruby-lang Ruby=1.8.7-p302
ruby-lang Ruby=1.8.7-p330
ruby-lang Ruby=1.8.7-p334
ruby-lang Ruby=1.8.7-p352
ruby-lang Ruby=1.8.7-p357
ruby-lang Ruby=1.8.7-p358
ruby-lang Ruby=1.8.7-p370
ruby-lang Ruby=1.8.7-p371
ruby-lang Ruby=1.8.7-p373
ruby-lang Ruby=1.8.7-p71
ruby-lang Ruby=1.8.7-p72
ruby-lang Ruby=1.8.7-preview1
ruby-lang Ruby=1.8.7-preview2
ruby-lang Ruby=1.8.7-preview3
ruby-lang Ruby=1.8.7-preview4
ruby-lang Ruby=1.9.3
ruby-lang Ruby=1.9.3-p0
ruby-lang Ruby=1.9.3-p125
ruby-lang Ruby=1.9.3-p194
ruby-lang Ruby=1.9.3-p286
ruby-lang Ruby=1.9.3-p383
ruby-lang Ruby=1.9.3-p385
ruby-lang Ruby=1.9.3-p392
ruby-lang Ruby=1.9.3-p426
ruby-lang Ruby=1.9.3-p429
ruby-lang Ruby=2.0.0-p0
ruby-lang Ruby=2.0.0-p195
ruby-lang Ruby=2.0.0-preview1
ruby-lang Ruby=2.0.0-preview2
ruby-lang Ruby=2.0.0-rc1
ruby-lang Ruby=2.0.0-rc2

Event History

Jun 28, 2013
Data Sourced
via Red Hat·04:50 AM
DescriptionSeverityAffected Software
Aug 18, 2013
CVE Published
via MITRE·01:00 AM
Data Sourced
via MITRE·01:00 AM
Description

Frequently Asked Questions

1

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.

2

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.

3

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.

4

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.

5

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.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203