Where
AND
-Infinity
0
Severity
6.8
AV:N/AC:M/Au:N/C:P/I:P/A:P

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/

1 / 2
First published (updated )
Severity
5
AV:N/AC:L/Au:N/C:N/I:P/A:N

Originally, Common Vulnerabilities and Exposures assigned an identifier CVE-2011-1005 to the following vulnerability:

The safe-level feature in Ruby 1.8.6 through 1.8.6-420, 1.8.7 through 1.8.7-330, and 1.8.8dev allows context-dependent attackers to modify strings via the Exception#tos method, as demonstrated by changing an intended pathname.

Later it was reported: [1] http://www.openwall.com/lists/oss-security/2012/10/02/4

that the Ruby nameerrmesgtostr() method is vulnerable to the similar flaw.

Relevant upstream patch: [2] http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=37068

1 / 2
First published (updated )
Severity
5
AV:N/AC:L/Au:N/C:N/I:N/A:P

The BigDecimal library in Ruby 1.8.6 before p369 and 1.8.7 before p173 allows context-dependent attackers to cause a denial of service (application crash) via a string argument that represents a large number, as demonstrated by an attempted conversion to the Float data type.

First published (updated )
Severity
4.3
AV:N/AC:M/Au:N/C:N/I:P/A:N

Originally, Common Vulnerabilities and Exposures assigned an identifier of CVE-2011-1005 to the following vulnerability:

The safe-level feature in Ruby 1.8.6 through 1.8.6-420, 1.8.7 through 1.8.7-330, and 1.8.8dev allows context-dependent attackers to modify strings via the Exception#tos method, as demonstrated by changing an intended pathname.

with the following upstream patch: [1] http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?revision=30903&view=revision

Based on later upstream patch for different (CVE-2012-4464 and CVE-2012-4466) issues: [2] http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=37068

it was found that original upstream 1.8.x ruby patch for CVE-2011-1005 issue was not complete, when the NameError#tos() method was used on / with Ruby objects (the test logic in 'testtostaintnesspropagation' test from [1] was actually reversed, so the test returned success also on still vulnerable instances).

Acknowledgements:

This issue was discovered by Vit Ondruch of Red Hat.

1 / 3
First published (updated )

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