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:
Users are advised to upgrade to Apache Log4j Core 2.25.4, which corrects this issue by sanitizing forbidden characters before XML output.
{
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/34xxx/CVE-2026-34480.json",
"cwe_ids": [
"CWE-116"
],
"cna_assigner": "apache"
}{
"cpe": [
"cpe:2.3:a:apache:log4j:*:*:*:*:*:*:*:*",
"cpe:2.3:a:apache:log4j:3.0.0:alpha1:*:*:*:*:*:*",
"cpe:2.3:a:apache:log4j:3.0.0:beta1:*:*:*:*:*:*",
"cpe:2.3:a:apache:log4j:3.0.0:beta2:*:*:*:*:*:*",
"cpe:2.3:a:apache:log4j:3.0.0:beta3:*:*:*:*:*:*"
],
"source": [
"CPE_RANGE",
"CPE_STRING"
],
"extracted_events": [
{
"introduced": "2.0"
},
{
"fixed": "2.25.4"
},
{
"introduced": "3.0.0-alpha1"
},
{
"last_affected": "3.0.0-alpha1"
},
{
"introduced": "3.0.0-beta1"
},
{
"last_affected": "3.0.0-beta1"
},
{
"introduced": "3.0.0-beta2"
},
{
"last_affected": "3.0.0-beta2"
},
{
"introduced": "3.0.0-beta3"
},
{
"last_affected": "3.0.0-beta3"
}
]
}