CVE-2025-68161: Apache Log4j Core: Missing TLS hostname verification in Socket appender
The fix for CVE-2025-68161
Other sources
The Socket Appender in Apache Log4j Core versions 2.0-beta9 through 2.25.2 does not perform TLS hostname verification of the peer certificate, even when the verifyHostName configuration attribute or the log4j2.sslVerifyHostName system property is set to true.
This issue may allow a man-in-the-middle attacker to intercept or redirect log traffic under the following conditions:
The attacker is able to intercept or redirect network traffic between the client and the log receiver. The attacker can present a server certificate issued by a certification authority trusted by the Socket Appender’s configured trust store (or by the default Java trust store if no custom trust store is configured).
Users are advised to upgrade to Apache Log4j Core version 2.25.3, which addresses this issue.
As an alternative mitigation, the Socket Appender may be configured to use a private or restricted trust root to limit the set of trusted certificates.
— GitHub
The Socket Appender in Apache Log4j Core versions 2.0-beta9 through 2.25.2 does not perform TLS hostname verification of the peer certificate, even when the verifyHostName https://logging.apache.org/log4j/2.x/manual/appenders/network.html#SslConfiguration-attr-verifyHostName configuration attribute or the log4j2.sslVerifyHostName https://logging.apache.org/log4j/2.x/manual/systemproperties.html#log4j2.sslVerifyHostName system property is set to true.
This issue may allow a man-in-the-middle attacker to intercept or redirect log traffic under the following conditions:
The attacker is able to intercept or redirect network traffic between the client and the log receiver. The attacker can present a server certificate issued by a certification authority trusted by the Socket Appender’s configured trust store (or by the default Java trust store if no custom trust store is configured).
Users are advised to upgrade to Apache Log4j Core version 2.25.3, which addresses this issue.
As an alternative mitigation, the Socket Appender may be configured to use a private or restricted trust root to limit the set of trusted certificates.
— NVD
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
maven/org.apache.logging.log4j:log4j-coreto a version that resolves this vulnerability.Fixed in 2.25.3 - Configuration
Configure the Socket Appender to use a private or restricted trust root (i.e., point its trust store to a private/restricted CA bundle) to limit the set of trusted certificates.
Apache Log4j Core Socket Appender trust root (trust store) = private or restricted trust root
Event History
Frequently Asked Questions
What is the severity of CVE-2025-68161?
CVE-2025-68161 is classified as a high-severity vulnerability due to the lack of TLS hostname verification in Apache Log4j Core.
What versions of Apache Log4j Core are affected by CVE-2025-68161?
CVE-2025-68161 affects Apache Log4j Core versions from 2.0-beta9 to 2.25.2.
How do I fix CVE-2025-68161?
To resolve CVE-2025-68161, upgrade Apache Log4j Core to a version higher than 2.25.2 where TLS hostname verification is implemented.
What impact does CVE-2025-68161 have on my application?
CVE-2025-68161 can potentially allow attackers to perform man-in-the-middle attacks due to the failure to verify the authenticity of the peer certificate.
Is CVE-2025-68161 relevant for all applications using Log4j?
CVE-2025-68161 is specifically relevant for applications using the Socket Appender feature in affected versions of Apache Log4j Core.