Skip to content
VulniPulse
Medium6.3Apache Software Foundation

Medium [CVE-2026-40021] Apache Log4net's XmlLayout https://logging.apache.org/log4net/manual/configuration/layouts.html#layout-list and…

This medium-severity Apache Software Foundation advisory covers CVE-2026-40021 affecting Apache Log4net.

CVE-2026-40021 Published Apr 10, 2026Updated by vendor Jun 17, 2026
Affected products & platforms
Apache Software FoundationLog4j
Open vendor advisory

Android app · Google Play

Monitor future Apache Software Foundation CVEs from your phone.

Choose a whole vendor or a precise platform, then receive matching security advisories by phone notification, email, or both. Coverage follows 32 official vendor sources and 160+ reviewed platform categories.

Matching phone alertsOptional email delivery

Summary

Apache Log4net's XmlLayout and XmlLayoutSchemaLog4J, in versions before 3.3.0, fail to sanitize characters forbidden by the XML 1.0 specification in MDC property keys and values, as well as the identity field that may carry attacker-influenced data. This causes an exception during serialization and the silent loss of the affected log event.

An attacker who can influence any of these fields can exploit this to suppress individual log records, impairing audit trails and detection of malicious activity.

Users are advised to upgrade to Apache Log4net 3.3.0, which fixes this issue.

Affected versions
  • 3.3.0

Official advisory · high-confidence parse· fetched 2 months ago·verify at source

Fixed versions
  • 3.3.0

Official advisory · high-confidence parse· fetched 2 months ago·verify at source

Mitigation

Upgrade to a fixed release: 3.3.0. That is the remediation for this advisory.

The vendor advisory may list additional interim mitigations or workarounds not captured here — review it before change work.

Official advisory · high-confidence parse· fetched 2 months ago·verify at source

Discussion(0)

No comments yet. Share field notes, upgrade gotchas, or questions — verify against the vendor advisory before acting on community advice.

Sign in to join the discussion.