CVE-2026-40021

Apache Log4net: Silent log event loss in XmlLayout and XmlLayoutSchemaLog4J due to unescaped XML 1.0 forbidden characters

MEDIUM
5.3
CVSS Score
Published: April 10, 2026 at 03:44 PM UTC
Updated: October 26, 2026 at 09:10 PM UTC
1 product affected across 1 vendorLOG4NET

Using Apache Log4net by Apache Software Foundation?

Get instant alerts when new vulnerabilities affect Apache Log4net - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
MEDIUM5.3
Exploit prediction
EPSS 0.8%
SSVC
No known exploit

Description

Apache Log4net's XmlLayout https://logging.apache.org/log4net/manual/configuration/layouts.html#layout-list and XmlLayoutSchemaLog4J https://logging.apache.org/log4net/manual/configuration/layouts.html#layout-list , in versions before 3.3.0, fail to sanitize characters forbidden by the XML 1.0 specification https://www.w3.org/TR/xml/#charsets 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

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v < 3.3.0
Affected range stops below 3.3.0, so it looks safe — our inference, not a vendor statement

References (6)

PatchIssue Tracking
Source: cverecord
https://github.com/apache/logging-log4net/pull/280
Vendor AdvisoryProduct
Source: cverecord
https://logging.apache.org/cyclonedx/vdr.xml
Vendor AdvisoryMailing List
Source: cverecord
https://lists.apache.org/thread/q8otftjswhk69n3kxslqg7cobr0x4st7
Mailing ListThird Party Advisory
Source: af854a3a-2127-422b-91ae-364da2661108
http://www.openwall.com/lists/oss-security/2026/04/10/11

SSVC — Action Prioritization

SSVCNo known exploitNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

Attack Vector
NETWORK
Complexity
LOW
Privileges
NONE
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
NONE
Integrity
LOW
Availability
NONE
Vector?

Quick Info

StatusANALYZED
CWE
CWE-116

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card