CVE-2025-68161: CWE-297 Improper Validation of Certificate with Host Mismatch in Apache Software Foundation Apache Log4j Core
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.
AI Analysis
Technical Summary
CVE-2025-68161 is a vulnerability in the Apache Log4j Core component, specifically within the Socket Appender feature that facilitates network logging. The vulnerability stems from improper validation of TLS certificates, where the Socket Appender fails to perform hostname verification on the peer's certificate, even if the verifyHostName attribute or the log4j2.sslVerifyHostName system property is enabled. This means that during TLS handshake, the client does not confirm that the certificate's hostname matches the intended server, violating the standard TLS security model. Consequently, a man-in-the-middle attacker capable of intercepting or redirecting traffic between the logging client and server can present a certificate issued by a trusted CA (either from the default Java trust store or a configured trust store) and successfully impersonate the logging server. This allows the attacker to intercept, read, or modify log data in transit, potentially exposing sensitive information or corrupting logs used for auditing and incident response. The vulnerability affects all Apache Log4j Core versions from 2.0-beta9 up to 2.25.2, including the 3.0.0-alpha1 release. The CVSS 4.0 base score is 6.3 (medium severity), reflecting network attack vector, high attack complexity, no privileges or user interaction required, and limited confidentiality impact. No known exploits are reported in the wild as of publication. The recommended remediation is to upgrade to version 2.25.3, which corrects the hostname verification logic. Alternatively, configuring the Socket Appender to use a restricted or private trust root can limit exposure by reducing the set of trusted certificates, thereby mitigating the risk of a trusted malicious certificate being accepted.
Potential Impact
For European organizations, this vulnerability poses a risk to the confidentiality and integrity of log data transmitted over networks using Apache Log4j Core's Socket Appender. Logs often contain sensitive operational, security, or personal data; interception or tampering could facilitate further attacks, evade detection, or violate data protection regulations such as GDPR. Organizations with distributed logging architectures or cloud-based log receivers are particularly vulnerable if network traffic is not adequately segregated or encrypted with proper certificate validation. The inability to verify hostnames undermines TLS protections, increasing the risk of man-in-the-middle attacks, especially in environments where attackers can access internal networks or compromise trusted certificate authorities. This vulnerability may also impact compliance and audit processes relying on log integrity. While the attack complexity is high, the absence of required authentication or user interaction means that once network access is gained, exploitation is feasible. The medium severity rating reflects these factors, but the potential impact on critical infrastructure, financial institutions, and government agencies in Europe could be significant if exploited.
Mitigation Recommendations
European organizations should immediately upgrade all Apache Log4j Core instances using the Socket Appender to version 2.25.3 or later to ensure proper hostname verification is enforced. Where immediate upgrade is not feasible, organizations should configure the Socket Appender to use a private or restricted trust store containing only trusted certificate authorities to limit acceptance of malicious certificates. Network segmentation and strict firewall rules should be applied to restrict access to logging endpoints, minimizing the attack surface for man-in-the-middle attacks. Employing network-level encryption and monitoring for anomalous TLS certificates or unexpected certificate chains can help detect potential interception attempts. Additionally, organizations should audit their logging configurations to identify usage of the Socket Appender and verify that verifyHostName settings are correctly applied. Regular vulnerability scanning and penetration testing focused on logging infrastructure can identify residual risks. Finally, organizations should review and enhance incident response plans to address potential log tampering scenarios.
Affected Countries
Germany, France, United Kingdom, Netherlands, Italy, Spain, Sweden, Poland, Belgium, Finland
CVE-2025-68161: CWE-297 Improper Validation of Certificate with Host Mismatch in Apache Software Foundation Apache Log4j Core
Description
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.
AI-Powered Analysis
Technical Analysis
CVE-2025-68161 is a vulnerability in the Apache Log4j Core component, specifically within the Socket Appender feature that facilitates network logging. The vulnerability stems from improper validation of TLS certificates, where the Socket Appender fails to perform hostname verification on the peer's certificate, even if the verifyHostName attribute or the log4j2.sslVerifyHostName system property is enabled. This means that during TLS handshake, the client does not confirm that the certificate's hostname matches the intended server, violating the standard TLS security model. Consequently, a man-in-the-middle attacker capable of intercepting or redirecting traffic between the logging client and server can present a certificate issued by a trusted CA (either from the default Java trust store or a configured trust store) and successfully impersonate the logging server. This allows the attacker to intercept, read, or modify log data in transit, potentially exposing sensitive information or corrupting logs used for auditing and incident response. The vulnerability affects all Apache Log4j Core versions from 2.0-beta9 up to 2.25.2, including the 3.0.0-alpha1 release. The CVSS 4.0 base score is 6.3 (medium severity), reflecting network attack vector, high attack complexity, no privileges or user interaction required, and limited confidentiality impact. No known exploits are reported in the wild as of publication. The recommended remediation is to upgrade to version 2.25.3, which corrects the hostname verification logic. Alternatively, configuring the Socket Appender to use a restricted or private trust root can limit exposure by reducing the set of trusted certificates, thereby mitigating the risk of a trusted malicious certificate being accepted.
Potential Impact
For European organizations, this vulnerability poses a risk to the confidentiality and integrity of log data transmitted over networks using Apache Log4j Core's Socket Appender. Logs often contain sensitive operational, security, or personal data; interception or tampering could facilitate further attacks, evade detection, or violate data protection regulations such as GDPR. Organizations with distributed logging architectures or cloud-based log receivers are particularly vulnerable if network traffic is not adequately segregated or encrypted with proper certificate validation. The inability to verify hostnames undermines TLS protections, increasing the risk of man-in-the-middle attacks, especially in environments where attackers can access internal networks or compromise trusted certificate authorities. This vulnerability may also impact compliance and audit processes relying on log integrity. While the attack complexity is high, the absence of required authentication or user interaction means that once network access is gained, exploitation is feasible. The medium severity rating reflects these factors, but the potential impact on critical infrastructure, financial institutions, and government agencies in Europe could be significant if exploited.
Mitigation Recommendations
European organizations should immediately upgrade all Apache Log4j Core instances using the Socket Appender to version 2.25.3 or later to ensure proper hostname verification is enforced. Where immediate upgrade is not feasible, organizations should configure the Socket Appender to use a private or restricted trust store containing only trusted certificate authorities to limit acceptance of malicious certificates. Network segmentation and strict firewall rules should be applied to restrict access to logging endpoints, minimizing the attack surface for man-in-the-middle attacks. Employing network-level encryption and monitoring for anomalous TLS certificates or unexpected certificate chains can help detect potential interception attempts. Additionally, organizations should audit their logging configurations to identify usage of the Socket Appender and verify that verifyHostName settings are correctly applied. Regular vulnerability scanning and penetration testing focused on logging infrastructure can identify residual risks. Finally, organizations should review and enhance incident response plans to address potential log tampering scenarios.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- apache
- Date Reserved
- 2025-12-16T11:30:53.875Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 69446a7c4eb3efac36a96175
Added to database: 12/18/2025, 8:56:28 PM
Last enriched: 1/21/2026, 2:07:21 AM
Last updated: 2/7/2026, 4:06:25 PM
Views: 1666
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Related Threats
CVE-2026-2090: SQL Injection in SourceCodester Online Class Record System
MediumCVE-2026-2089: SQL Injection in SourceCodester Online Class Record System
MediumCVE-2026-2088: SQL Injection in PHPGurukul Beauty Parlour Management System
MediumCVE-2026-2087: SQL Injection in SourceCodester Online Class Record System
MediumCVE-2026-2086: Buffer Overflow in UTT HiPER 810G
HighActions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console in Console -> Billing for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.