Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding for downstream
|
| Impact | This vulnerability presents a low-to-moderate real-world risk despite a CVSS 6.3 score. The attack vector is network-accessible (AV:N), but attack complexity is high (AC:H), indicating exploitation requires specific preconditions or extensive attacker influence over log inputs. The impact is limited to integrity of the logging system itself (SI:L-silent loss of information) with no confidentiality, availability, or system compromise. EPSS or KEV status was not provided in the input; however, the exploitation requirement is narrow: an attacker must both gain the ability to inject characters into MDC or identity fields AND the application must be configured to use XmlLayout or XmlLayoutSchemaLog4J. Organizations using JSON, CSV, or plain text layouts are unaffected. The real risk lies in scenarios where log tampering is a threat model (e.g., highly regulated environments, incident response chains of custody) rather than as a direct attack vector on application availability or confidentiality. |
| Exploit ScenarioDerived | An attacker with the ability to influence application-level context data (such as user identifiers, session data, or request parameters that populate MDC) injects a character forbidden by XML 1.0 (e.g., a control character). When the application logs this event using XmlLayout, serialization fails silently and the log entry is dropped entirely, allowing the attacker to obscure their activity from audit logs without triggering visible errors or alerts. For example, a web application that logs user actions via MDC could be exploited by an authenticated user injecting a null byte or other control character into a request parameter, causing subsequent log records for that session to vanish from the audit trail. No public proof-of-concept code has been identified, and the attack requires deliberate configuration of XML layouts combined with attacker control over log input sources. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Apr 10, 2026
Apache Log4net versions before 3.3.0 fail to sanitize XML 1.0-forbidden characters in MDC property keys and values, as well as identity fields, causing serialization exceptions that silently drop log events when XmlLayout or XmlLayoutSchemaLog4J are in use. An attacker who can influence these fields can suppress individual audit log records, impairing detection of malicious activity. No public exploit code or active exploitation has been confirmed; patch is available from the vendor.
RemediationAI
Vendor-released patch: Apache Log4net 3.3.0. Upgrade to version 3.3.0 or later immediately to receive the fix for improper character sanitization in XML serialization. For organizations unable to upgrade immediately, review logging configuration to determine if XmlLayout or XmlLayoutSchemaLog4J are in active use; if not required, disable these layout types and use alternative serialization formats (JSON, CSV, or plain text). Ensure input sources for MDC properties and identity fields are validated or restricted to prevent injection of XML-forbidden characters. Refer to the vendor advisory at https://logging.apache.org/security.html#CVE-2026-40021 and the upstream fix (GitHub PR #280) for additional context.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 2 packages in nuget, euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Apache Log4net is a .NET-based logging framework that provides structured logging output in multiple formats, including XML. The XmlLayout and XmlLayoutSchemaLog4J serializers convert log events to XML but do not validate or escape characters that violate the XML 1.0 specification (defined at https://www.w3.org/TR/xml/#charsets). The vulnerability stems from incomplete input sanitization (CWE-116: Improper Encoding or Escaping of Output) in the handling of Mapped Diagnostic Context (MDC) properties and identity fields, which may be populated from user-controlled or attacker-influenced sources. When a forbidden character is encountered during serialization, the exception causes the entire log event to be silently dropped rather than being safely encoded or rejected.
Know when Apache Log4Net gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
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
AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N
Primary rating from Vendor (apache).
CVSS VectorVendor: apache
Lifecycle Timeline
2DescriptionCVE.org
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.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
Related Vulnerabilities in Apache Log4net and Log4cxx XML Layout Injection
View all 2More in Apache Log4Net
View allLog event suppression in Apache log4net's AdoNetAppender (1.2.9 through 3.5.x) lets attacker-influenced data quietly del
Improper output neutralization in Apache log4net's XML logging path lets data that reaches a log message forge complete
EUVD-2026-21488
GHSA-4f7c-pmjv-c25w
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB