CVE-2026-40021
CVE-2026-40021 · Apache Log4net: Silent log event loss in XmlLayout and XmlLayoutSchemaLog4J due to unescaped XML 1.0 forbidden characters
CVSS 6.3 · Medium · EPSS 1.0% · Fix available
Compare with your installed version
Affected products and known fixed versions are public information. Compare them with your installed version.
- apache log4netUpdate to 3.3.0
- log4net Debian 13No fix published
- log4net Debian 14Update to 1.2.10+dfsg-10
- log4net Ubuntu 16.04 LTSNo fix published
- and 7 more
Check the installed version:
dpkg-query -W -f='${source:Package} ${binary:Package} ${Version}\n' | awk '$1=="log4net"'Assess your server’s risks
The free check gives you a rating and a risk summary by technology stack, without signing up. It does not answer whether this particular vulnerability affects you.
Monitoring matches public information against your servers’ software. Detailed findings for your servers include the order of updates.
curl -fsSL https://patchfirst.dev/check.sh | shChannels carry general technology news; monitoring reports new findings on your servers in your dashboard, through browser notifications, in Telegram or via a webhook.
This page contains facts from public vulnerability sources. Check the original advisory before updating.
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.
- Published
- Updated
Stack: system
Affected products and versions
apache log4net
- Versions
- ≥ 0, < 3.3.0: Affected (nuget)
Update to 3.3.0
log4net Debian 13
- Versions
- 1.2.10+dfsg-10
- 1.2.10+dfsg-9
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
log4net Debian 14
- Versions
- 1.2.10+dfsg-9
- Affected ranges
- ECOSYSTEM: < 1.2.10+dfsg-10
Update to 1.2.10+dfsg-10
log4net Ubuntu 16.04 LTS
- Versions
- 1.2.10+dfsg-6
- 1.2.10+dfsg-7
- 1.2.10+dfsg-7ubuntu0.16.04.1
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
log4net Ubuntu 18.04 LTS
- Versions
- 1.2.10+dfsg-7
- 1.2.10+dfsg-7ubuntu0.18.04.1
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
log4net Ubuntu 20.04 LTS
- Versions
- 1.2.10+dfsg-7
- 1.2.10+dfsg-7ubuntu0.20.04.1
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
log4net Ubuntu 22.04 LTS
- Versions
- 1.2.10+dfsg-8
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
log4net Ubuntu 24.04 LTS
- Versions
- 1.2.10+dfsg-8
- 1.2.10+dfsg-9
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
log4net Ubuntu 25.10
- Versions
- 1.2.10+dfsg-9
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
log4net Ubuntu 26.10
- Versions
- 1.2.10+dfsg-9build1
- 1.2.10+dfsg-10
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
log4net Ubuntu 26.04 LTS
- Versions
- 1.2.10+dfsg-9
- 1.2.10+dfsg-9build1
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
Original sources
- https://github.com/apache/logging-log4net/pull/280
- https://logging.apache.org/security.html#CVE-2026-40021
- https://logging.apache.org/cyclonedx/vdr.xml
- https://logging.apache.org/log4net/manual/configuration/layouts.html
- https://lists.apache.org/thread/q8otftjswhk69n3kxslqg7cobr0x4st7
- http://www.openwall.com/lists/oss-security/2026/04/10/11
- https://nvd.nist.gov/vuln/detail/CVE-2026-40021