Improper Validation of Certificate with Host Mismatch Affecting jruby-openssl package, versions >=0.12.1, <0.15.4


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.03% (6th 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-RUBY-JRUBYOPENSSL-10074040
  • 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 jruby-openssl to version 0.15.4 or higher.

Overview

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