Skip to main content
Mallory
Medium

Apache Log4j Core XmlLayout XML character sanitization flaw

IdentifiersCVE-2026-34480CWE-116· Improper Encoding or Escaping of…

Apache Log4j Core XmlLayout, in versions up to and including 2.25.3, does not sanitize characters forbidden by the XML 1.0 specification before emitting XML log output. When a log message or MDC value contains such forbidden characters, XmlLayout can generate invalid XML. The observed behavior depends on the StAX implementation in use: with the JRE built-in StAX implementation, forbidden characters are written into the output, producing malformed XML documents; with alternative StAX implementations such as Woodstox, the logging call can throw an exception and the log event is not delivered to the intended appender, instead only appearing in Log4j's internal status logger.

Share:
For your environment

Are you exposed to this one?

Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.

ANALYST BRIEF

Impact, mitigation & remediation

What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Successful exploitation can cause integrity loss in XML-formatted logs and operational loss of logging. Under the JRE built-in StAX implementation, malformed XML output may cause downstream XML parsers and log-processing pipelines to reject affected documents or records with fatal parse errors, resulting in dropped log entries. Under alternative StAX implementations such as Woodstox, an exception during the logging operation can prevent the event from reaching its configured appender entirely. The provided context also references a CVSS vector of AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N, indicating primary impact to integrity rather than confidentiality or availability.

Mitigation

If you can’t patch tonight, do this now.

If immediate upgrade is not possible, reduce exposure by avoiding XmlLayout for untrusted log content, especially where attacker-controlled input can reach log messages or MDC values. Where XML logging must remain enabled, constrain or sanitize logged input before it reaches Log4j and validate whether the deployed StAX implementation fails closed by throwing exceptions or emits malformed XML. Operators should also monitor for parser failures, dropped records, or Log4j status logger messages indicating logging exceptions. These are compensating controls only; the recommended fix is upgrade to 2.25.4+.

Remediation

Patch, then assume compromise.

Upgrade Apache Log4j Core to version 2.25.4 or later. According to the provided content, version 2.25.4 corrects the issue by sanitizing XML 1.0-forbidden characters before XML output. Any downstream products bundling vulnerable log4j-core versions should likewise update their dependency to 2.25.4 or a later fixed release.
PUBLIC EXPLOITS

Exploits

No valid public exploits. Mallory filtered out 1 candidate as fakes, detection scripts, or README-only repos.

VALID 0 / 1 TOTALView more in app

All candidate exploits were filtered out by Mallory's validation.

EXPOSURE SURFACE

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
Apache Software FoundationLog4japplication

Vendor-confirmed product mapping. Mallory continuously reconciles this list against your asset inventory.

What this page doesn’t show

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, which detections to deploy, and what to do tonight.
Exposure mapping

Query your assets running an affected version, and investigate the blast radius.

Threat actor evidence

Every observed campaign linking this CVE to a named adversary.

Associated malware

Malware families riding this exploit, with evidence and IOCs.

Detection signatures

YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.

Vendor-by-vendor mapping

Cross-references every affected SKU, including bundled OEM variants.

Social activity7

Community discussion across Reddit, Mastodon, and other social sources.