CVE-2026-34478: Apache Log4j Core Log Injection Vulnerability

MODERATE
Advisory Identifier: GHSA-445c-vh5m-36rj
CWE-684 CWE-117
Published
Advisory Summary

CVE-2026-34478 is a MODERATE log injection vulnerability (CWE-684: Incorrect Provision of Specified Functionality) affecting Apache Log4j Core libraries in the Maven ecosystem. The issue involves log injection in `rfc5424layout` due to silent configuration incompatibility. Remediation is available by upgrading affected packages to version 2.25.4.

CVE-2026-34478 at a Glance

CVE Identifier CVE-2026-34478
GHSA Identifier GHSA-445c-vh5m-36rj
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-684: Incorrect Provision of Specified Functionality
Affected Product Apache Log4j Core
Package Ecosystem Maven
Published Date
Last Updated

How to Fix CVE-2026-34478

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.

org.apache.logging.log4j:log4j-core fixed: 2.25.4
<dependency>
    <groupId>org.apache.logging.log4j</groupId>
    <artifactId>log4j-core</artifactId>
    <version>2.25.4</version>
</dependency>
org.apache.logging.log4j:log4j-core fixed: Latest secure release
<dependency>
    <groupId>org.apache.logging.log4j</groupId>
    <artifactId>log4j-core</artifactId>
    <version>Latest secure release</version>
</dependency>
Verify Direct and Transitive Dependencies

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-34478, 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-684: Incorrect Provision of Specified Functionality, where the code does not function according to its published specifications, potentially leading to incorrect usage. 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

Apache Log4j Core's [`Rfc5424Layout`](https://logging.apache.org/log4j/2.x/manual/layouts.html#RFC5424Layout), in versions 2.21.0 through 2.25.3, is vulnerable to log injection via CRLF sequences due to undocumented renames of security-relevant configuration attributes. Two distinct issues affect users of stream-based syslog services who configure Rfc5424Layout directly: * The `newLineEscape` attribute was silently renamed, causing newline escaping to stop working for users of TCP framing (RFC 6587), exposing them to CRLF injection in log output. * The `useTlsMessageFormat` attribute was silently renamed, causing users of TLS framing (RFC 5425) to be silently downgraded to unframed TCP (RFC 6587), without newline escaping. Users of the `SyslogAppender` are not affected, as its configuration attributes were not modified. Users are advised to upgrade to Apache Log4j Core 2.25.4, which corrects this issue.

CVE-2026-34478 Affected Apache Log4j Core Versions

2 component(s)
Fixed Versions:
2.25.4
Product / Package Ecosystem Affected Versions Fixed Version
org.apache.logging.log4j:log4j-core
Maven
≥ 2.21.0
< 2.25.4
2.25.4
org.apache.logging.log4j:log4j-core
Maven
≥ 3.0.0-beta1
≤ 3.0.0-beta3

References

Frequently Asked Questions

What is CVE-2026-34478?
CVE-2026-34478 is a security vulnerability in Apache Log4j Core involving log injection in `Rfc5424Layout` due to silent configuration incompatibility under CWE-684: Incorrect Provision of Specified Functionality.
Which Apache Log4j Core versions are affected?
Affected versions include releases prior to 2.25.4 across affected packages: org.apache.logging.log4j:log4j-core.
What version fixes CVE-2026-34478?
Upgrading to 2.25.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is log4j-core affected?
Yes, org.apache.logging.log4j:log4j-core is affected in releases prior to 2.25.4, Latest secure release. Upgrade your dependency to 2.25.4, Latest secure release or later.
What CWE is associated with CVE-2026-34478?
CVE-2026-34478 is classified under CWE-684: Incorrect Provision of Specified Functionality (The code does not function according to its published specifications, potentially leading to incorrect usage.).
How can I check Maven dependencies for CVE-2026-34478?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.apache.logging.log4j'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-445c-vh5m-36rj",
  "modified" : "2026-04-14T00:13:29Z",
  "published" : "2026-04-10T18:31:17Z",
  "aliases" : [ "CVE-2026-34478" ],
  "summary" : "Apache Log4j Core: log injection in `Rfc5424Layout` due to silent configuration incompatibility",
  "details" : "Apache Log4j Core's [`Rfc5424Layout`](https://logging.apache.org/log4j/2.x/manual/layouts.html#RFC5424Layout), in versions 2.21.0 through 2.25.3, is vulnerable to log injection via CRLF sequences due to undocumented renames of security-relevant configuration attributes.\n\nTwo distinct issues affect users of stream-based syslog services who configure Rfc5424Layout directly:\n\n  *  The `newLineEscape` attribute was silently renamed, causing newline escaping to stop working for users of TCP framing (RFC 6587), exposing them to CRLF injection in log output.\n  *  The `useTlsMessageFormat` attribute was silently renamed, causing users of TLS framing (RFC 5425) to be silently downgraded to unframed TCP (RFC 6587), without newline escaping.\n\nUsers of the `SyslogAppender` are not affected, as its configuration attributes were not modified.\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:L/AT:N/PR:N/UI:N/VC:N/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.21.0"
      }, {
        "fixed" : "2.25.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.logging.log4j:log4j-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0-beta1"
      }, {
        "last_affected" : "3.0.0-beta3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-34478"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/logging-log4j2/pull/4074"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/apache/logging-log4j2"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread/3k1clr2l6vkdnl4cbhjrnt1nyjvb5gwt"
  }, {
    "type" : "WEB",
    "url" : "https://logging.apache.org/cyclonedx/vdr.xml"
  }, {
    "type" : "WEB",
    "url" : "https://logging.apache.org/log4j/2.x/manual/layouts.html#RFC5424Layout"
  }, {
    "type" : "WEB",
    "url" : "https://logging.apache.org/security.html#CVE-2026-34478"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2026/04/10/7"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-117", "CWE-684" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-14T00:13:29Z",
    "nvd_published_at" : "2026-04-10T16:16:31Z"
  }
}