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.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2026-34480
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 3 Nov 2026, 16:42 UTC · Revision 1
Source evidence
Apache Log4j Core: Silent log event loss in XmlLayout due to unescaped XML 1.0 forbidden characters
core-osv · Original sourcePublished 10 Apr 2026, 15:42 UTC
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.
osv:CVE-2026-34480
Complete source record
{
"id": "70b8523f57f615ea7424a34fb7a57fdeda23a1bc10e9b8c6beba65f348ab4f61",
"url": "https://osv.dev/vulnerability/CVE-2026-34480",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "Apache Log4j Core: Silent log event loss in XmlLayout due to unescaped XML 1.0 forbidden characters",
"summary": "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.",
"evidence": "osv:CVE-2026-34480",
"products": [],
"severity": "medium",
"structured": {
"id": "CVE-2026-34480",
"aliases": [
"CVE-2026-34480",
"GHSA-3pxv-7cmr-fjr4"
],
"metrics": [
{
"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": [
{
"ranges": [
{
"repo": "https://github.com/apache/logging-log4j2",
"type": "GIT",
"events": [
{
"introduced": "8d9204a4b4c6016fa6b36513a46502689d6a45c1"
},
{
"fixed": "0628e53b25a33e496b509c40a39f2d7c64f2aa6c"
},
{
"introduced": "e84827220de69f39112d5f518279038c152b186f"
},
{
"last_affected": "28117e55f69892d3454672f9399e53fb7b74a321"
}
],
"database_specific": {
"extracted_events": [
{
"cpe": "cpe:2.3:a:apache:log4j:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "2.0"
},
{
"fixed": "2.25.4"
}
],
"source": "CPE_RANGE"
},
{
"cpe": "cpe:2.3:a:apache:log4j:3.0.0:alpha1:*:*:*:*:*:*",
"range": [
{
"introduced": "3.0.0-alpha1"
},
{
"last_affected": "3.0.0-alpha1"
}
],
"source": "CPE_STRING"
},
{
"cpe": "cpe:2.3:a:apache:log4j:3.0.0:beta1:*:*:*:*:*:*",
"range": [
{
"introduced": "3.0.0-beta1"
},
{
"last_affected": "3.0.0-beta1"
}
],
"source": "CPE_STRING"
},
{
"cpe": "cpe:2.3:a:apache:log4j:3.0.0:beta2:*:*:*:*:*:*",
"range": [
{
"introduced": "3.0.0-beta2"
},
{
"last_affected": "3.0.0-beta2"
}
],
"source": "CPE_STRING"
},
{
"cpe": "cpe:2.3:a:apache:log4j:3.0.0:beta3:*:*:*:*:*:*",
"range": [
{
"introduced": "3.0.0-beta3"
},
{
"last_affected": "3.0.0-beta3"
}
],
"source": "CPE_STRING"
}
]
}
}
],
"versions": [
"3.0.0-alpha1",
"3.0.0-beta1",
"3.0.0-beta2",
"3.0.0-beta3",
"rel/3.0.0-beta3",
"rel/3.0.0-alpha1",
"log4j-3.0.0-alpha1-rc2"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-34480.json"
}
}
],
"modified": "2026-10-28T02:30:30.819090762Z",
"provider": "osv",
"references": [
"https://logging.apache.org/log4j/2.x/manual/layouts.html#XmlLayout",
"https://repo.maven.apache.org/maven2",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/34xxx/CVE-2026-34480.json",
"https://lists.apache.org/thread/5x0hcnng0chhghp6jgjdp3qmbbhfjzhb",
"https://logging.apache.org/cyclonedx/vdr.xml",
"https://logging.apache.org/security.html#CVE-2026-34480",
"https://nvd.nist.gov/vuln/detail/CVE-2026-34480",
"https://github.com/apache/logging-log4j2/pull/4077"
],
"provider_metadata": {
"cwe_ids": [
"CWE-116"
],
"cna_assigner": "apache",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/34xxx/CVE-2026-34480.json"
}
},
"related_cves": [
{
"value": "CVE-2026-34480",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 497509,
"published_at": "2026-04-10T15:42:03.843+00:00"
}