The fix for CVE-2025-68161 https://logging.apache.org/security.html#CVE-2025-68161 was incomplete: it addressed hostname verification only when enabled via the log4j2.sslVerifyHostName https://logging.apache.org/log4j/2.x/manual/systemproperties.html#log4j2.sslVerifyHostName system property, but not when configured through the verifyHostName https://logging.apache.org/log4j/2.x/manual/appenders/network.html#SslConfiguration-attr-verifyHostName attribute of the element.
Although the verifyHostName configuration attribute was introduced in Log4j Core 2.12.0, it was silently ignored in all versions through 2.25.3, leaving TLS connections vulnerable to interception regardless of the configured value.
A network-based attacker may be able to perform a man-in-the-middle attack when all of the following conditions are met:
Users are advised to upgrade to Apache Log4j Core 2.25.4, which corrects this issue.
The product communicates with a host that provides a certificate, but the product does not properly ensure that the certificate is actually associated with that host.
| Name | Vendor | Start Version | End Version |
|---|---|---|---|
| Log4j | Apache | 2.12.0 (including) | 2.25.4 (excluding) |
| Log4j | Apache | 3.0.0-alpha1 (including) | 3.0.0-alpha1 (including) |
| Log4j | Apache | 3.0.0-alpha1_rc1 (including) | 3.0.0-alpha1_rc1 (including) |
| Log4j | Apache | 3.0.0-alpha1_rc2 (including) | 3.0.0-alpha1_rc2 (including) |
| Log4j | Apache | 3.0.0-beta1 (including) | 3.0.0-beta1 (including) |
| Log4j | Apache | 3.0.0-beta2 (including) | 3.0.0-beta2 (including) |
| Log4j | Apache | 3.0.0-beta3 (including) | 3.0.0-beta3 (including) |
| Red Hat Offline Knowledge Portal 1.2.4 | RedHat | offline-knowledge-portal/rhokp-rhel9:1779996999 | * |
| Apache-log4j2 | Ubuntu | esm-infra/xenial | * |
Even if a certificate is well-formed, signed, and follows the chain of trust, it may simply be a valid certificate for a different site than the site that the product is interacting with. In order to ensure data integrity, the certificate must be valid, and it must pertain to the site that is being accessed. Even if the product attempts to check the hostname, it is still possible to incorrectly check the hostname. For example, attackers could create a certificate with a name that begins with a trusted name followed by a NUL byte, which could cause some string-based comparisons to only examine the portion that contains the trusted name.