CVE details
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.
Affected ports (1)
| Port | Package | Version | Status | Maintainer |
|---|---|---|---|---|
| devel/log4net | log4net | 1.2.10_5 | unaddressed | ports@FreeBSD.org |
Template for a VuXML entry
Range taken from the CVE record, check it before committing. make newentry in security/vuxml creates the vid.
<vuln vid="FIXME (make newentry)">
<topic>FIXME -- FIXME</topic>
<affects>
<package>
<name>log4net</name>
<range><lt>3.3.0</lt></range>
</package>
</affects>
<description>
<body xmlns="http://www.w3.org/1999/xhtml">
<p>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.</p>
</body>
</description>
<references>
<cvename>CVE-2026-40021</cvename>
<url>https://nvd.nist.gov/vuln/detail/CVE-2026-40021</url>
</references>
<dates>
<discovery>2026-04-10</discovery>
<entry>2026-10-25</entry>
</dates>
</vuln>