{"id":"GHSA-72qj-48g4-5xgx","summary":"JRuby-OpenSSL has hostname verification disabled by default","details":"### Summary\nWhen 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. \n\n### Details\nn/a\n\n### PoC\nAn 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\n\n```ruby\nrequire \"net/http\"\nrequire \"openssl\"\n\nuri   = URI(\"https://bad.substitutealert.com/\")\nhttps = Net::HTTP.new(uri.host, uri.port)\nhttps.use_ssl      = true\nhttps.verify_mode  = OpenSSL::SSL::VERIFY_PEER\n\nbody = https.start { https.get(uri.request_uri).body }\nputs body\n```\n\n### Impact\nAnybody using JRuby to make requests of external APIs, or scraping the web, that depends on https to connect securely","aliases":["CVE-2025-46551"],"modified":"2026-09-10T03:50:24.589913336Z","published":"2025-05-07T17:32:54Z","database_specific":{"github_reviewed_at":"2025-05-07T17:32:54Z","nvd_published_at":"2025-05-07T17:15:58Z","cwe_ids":["CWE-295","CWE-297"],"severity":"MODERATE","github_reviewed":true},"references":[{"type":"WEB","url":"https://github.com/jruby/jruby-openssl/security/advisories/GHSA-72qj-48g4-5xgx"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-46551"},{"type":"WEB","url":"https://github.com/jruby/jruby-openssl/commit/31a56d690ce9b8af47af09aaaf809081949ed285"},{"type":"WEB","url":"https://github.com/jruby/jruby-openssl/commit/b1fc5d645c0d90891b8865925ac1c15e3f15a055"},{"type":"PACKAGE","url":"https://github.com/jruby/jruby-openssl"},{"type":"WEB","url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/jruby-openssl/CVE-2025-46551.yml"}],"affected":[{"package":{"name":"rubygems:jruby-openssl","ecosystem":"Maven","purl":"pkg:maven/rubygems/jruby-openssl"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0.12.1"},{"fixed":"0.15.4"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/05/GHSA-72qj-48g4-5xgx/GHSA-72qj-48g4-5xgx.json"}},{"package":{"name":"org.jruby:jruby","ecosystem":"Maven","purl":"pkg:maven/org.jruby/jruby"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"10.0.0.0"},{"fixed":"10.0.0.1"}]}],"versions":["10.0.0.0"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/05/GHSA-72qj-48g4-5xgx/GHSA-72qj-48g4-5xgx.json"}},{"package":{"name":"org.jruby:jruby","ecosystem":"Maven","purl":"pkg:maven/org.jruby/jruby"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"9.3.4.0"},{"fixed":"9.4.12.1"}]}],"versions":["9.3.10.0","9.3.11.0","9.3.12.0","9.3.13.0","9.3.14.0","9.3.15.0","9.3.4.0","9.3.5.0","9.3.6.0","9.3.7.0","9.3.8.0","9.3.9.0","9.4.0.0","9.4.1.0","9.4.10.0","9.4.11.0","9.4.12.0","9.4.2.0","9.4.3.0","9.4.4.0","9.4.5.0","9.4.6.0","9.4.7.0","9.4.8.0","9.4.9.0"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/05/GHSA-72qj-48g4-5xgx/GHSA-72qj-48g4-5xgx.json"}},{"package":{"name":"jruby-openssl","ecosystem":"RubyGems","purl":"pkg:gem/jruby-openssl"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0.12.1"},{"fixed":"0.15.4"}]}],"versions":["0.12.1","0.12.2","0.13.0","0.14.0","0.14.1","0.14.1.cr2","0.14.2","0.14.3","0.14.4","0.14.5","0.14.6","0.15.0","0.15.1","0.15.2","0.15.3","0.15.4.pre1"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/05/GHSA-72qj-48g4-5xgx/GHSA-72qj-48g4-5xgx.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V4","score":"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"}]}