CVE-2026-40021 Apache Log4net: Silent log event loss in XmlLayout and XmlLayoutSchemaLog4J due to unescaped XML 1.0 forbidden characters
- Published
- Updated
- Exploit status
- No public exploit known
- CISA SSVC
- No known exploitation · automatable: no · technical impact: partial
- Technology
- UbuntuDebian
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.
Upgrade path
9 packages: 4 fixed, 5 with no fix yet.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| debian/log4net(Debian 13) | = 1.2.10+dfsg-9; = 1.2.10+dfsg-10; All versions | No fix listed | No fix yet |
| ubuntu/log4net(Ubuntu 22.04) | All versions | No fix listed | No fix yet |
| ubuntu/log4net(Ubuntu 24.04) | All versions | No fix listed | No fix yet |
| ubuntu/log4net(Ubuntu 26.04) | All versions | No fix listed | No fix yet |
| ubuntu/log4net(Ubuntu 26.10) | All versions | No fix listed | No fix yet |
| apache log4net | < 3.3.0 | 3.3.0 | Fixed |
| apache log4net(NuGet) | < 3.3.0 | 3.3.0 | Fixed |
| debian/log4net(Debian 14) | < 1.2.10+dfsg-10; = 1.2.10+dfsg-9 | 1.2.10+dfsg-10 | Fixed |
| nuget log4net(NuGet) | < 3.3.0; = 1.2.10; = 1.2.11; = 2.0.0 +24 more | 3.3.0 | Fixed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| nuget log4net(NuGet) | < 3.3.0 | 3.3.0 |
| nuget log4net(NuGet) | = 1.2.10 | No fix listed |
| nuget log4net(NuGet) | = 1.2.11 | No fix listed |
| nuget log4net(NuGet) | = 2.0.0 | No fix listed |
| nuget log4net(NuGet) | = 2.0.1 | No fix listed |
| nuget log4net(NuGet) | = 2.0.10 | No fix listed |
| nuget log4net(NuGet) | = 2.0.11 | No fix listed |
| nuget log4net(NuGet) | = 2.0.12 | No fix listed |
| nuget log4net(NuGet) | = 2.0.13 | No fix listed |
| nuget log4net(NuGet) | = 2.0.14 | No fix listed |
| nuget log4net(NuGet) | = 2.0.15 | No fix listed |
| nuget log4net(NuGet) | = 2.0.16 | No fix listed |
| nuget log4net(NuGet) | = 2.0.17 | No fix listed |
| nuget log4net(NuGet) | = 2.0.2 | No fix listed |
| nuget log4net(NuGet) | = 2.0.3 | No fix listed |
| nuget log4net(NuGet) | = 2.0.4 | No fix listed |
| nuget log4net(NuGet) | = 2.0.5 | No fix listed |
| nuget log4net(NuGet) | = 2.0.6 | No fix listed |
| nuget log4net(NuGet) | = 2.0.7 | No fix listed |
| nuget log4net(NuGet) | = 2.0.8 | No fix listed |
| nuget log4net(NuGet) | = 2.0.9 | No fix listed |
| nuget log4net(NuGet) | = 3.0.0 | No fix listed |
| nuget log4net(NuGet) | = 3.0.1 | No fix listed |
| nuget log4net(NuGet) | = 3.0.2 | No fix listed |
| nuget log4net(NuGet) | = 3.0.3 | No fix listed |
Show 14 more
| Product | Affected versions | Fixed in |
|---|---|---|
| nuget log4net(NuGet) | = 3.0.4 | No fix listed |
| nuget log4net(NuGet) | = 3.1.0 | No fix listed |
| nuget log4net(NuGet) | = 3.2.0 | No fix listed |
| apache log4net(NuGet) | < 3.3.0 | 3.3.0 |
| debian/log4net(Debian:13) | All versions | No fix listed |
| debian/log4net(Debian:13) | = 1.2.10+dfsg-10 | No fix listed |
| debian/log4net(Debian:13) | = 1.2.10+dfsg-9 | No fix listed |
| debian/log4net(Debian:14) | < 1.2.10+dfsg-10 | 1.2.10+dfsg-10 |
| debian/log4net(Debian:14) | = 1.2.10+dfsg-9 | No fix listed |
| ubuntu/log4net(Ubuntu:22.04) | All versions | No fix listed |
| ubuntu/log4net(Ubuntu:24.04) | All versions | No fix listed |
| ubuntu/log4net(Ubuntu:26.04) | All versions | No fix listed |
| ubuntu/log4net(Ubuntu:26.10) | All versions | No fix listed |
| apache log4net | < 3.3.0 | 3.3.0 |
References
- nvd.nist.gov third-party-advisory vendor-advisory
- github.com issue-tracking patch
- github.com product
- lists.apache.org mailing-list vendor-advisory
- logging.apache.org product vendor-advisory
- logging.apache.org product related
- logging.apache.org vendor-advisory
- www.openwall.com mailing-list third-party-advisory
- github.com
- Debian Security Tracker CVE-2026-40021 vendor-advisory
- Red Hat CVE page mitigation vendor-advisory
- Red Hat Bugzilla 2457315 issue-tracking
- www.cve.org
- Ubuntu CVE tracker vendor-advisory
- bugs.debian.org issue-tracking