Apache Log4j Core: Silent log event loss in XmlLayout due to unescaped XML 1.0 forbidden characters

Summary

CVECVE-2026-34480
StatePUBLISHED
Assignerapache
Source PriorityCVE Program / NVD first with legacy fallback
Published2026-04-10 16:16:31 UTC
Updated2026-04-10 17:17:02 UTC
DescriptionApache 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.

Risk And Classification

Primary CVSS: v4.0 6.9 MEDIUM from [email protected]

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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

Problem Types: CWE-116 | CWE-116 CWE-116 Improper Encoding or Escaping of Output


VersionSourceTypeScoreSeverityVector
4.0[email protected]Secondary6.9MEDIUMCVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:N/SI:L/SA:N/E:X/C...
4.0CNACVSS6.9MEDIUMCVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:N/SI:L/SA:N

CVSS v4.0 Breakdown

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Confidentiality
None
Integrity
None
Availability
None
Sub Conf.
None
Sub Integrity
Low
Sub Availability
None

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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

Vendor Declared Affected Products

SourceVendorProductVersionPlatforms
CNA Apache Software Foundation Apache Log4j Core affected 2.0-alpha1 2.25.4 maven Not specified
CNA Apache Software Foundation Apache Log4j Core affected 3.0.0-alpha1 3.0.0-beta3 maven Not specified

References

ReferenceSourceLinkTags
www.openwall.com/lists/oss-security/2026/04/10/9 af854a3a-2127-422b-91ae-364da2661108 www.openwall.com
logging.apache.org/log4j/2.x/manual/layouts.html [email protected] logging.apache.org
github.com/apache/logging-log4j2/pull/4077 [email protected] github.com
logging.apache.org/cyclonedx/vdr.xml [email protected] logging.apache.org
logging.apache.org/security.html [email protected] logging.apache.org
lists.apache.org/thread/5x0hcnng0chhghp6jgjdp3qmbbhfjzhb [email protected] lists.apache.org
CVE Program record CVE.ORG www.cve.org canonical
NVD vulnerability detail NVD nvd.nist.gov canonical, analysis

Vendor Comments And Credit

Discovery Credit

CNA: Ap4sh (Samy Medjahed) and Ethicxz (Eliott Laurie) (original reporters) (en)

CNA: jabaltarik1 (independently) (en)

Additional Advisory Data

SourceTimeEvent
CNA2026-02-16T17:11:00.000ZVulnerability reported by Ap4sh and ethicxz
CNA2026-03-10T20:15:00.000ZCandidate patch shared internally by Piotr P. Karwasz
CNA2026-03-15T05:39:00.000ZIndependent report received from jabaltarik1
CNA2026-03-24T18:52:00.000ZFix shared publicly by Piotr P. Karwasz as pull request #4077
CNA2026-03-25T09:46:00.000ZFix verified by reporter
CNA2026-03-28T11:19:00.000ZLog4j 2.25.4 released
© CVE.report 2026 |

Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties, implied or otherwise, with regard to this information or its use. Any use of this information is at the user's risk. It is the responsibility of user to evaluate the accuracy, completeness or usefulness of any information, opinion, advice or other content. EACH USER WILL BE SOLELY RESPONSIBLE FOR ANY consequences of his or her direct or indirect use of this web site. ALL WARRANTIES OF ANY KIND ARE EXPRESSLY DISCLAIMED. This site will NOT BE LIABLE FOR ANY DIRECT, INDIRECT or any other kind of loss.

CVE, CWE, and OVAL are registred trademarks of The MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. This site includes MITRE data granted under the following license.

Free CVE JSON API cve.report/api

CVE.report and Source URL Uptime Status status.cve.report