CVE-2026-40021
MediumCVSS 5.3Exploitation Probability (EPSS)
Elevated risk55th percentile - higher than 55% of all known CVEs
Summary
Apache Log4net before 3.3.0, in XmlLayout and XmlLayoutSchemaLog4J, fails to sanitize characters forbidden by the XML 1.0 specification 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 silent loss of the affected log event.
Risk Assessment
An attacker able to influence these fields can suppress individual log records, impairing audit trails and detection of malicious activity. This may mask other attacks in the environment.
Recommendation
Upgrade Apache Log4net to version 3.3.0, which fixes this issue. Verify log integrity for the period before the update.
Other vulnerabilities in Apache Log4net
See all- CVE-2026-105244Medium
Improper Encoding or Escaping of Output vulnerability in the RemoteSyslogAppender of Apache log4net. Every character outside visible ASCII and space was removed from the record instead of being escaped, so non-ASCII text and control characters such as tabs disappeared without notice. A party whose data reaches a log message could make a distinct value look identical in the record, for example a user name holding a zero-width space logged as admin.
- CVE-2026-105243Medium
Insufficient Logging vulnerability in the EventLogAppender of Apache log4net. Long messages were truncated to a fixed size that exceeds what the Windows Event Log accepts once the log and source names are counted, and the event log then stored nothing and reported nothing. A party whose data reaches a log message could suppress the whole record by making it long enough.
- CVE-2026-105242Medium
Improper Handling of Exceptional Conditions vulnerability in the aspnet-request pattern converter of Apache log4net. Reading request parameters triggers ASP.NET request validation, so a request carrying content such as markup made the layout throw and the appender discarded the whole event. A sender could suppress the log record of their own request.
- CVE-2026-105241Medium
Improper Handling of Unicode Encoding in the SmtpPickupDirAppender of Apache log4net. Content the mail file writer cannot encode, such as an unpaired UTF-16 surrogate, makes the write throw, discarding every buffered event in the batch and potentially leaving a truncated mail in the pickup directory. Only applications using SmtpPickupDirAppender are affected, in versions from 1.2.9 before 3.5.0.
- CVE-2026-105240Medium
Improper Neutralization of Null Byte or NUL Character in the OutputDebugStringAppender of Apache log4net. A NUL character in logged content ends the debug output record at that point, so everything the layout rendered after it, including exception text and trailing fields, is silently lost. Only applications on Windows using OutputDebugStringAppender are affected, in versions from 1.2.9 before 3.5.0.
- CVE-2026-105239Medium
Improper Neutralization of Null Byte or NUL Character in the EventLogAppender of Apache log4net. A NUL character in logged content ends the Windows Event Log record at that point, so everything the layout rendered after it, including exception text and trailing fields, is silently not stored. Only applications on Windows using EventLogAppender are affected, in versions from 1.2.9 before 3.5.0.
Original NVD description (English source)
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.
Vulnerability data from NVD (NIST) · CISA KEV · EPSS

