CVE-2026-34477: Apache Log4j Core `verifyHostName` Attribute Silently Ignored Vulnerability
MODERATECVE-2026-34477 is a MODERATE `verifyhostname` attribute silently ignored vulnerability (CWE-297: Improper Validation of Certificate with Host Mismatch) affecting Apache Log4j Core libraries in the Maven ecosystem. The issue involves `verifyhostname` attribute silently ignored in tls configuration. Remediation is available by upgrading affected packages to version 2.25.4.
CVE-2026-34477 at a Glance
How to Fix CVE-2026-34477
To remediate this vulnerability, upgrade all affected Apache Log4j Core dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.25.4</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>Latest secure release</version>
</dependency>
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
mvn dependency:tree -Dincludes=org.apache.logging.log4j
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2026-34477, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=org.apache.logging.log4j
Analyze the terminal output to locate any version of Apache Log4j Core in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.25.4), your application is affected.
Note: The mvn dependency:tree -Dincludes=org.apache.logging.log4j command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-297: Improper Validation of Certificate with Host Mismatch, where 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. In Apache Log4j Core, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-34477 Affected Apache Log4j Core Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.apache.logging.log4j:log4j-core
|
Maven |
≥ 2.12.0
< 2.25.4
|
2.25.4
|
|
org.apache.logging.log4j:log4j-core
|
Maven |
≥ 3.0.0-alpha1
≤ 3.0.0-beta3
|
|
References
Frequently Asked Questions
What is CVE-2026-34477?
Which Apache Log4j Core versions are affected?
What version fixes CVE-2026-34477?
Is log4j-core affected?
What CWE is associated with CVE-2026-34477?
How can I check Maven dependencies for CVE-2026-34477?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-6hg6-v5c8-fphq",
"modified" : "2026-04-14T00:11:55Z",
"published" : "2026-04-10T18:31:17Z",
"aliases" : [ "CVE-2026-34477" ],
"summary" : "Apache Log4j Core: `verifyHostName` attribute silently ignored in TLS configuration",
"details" : "The fix for 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 `<Ssl>` element.\n\nAlthough 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.\n\nA network-based attacker may be able to perform a man-in-the-middle attack when all of the following conditions are met:\n\n * An SMTP, Socket, or Syslog appender is in use.\n * TLS is configured via a nested <Ssl> element.\n * The attacker can present a certificate issued by a CA trusted by the appender's configured trust store, or by the default Java trust store if none is configured.\n\nThis issue does not affect users of the HTTP appender, which uses a separate [`verifyHostname`](https://logging.apache.org/log4j/2.x/manual/appenders/network.html#HttpAppender-attr-verifyHostName) attribute that was not subject to this bug and verifies host names by default.\n\nUsers are advised to upgrade to Apache Log4j Core 2.25.4, which corrects this issue.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:L/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "org.apache.logging.log4j:log4j-core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.12.0"
}, {
"fixed" : "2.25.4"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.apache.logging.log4j:log4j-core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.0.0-alpha1"
}, {
"last_affected" : "3.0.0-beta3"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-34477"
}, {
"type" : "WEB",
"url" : "https://github.com/apache/logging-log4j2/pull/4075"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/apache/logging-log4j2"
}, {
"type" : "WEB",
"url" : "https://lists.apache.org/thread/lkx8cl46t2bvkcwfcb2pd43ygc097lq4"
}, {
"type" : "WEB",
"url" : "https://logging.apache.org/cyclonedx/vdr.xml"
}, {
"type" : "WEB",
"url" : "https://logging.apache.org/log4j/2.x/manual/appenders/network.html#SslConfiguration-attr-verifyHostName"
}, {
"type" : "WEB",
"url" : "https://logging.apache.org/security.html#CVE-2026-34477"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-297" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-04-14T00:11:55Z",
"nvd_published_at" : "2026-04-10T16:16:30Z"
}
}