log4net — security advisory
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.
- Products
- log4net
- Affected versions
- 1.2.10+dfsg-10, 1.2.10+dfsg-9
- Fixed versions
- 1.2.10+dfsg-10
- CVEs
- CVE-2026-40021
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 1 Nov 2026, 17:47 UTC · Revision 2
Source evidence
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.
osv:DEBIAN-CVE-2026-40021
log4net
Fixed versions: Not specified
log4net
Fixed versions: 1.2.10+dfsg-10
Complete source record
{
"id": "0502de412581b021dafb74222c3e976435d2c920634e0216ad4324ba1a9b7a34",
"url": "https://osv.dev/vulnerability/DEBIAN-CVE-2026-40021",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "DEBIAN-CVE-2026-40021",
"summary": "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.",
"evidence": "osv:DEBIAN-CVE-2026-40021",
"products": [
{
"name": {
"value": "log4net",
"evidence": "/affected/0/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "1.2.10+dfsg-10",
"evidence": "/affected/0/versions"
},
{
"value": "1.2.10+dfsg-9",
"evidence": "/affected/0/versions"
}
]
},
{
"name": {
"value": "log4net",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "1.2.10+dfsg-10",
"evidence": "/affected/1/ranges"
}
],
"affected_versions": [
{
"value": "1.2.10+dfsg-9",
"evidence": "/affected/1/versions"
}
]
}
],
"severity": "medium",
"structured": {
"id": "DEBIAN-CVE-2026-40021",
"aliases": [
"DEBIAN-CVE-2026-40021"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"
}
],
"affected": [
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "log4net",
"purl": "pkg:deb/debian/log4net?arch=source&distro=trixie",
"ecosystem": "Debian:13"
},
"versions": [
"1.2.10+dfsg-10",
"1.2.10+dfsg-9"
],
"database_specific": {
"source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2026-40021.json"
},
"ecosystem_specific": {
"urgency": "not yet assigned"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
},
{
"fixed": "1.2.10+dfsg-10"
}
]
}
],
"package": {
"name": "log4net",
"purl": "pkg:deb/debian/log4net?arch=source&distro=forky",
"ecosystem": "Debian:14"
},
"versions": [
"1.2.10+dfsg-9"
],
"database_specific": {
"source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2026-40021.json"
},
"ecosystem_specific": {
"urgency": "not yet assigned"
}
}
],
"modified": "2026-10-27T09:47:39.970161460Z",
"provider": "osv",
"upstream": [
"CVE-2026-40021"
],
"references": [
"https://security-tracker.debian.org/tracker/CVE-2026-40021"
]
},
"related_cves": [
{
"value": "CVE-2026-40021",
"evidence": "/upstream"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 461201,
"published_at": "2026-04-10T16:16:32.42+00:00"
}