CVE-2026-40021
JSON

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 packageVersionsReported by
log4netbefore 3.3.0CVE List
log4net (NuGet)before 3.3.0GitHub Advisory Database
apache log4netbefore 3.3.0NVD

All scores

apache6.3medium CVSS:4.0CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:N/SI:L/SA:N
GitHub5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
GitHubmedium CVSS:4.0CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:N/SI:L/SA:N
NVD5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N

Classification

CWE-116

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

Sources

SourceRecordLicence
CVE ListCVE-2026-40021 changed 2026-04-10CVE Terms of Use
GitHub Advisory DatabaseGHSA-4f7c-pmjv-c25w changed 2026-05-05CC-BY-4.0
NVDCVE-2026-40021 changed 2026-10-26Public domain