CVE-2026-40021

Source
https://cve.org/CVERecord?id=CVE-2026-40021
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-40021.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2026-40021
Aliases
Downstream
Published
2026-04-10T15:44:17.451Z
Modified
2026-07-08T08:14:23.605980089Z
Severity
  • 6.3 (Medium) CVSS_V4 - 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 CVSS Calculator
Summary
Apache Log4net: Silent log event loss in XmlLayout and XmlLayoutSchemaLog4J due to unescaped XML 1.0 forbidden characters
Details

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.

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/40xxx/CVE-2026-40021.json",
    "cwe_ids": [
        "CWE-116"
    ],
    "cna_assigner": "apache"
}
References

Affected packages

Git / github.com/apache/logging-log4net

Affected ranges

Type
GIT
Repo
https://github.com/apache/logging-log4net
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Fixed
Database specific
{
    "cpe": "cpe:2.3:a:apache:log4net:*:*:*:*:*:*:*:*",
    "extracted_events": [
        {
            "introduced": "0"
        },
        {
            "fixed": "3.3.0"
        }
    ],
    "source": [
        "AFFECTED_FIELD",
        "CPE_RANGE"
    ]
}

Affected versions

rc/3.*
rc/3.0.1-preview.1
rc/3.0.1-preview.2
rc/3.0.1-rc1
rc/3.0.2-rc1
rc/3.0.3-preview.1
rc/3.0.3-rc1
rc/3.0.4-preview.1
rc/3.0.4-rc1
rc/3.1.0-rc1
rc/3.2.0-preview.1
rc/3.2.0-rc1
Other
rc/temp
rel/2.*
rel/2.0.10
rel/2.0.11
rel/2.0.12
rel/2.0.13
rel/2.0.14
rel/2.0.15
rel/2.0.16
rel/2.0.17
rel/2.x
rel/3.*
rel/3.0.1
rel/3.0.2
rel/3.0.3
rel/3.0.4
rel/3.1.0
rel/3.2.0

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-40021.json"