Medium

JRuby-OpenSSL has hostname verification disabled by default

  • Disclosed: 07.05.2025
  • Updated: 11.10.2026 13:20

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.use_ssl      = true
https.verify_mode  = OpenSSL::SSL::VERIFY_PEER

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

Impact

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

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
Java / Kotlin (Maven) org.jruby:jruby >= 10.0.0.0, < 10.0.0.1, >= 9.3.4.0, < 9.4.12.1 10.0.0.1, 9.4.12.1
Java / Kotlin (Maven) rubygems:jruby-openssl >= 0.12.1, < 0.15.4 0.15.4

References

CVSS score -
CVSS vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:P
Weakness (CWE)
CWE-295, CWE-297
Platform
Java / Kotlin (Maven)
Package
org.jruby:jruby, rubygems:jruby-openssl
Disclosed
07.05.2025
Updated
11.10.2026 13:20

Sources and licenses

OSV / GitHub Advisory Database - GHSA-72qj-48g4-5xgx - CC BY 4.0

Vulnerability history: org.jruby:jruby

All published vulnerabilities of this package (Java / Kotlin (Maven)), newest first. Shows whether this is a one-off slip or a package that needs watching.

Total entries
2
First → latest
05.2022 05.2025
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • Medium 2

Disclosures per year

  1. 2022: 1
  2. 2023: 0
  3. 2024: 0
  4. 2025: 1
  5. 2026: 0
  1. JRuby-OpenSSL has hostname verification disabled by default this entry
    Medium CVE-2025-46551 >= 10.0.0.0, < 10.0.0.1, >= 9.3.4.0, < 9.4.12.1 10.0.0.1, 9.4.12.1
  2. Medium CVE-2013-1821 < 1.7.3 1.7.3

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.