6.3medium
Apache Log4net: Silent log event loss in XmlLayout and XmlLayoutSchemaLog4J due to unescaped XML 1.0 forbidden characters
- Severity
- 6.3medium CVSS:4.0 by apache
- Exploit likelihood
- 0.91% (higher than 61% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- apache
- Also known as
- GHSA-4f7c-pmjv-c25w
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| log4net | before 3.3.0 | CVE List |
| log4net (NuGet) | before 3.3.0 | GitHub Advisory Database |
| apache log4net | before 3.3.0 | NVD |
All scores
| apache | 6.3medium CVSS:4.0 | CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:N/SI:L/SA:N |
| GitHub | 5.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N |
| GitHub | medium CVSS:4.0 | CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:N/SI:L/SA:N |
| NVD | 5.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
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.
NVD (es)
XmlLayout de Apache Log4net https://logging.apache.org/log4net/manual/configuration/layouts.html#layout-list y XmlLayoutSchemaLog4J https://logging.apache.org/log4net/manual/configuration/layouts.html#layout-list , en versiones anteriores a la 3.3.0, no logran sanear caracteres prohibidos por la especificación XML 1.0 https://www.w3.org/TR/xml/#charsets en las claves y valores de las propiedades MDC, así como en el campo de identidad que puede contener datos influenciados por el atacante. Esto provoca una excepción durante la serialización y la pérdida silenciosa del evento de registro afectado. Un atacante que pueda influir en cualquiera de estos campos puede explotar esto para suprimir registros de log individuales, perjudicando las pistas de auditoría y la detección de actividad maliciosa. Se aconseja a los usuarios actualizar a Apache Log4net 3.3.0, que corrige este problema.
References
| https://github.com/apache/logging-log4net/pull/280 | issue-tracking, patch, web | |
| https://logging.apache.org/security.html#CVE-2026-40021 | vendor-advisory, web | |
| https://logging.apache.org/cyclonedx/vdr.xml | product, vendor-advisory, web | |
| https://logging.apache.org/log4net/manual/configuration/layouts.html | product, related, web | |
| https://lists.apache.org/thread/q8otftjswhk69n3kxslqg7cobr0x4st7 | mailing-list, vendor-advisory, web | |
| http://www.openwall.com/lists/oss-security/2026/04/10/11 | mailing-list, third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-40021 | advisory | |
| https://github.com/apache/logging-log4net | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-40021 changed 2026-04-10 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-4f7c-pmjv-c25w changed 2026-05-05 | CC-BY-4.0 |
| NVD | CVE-2026-40021 changed 2026-10-26 | Public domain |