CVE-2025-46551: JRuby-OpenSSL has hostname verification disabled by default

Published May 7, 2025
·
Updated

Summary When verifying SSL certificates, jruby-openssl is not verifying that the hostname presented in the certificate matches the one we are trying to connect to, meaning a MITM could just present any valid cert for a completely different domain they own, and JRuby wouldn't complain.

Details n/a

PoC An example domain bad.substitutealert.com was created to present the a certificate for the domain s8a.me. The following script run in IRB in CRuby 3.4.3 will fail with certificate verify failed (hostname mismatch), but will work just fine in JRuby 10.0.0.0 and JRuby 9.4.2.0, both of which use jruby-openssl version 0.15.3

ruby require "net/http" require "openssl"

uri = URI("https://bad.substitutealert.com/") https = Net::HTTP.new(uri.host, uri.port) https.usessl = true https.verifymode = OpenSSL::SSL::VERIFYPEER

body = https.start { https.get(uri.requesturi).body } puts body

Impact Anybody using JRuby to make requests of external APIs, or scraping the web, that depends on https to connect securely

Other sources

JRuby-OpenSSL is an add-on gem for JRuby that emulates the Ruby OpenSSL native library. Starting in JRuby-OpenSSL version 0.12.1 and prior to version 0.15.4 (corresponding to JRuby versions starting in 9.3.4.0 prior to 9.4.12.1 and 10.0.0.0 prior to 10.0.0.1), when verifying SSL certificates, JRuby-OpenSSL does not verify that the hostname presented in the certificate matches the one the user tries to connect to. This means a man-in-the-middle could just present any valid cert for a completely different domain they own, and JRuby would accept the cert. Anybody using JRuby to make requests of external APIs, or scraping the web, that depends on https to connect securely. JRuby-OpenSSL version 0.15.4 contains a fix for the issue. This fix is included in JRuby versions 10.0.0.1 and 9.4.12.1.

MITRE

Affected Software

8 affected componentsFixes available
jruby jruby-openssl>=0.12.1<0.15.4
jruby JRuby>9.3.4.0<9.4.12.1, >10.0.0.0<10.0.0.1
maven/org.jruby:jruby>=9.3.4.0<9.4.12.1
9.4.12.1
maven/org.jruby:jruby>=10.0.0.0<10.0.0.1
10.0.0.1
maven/rubygems:jruby-openssl>=0.12.1<0.15.4
0.15.4
jruby JRuby>=9.3.4.0<9.4.12.1
jruby JRuby=10.0.0.0
jruby jruby-openssl>=0.12.1<0.15.4

Event History

May 7, 2025
CVE Published
via MITRE·04:12 PM
Data Sourced
via MITRE·04:12 PM
DescriptionWeakness
Data Sourced
via NVD·05:15 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·05:15 PM
RemedyAffected Software
Advisory Published
via GitHub·05:32 PM

Frequently Asked Questions

1

What is the severity of CVE-2025-46551?

CVE-2025-46551 has been identified with a high severity due to its potential impact on SSL certificate verification.

2

How do I fix CVE-2025-46551?

To mitigate CVE-2025-46551, upgrade JRuby-OpenSSL to version 0.15.4 or later.

3

Which versions of JRuby-OpenSSL are affected by CVE-2025-46551?

CVE-2025-46551 affects JRuby-OpenSSL versions from 0.12.1 up to, but not including, 0.15.4.

4

Is there a workaround for CVE-2025-46551 if I cannot update immediately?

If unable to update, consider disabling the use of JRuby-OpenSSL until a safe upgrade can be performed.

5

What are the implications of CVE-2025-46551 for my application?

CVE-2025-46551 may allow attackers to bypass SSL certificate validation, exposing your application to man-in-the-middle attacks.

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