CVE-2026-40021
CVE-2026-40021 is a medium-severity vulnerability in Apache Log4net with a CVSS 3.x base score of 5.3. It is not currently listed as actively exploited by CISA, and its EPSS exploit-prediction score is low. The underlying weakness is classified as CWE-116.
Key facts
- Severity: Medium (CVSS 3.x base score 5.3)
- CVSS v4: 6.3
- EPSS exploit prediction: 1% (51st percentile)
- Actively exploited: Not listed in CISA KEV
- EU (EUVD) id: EUVD-2026-21488
- Weakness: CWE-116
- Affected product: Apache Log4net
- Published:
- Last modified:
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.
Frequently asked questions
- What is CVE-2026-40021?
- 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.
- How severe is CVE-2026-40021?
- CVE-2026-40021 has a CVSS 3.x base score of 5.3, rated medium severity. It is exploitable over network with low attack complexity, requires no privileges and no user interaction. Impact on confidentiality is none, integrity low, and availability none.
- Is CVE-2026-40021 being actively exploited?
- It is not currently listed in CISA's KEV catalog. Its EPSS exploit-prediction score is 1% (51st percentile), an estimate of the probability of exploitation in the next 30 days.
- What products are affected by CVE-2026-40021?
- CVE-2026-40021 affects Apache Log4net. See the affected-products list for the exact vulnerable versions.
- How do I fix CVE-2026-40021?
- Review the linked vendor and NVD advisories for patched versions and mitigations, then upgrade or apply the recommended workaround.
- Does CVE-2026-40021 have an EU (EUVD) identifier?
- Yes. CVE-2026-40021 is tracked in the ENISA EU Vulnerability Database (EUVD) as EUVD-2026-21488.
- When was CVE-2026-40021 published?
- CVE-2026-40021 was published on 2026-04-10 and last updated on 2026-06-17.
References
- https://github.com/apache/logging-log4net/pull/280
- https://lists.apache.org/thread/q8otftjswhk69n3kxslqg7cobr0x4st7
- https://logging.apache.org/cyclonedx/vdr.xml
- https://logging.apache.org/log4net/manual/configuration/layouts.html
- https://logging.apache.org/security.html#CVE-2026-40021
- http://www.openwall.com/lists/oss-security/2026/04/10/11
Affected products (1)
- cpe:2.3:a:apache:log4net:*:*:*:*:*:*:*:*
More vulnerabilities in Apache Log4net
- CVE-2018-1285 — Critical (CVSS 9.8): Apache log4net versions before 2.0.10 do not disable XML external entities when parsing log4net configuration files.…
- CVE-2006-0743 — Medium (CVSS 5.0): Format string vulnerability in LocalSyslogAppender in Apache log4net 1.2.9 might allow remote attackers to cause a…
All CVEs affecting Apache Log4net →
Other CWE-116 vulnerabilities
- CVE-2025-55730 — Critical (CVSS 10.0): XWiki Remote Macros provides XWiki rendering macros that are useful when migrating content from Confluence. Starting in…
- CVE-2025-55729 — Critical (CVSS 10.0): XWiki Remote Macros provides XWiki rendering macros that are useful when migrating content from Confluence. Starting in…
- CVE-2023-47143 — Critical (CVSS 10.0): IBM Tivoli Application Dependency Discovery Manager 7.3.0.0 through 7.3.0.10 is vulnerable to HTTP header injection,…
- CVE-2023-26472 — Critical (CVSS 9.9): XWiki Platform is a generic wiki platform. Starting in version 6.2-milestone-1, one can execute any wiki content with…
- CVE-2022-41934 — Critical (CVSS 9.9): XWiki Platform is a generic wiki platform offering runtime services for applications built on top of it. Any user with…
- CVE-2022-36100 — Critical (CVSS 9.9): XWiki Platform Applications Tag and XWiki Platform Tag UI are tag applications for XWiki, a generic wiki platform.…