Improper Validation of Certificate with Host Mismatch Affecting org.jruby:jruby package, versions [9.3.4.0,9.4.12.1)[10.0.0.0,10.0.0.1)


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.02% (5th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JAVA-ORGJRUBY-10074039
  • published8 May 2025
  • disclosed7 May 2025
  • creditMohamed Hafez

Introduced: 7 May 2025

NewCVE-2025-46551  (opens in a new tab)
CWE-297  (opens in a new tab)

How to fix?

Upgrade org.jruby:jruby to version 9.4.12.1, 10.0.0.1 or higher.

Overview

org.jruby:jruby is a high performance, stable, fully threaded Java implementation of the Ruby programming language.

Affected versions of this package are vulnerable to Improper Validation of Certificate with Host Mismatch in the SSL certificate validation process. An attacker can intercept secure communications by presenting a valid certificate for an unrelated domain that the attacker controls.

Note:

This is only exploitable if the attacker is in a "man-in-the-middle" (MITM) position before performing the attack.

PoC

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

References

CVSS Base Scores

version 4.0
version 3.1