Vulnerabilityin Apache log4net.
No public exploit found; not on exploited lists.
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.
- Upgrade Apache Log4net to 3.3.0 or later.
- Upgrade log4net (NuGet) to 3.3.0 or later.
Affected and fixed versions
From the CVE record, NVD and package advisories. When no source has versions yet, this table says "not confirmed" instead of guessing.
From first report to first attacks
- 8 Apr 2026CVE ID reserved by apache.
- 10 Apr 2026Published in the CVE List.
- 10 Apr 2026CVE record last updated.
Attack code anyone can find
Exploit maturity: No public exploit found. CISA assessment (SSVC): exploitation none.
Listed so defenders can judge how urgent this is and test systems they are authorised to test. Patchminder does not host exploit code; links open the source page. Labels for GitHub repositories come from their public details and are never a promise about the code. Run anything only in an isolated lab.
Report a link
Nothing on this page links to exploit code right now. To report anything else, write to the contact point in the legal notice.
Other log4net vulnerabilities
Same weakness: Improper output encoding
- github.com patch
- logging.apache.org vendor-advisory
- logging.apache.org vendor-advisory
- logging.apache.org related
- lists.apache.org vendor-advisory
- www.openwall.com
Patchminder. CVE-2026-40021: Vulnerability in Apache log4net. https://patchminder.com/cve/cve-2026-40021/ (accessed 5 December 2026).