CVE-2025-46551
JRuby-OpenSSL has hostname verification disabled by default
Description
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
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 Maven artifacts (2)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| org.jruby » jruby | >= 9.3.4.0, < 9.4.12.1>= 10.0.0.0, < 10.0.0.1 | 9.4.12.1, 10.0.0.1 |
| rubygems » jruby-openssl | >= 0.12.1, < 0.15.4 | 0.15.4 |
Blast radius
50% of the dependent artifacts (156) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 2,585 |
| 2 hops | 1,851 |
| 3 hops | 2,275 |
| 4 hops | 431 |
| 5 hops | 8 |
Most used dependents
- org.asciidoctor » asciidoctor-maven-plugin1,137 usages
- org.asciidoctor » asciidoctorj458 usages
- org.mule.runtime.plugins » mule-extensions-maven-plugin217 usages
- com.buschmais.jqassistant.plugin » common92 usages
- com.buschmais.jqassistant.core » report74 usages
- com.buschmais.jqassistant.core » store74 usages
- org.springframework.restdocs » spring-restdocs-asciidoctor65 usages
- com.buschmais.jqassistant.core » scanner59 usages
- com.buschmais.jqassistant.core » test59 usages
- com.buschmais.jqassistant.plugin » java49 usages
- com.buschmais.jqassistant.core » plugin46 usages
- com.buschmais.jqassistant.core » analysis41 usages
- org.asciidoctor » asciidoctor-gradle-jvm40 usages
- com.buschmais.jqassistant » jqassistant-maven-plugin39 usages
- com.xmlcalabash » xmlcalabash36 usages
Computed from the dependency graph of build 20261128.0605 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
Other ecosystems
Also affects RubyGems (1 package) . See all on OSV
References
| Advisory | NVD CVE-2025-46551 | nvd.nist.gov |
| Package | jruby/jruby-openssl | github.com |
| Web | jruby/jruby-openssl advisory GHSA-72qj-48g4-5xgx | github.com |
| Web | jruby/jruby-openssl commit 31a56d6 | github.com |
| Web | jruby/jruby-openssl commit b1fc5d6 | github.com |
| Web | rubysec/ruby-advisory-db CVE-2025-46551.yml | github.com |
