Apache Log4j Core XmlLayout XML 1.0 Char Sanitization Flaw (2.25.3)
CVE-2026-34480 Published on April 10, 2026

Apache Log4j Core: Silent log event loss in XmlLayout due to unescaped XML 1.0 forbidden characters
Apache Log4j Core's XmlLayout https://logging.apache.org/log4j/2.x/manual/layouts.html#XmlLayout , in versions up to and including 2.25.3, fails to sanitize characters forbidden by the XML 1.0 specification https://www.w3.org/TR/xml/#charsets producing invalid XML output whenever a log message or MDC value contains such characters. The impact depends on the StAX implementation in use: * JRE built-in StAX: Forbidden characters are silently written to the output, producing malformed XML. Conforming parsers must reject such documents with a fatal error, which may cause downstream log-processing systems to drop the affected records. * Alternative StAX implementations (e.g., Woodstox https://github.com/FasterXML/woodstox , a transitive dependency of the Jackson XML Dataformat module): An exception is thrown during the logging call, and the log event is never delivered to its intended appender, only to Log4j's internal status logger. Users are advised to upgrade to Apache Log4j Core 2.25.4, which corrects this issue by sanitizing forbidden characters before XML output.

Vendor Advisory Vendor Advisory Vendor Advisory NVD

Timeline

Vulnerability reported by Ap4sh and ethicxz

Candidate patch shared internally by Piotr P. Karwasz 22 days later.

Independent report received from jabaltarik1 5 days later.

Fix shared publicly by Piotr P. Karwasz as pull request #4077 9 days later.

Fix verified by reporter 1 day later.

Log4j 2.25.4 released 3 days later.

Weakness Type

What is an Output Sanitization Vulnerability?

The software prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved.

CVE-2026-34480 has been classified to as an Output Sanitization vulnerability or weakness.


Products Associated with CVE-2026-34480

Want to know whenever a new CVE is published for Apache Log4j? stack.watch will email you.

 

Affected Versions

Apache Software Foundation Apache Log4j Core:

Exploit Probability

EPSS
0.12%
Percentile
30.90%

EPSS (Exploit Prediction Scoring System) scores estimate the probability that a vulnerability will be exploited in the wild within the next 30 days. The percentile shows you how this score compares to all other vulnerabilities.