CVE-2026-40021 — Apache Log4net: Silent log event loss in log4net...
Apache Log4net: Silent log event loss in XmlLayout and XmlLayoutSchemaLog4J due to unescaped XML 1.0 forbidden characters
Summary
Advisory Timeline
- First published April 10, 2026 (185 days ago).
- Last revised May 5, 2026 — 25 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
dotnet add package log4net --version 3.3.0
After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: nuget (1).
| Package | Ecosystem | Affected | Fixed In |
|---|---|---|---|
| log4net | nuget | 1.2.10, 1.2.11, 2.0.0, 2.0.1 (+23 more) | 3.3.0 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-116Improper Encoding or EscapingMITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 5.3 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
References
- https://nvd.nist.gov/vuln/detail/CVE-2026-40021ADVISORY
- https://github.com/apache/logging-log4net/pull/280WEB
- https://github.com/apache/logging-log4netPACKAGE
- https://lists.apache.org/thread/q8otftjswhk69n3kxslqg7cobr0x4st7WEB
- https://logging.apache.org/cyclonedx/vdr.xmlWEB
- https://logging.apache.org/log4net/manual/configuration/layouts.htmlWEB
- https://logging.apache.org/security.html#CVE-2026-40021WEB
- https://www.openwall.com/lists/oss-security/2026/04/10/11WEB
Frequently Asked Questions
- What is CVE-2026-40021?
- Apache Log4net: Silent log event loss in XmlLayout and XmlLayoutSchemaLog4J due to unescaped XML 1.0 forbidden characters This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 5.3/10).
- How do I check if my project is affected by CVE-2026-40021?
- CVE-2026-40021 affects log4net. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-40021 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Exploitation requires specific conditions or has limited impact. Remediate within weeks.
Also Known As
Related CVEs
- CVE-2018-1285CRITICAL
XML External Entity attack in log4net
- CVE-2026-106111MEDIUM
ImageSharp: EXR ZIP decoder can expose stale allocator data after a short inflate
- CVE-2026-65829MEDIUM
MPXJ: Potential Path Traversal Vulnerability in Primavera P3 PRX and SureTrak STX readers
Check if you're affected
Scan your dependencies to see if this vulnerability affects your projects.
Scan Your Dependencies