Improper Validation of Certificate with Host Mismatch Affecting org.bouncycastle:bctls-fips package, versions [,1.0.24)[2.0.19, 2.0.24)[2.1.20, 2.1.24)


Severity

Recommended
0.0
critical
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.35% (26th 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-ORGBOUNCYCASTLE-18518000
  • published4 Aug 2026
  • disclosed3 Aug 2026
  • creditAlex Gaynor

Introduced: 3 Aug 2026

CVE-2026-59638  (opens in a new tab)
CWE-297  (opens in a new tab)

How to fix?

Upgrade org.bouncycastle:bctls-fips to version 1.0.24, 2.0.24, 2.1.24 or higher.

Overview

Affected versions of this package are vulnerable to Improper Validation of Certificate with Host Mismatch in the HostnameUtil class, whose "match CN when no dNSName SAN exists" fallback is gated on Properties.isOverrideSet(JSSE_HOSTNAME_CHECK_CN_FALLBACK, true), which returns true when the property is unset and so ships enabled by default, contrary to the documented opt-in behavior. An attacker can impersonate a target host and pass verification during a TLS handshake by presenting a certificate that carries no dNSName SAN and places the target hostname in its Common Name field. This applies only to certificates that lack a dNSName SAN and still chain to a trusted anchor, in deployments that have not explicitly set the fallback property to false.

Workaround

This vulnerability can be avoided by explicitly setting the JSSE_HOSTNAME_CHECK_CN_FALLBACK override property to false, which disables the Common Name fallback that is otherwise active by default.

CVSS Base Scores

version 4.0
version 3.1