Skip to main content
VulnerabilityPublished

CVE-2026-40021: Apache Log4net · Improper Encoding or Escaping of Output

Affects Apache Log4netSource CVE Database V5

0
Compare

Not known to be exploited · CVSS 6.3 Medium : upgrade to 3.3.0 when convenient.

Data as of 30 Oct 2026, 06:59 UTC

CVSS 4.0 base score
6.3Medium
How severe the flaw is on the 0–10 CVSS scale.
EPSS
0.7% chance of exploitation in 30 days – higher than 55% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
Patch
Available – fixed in 3.3.0
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

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 10 Apr 2026

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponized: no evidence on record.

    No public exploit code indexed in Metasploit or Exploit-DB

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq Mirage: no evidence on record.

    No attack traffic recorded by OffSeq Mirage sensors

A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 29 Oct 2026.

What to do

Upgrade Apache Log4net and log4net to 3.3.0.

Affected software

ProductAffectedFixed in
Apache Software FoundationApache Log4netAffected
  • <3.3.0
Fixed in
  • 3.3.0
NuGetlog4netpkg:nuget/log4netOther threatsAffected
  • <3.3.0
Fixed in
  • 3.3.0
NuGetlog4netpkg:nuget/log4netOther threatsAffected
  • <3.3.0
Fixed in
  • 3.3.0

CPE configurations (1)

  • cpe:2.3:a:apache:log4net:*:*:*:*:*:*:*:*

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

Users should upgrade to Apache Log4net version 3.3.0, which fixes this issue by properly sanitizing forbidden XML characters. No other mitigation or temporary workaround is indicated. Patch status is not explicitly stated but the vendor advises upgrading to 3.3.0 as the fix.

Description

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.

References

Community reviews

Loading reviews…