CVE-2025-46551
JSON

5.7medium

JRuby-OpenSSL has hostname verification disabled by default

Severity
5.7medium CVSS:4.0 by GitHub_M
Exploit likelihood
0.21% (higher than 11% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-72qj-48g4-5xgx

Description

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.

Affected

Product or packageVersionsReported by
jruby jruby-openssl>= 0.12.1, < 0.15.4, from 0.12.1 before 0.15.4CVE List, NVD
rubygems:jruby-openssl (Maven)from 0.12.1 before 0.15.4GitHub Advisory Database
org.jruby:jruby (Maven)from 10.0.0.0 before 10.0.0.1, from 9.3.4.0 before 9.4.12.1GitHub Advisory Database
jruby-openssl (RubyGems)from 0.12.1 before 0.15.4GitHub Advisory Database
jruby jrubyfrom 9.3.4.0 before 9.4.12.1, 10.0.0.0NVD

All scores

GitHub_M5.7medium CVSS:4.0CVSS: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
GitHubmedium CVSS:4.0CVSS: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
NVD3.7low CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N

Classification

CWE-295CWE-297

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.

What each source says

CVE List

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.

GitHub Advisory Database
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

NVD (es)

JRuby-OpenSSL es una gema complementaria para JRuby que emula la librería nativa Ruby OpenSSL. A partir de la versión 0.12.1 de JRuby-OpenSSL y anteriores a la 0.15.4 (correspondientes a las versiones de JRuby 9.3.4.0 anteriores a la 9.4.12.1 y 10.0.0.0 anteriores a la 10.0.0.1), al verificar certificados SSL, JRuby-OpenSSL no verifica que el nombre de host presentado en el certificado coincida con el del usuario al que intenta conectarse. Esto significa que un intermediario podría presentar cualquier certificado válido para un dominio completamente diferente al suyo, y JRuby lo aceptaría. Cualquiera que use JRuby para realizar solicitudes a API externas o para rastrear datos web que dependan de https para conectarse de forma segura. La versión 0.15.4 de JRuby-OpenSSL contiene una solución para este problema. Esta corrección está incluida en las versiones 10.0.0.1 y 9.4.12.1 de JRuby.

References

Sources

SourceRecordLicence
CVE ListCVE-2025-46551 changed 2025-05-07CVE Terms of Use
GitHub Advisory DatabaseGHSA-72qj-48g4-5xgx changed 2026-09-10CC-BY-4.0
NVDCVE-2025-46551 changed 2026-06-17Public domain