CVE-2026-40021: Apache Log4net log suppression in XmlLayout

CVE-2026-40021 · Severity: medium · CVSS 5.3 · Published 2026-04-10

Apache Log4net fails to sanitize XML-forbidden characters in certain fields, leading to serialization exceptions and silent loss of log events.

Technologies: Apache Log4net, log4net (NuGet). Vendors: Apache, NuGet.

Quick answers

Is CVE-2026-40021 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-40021 being exploited in the wild.
How severe is CVE-2026-40021?
Medium severity, with a CVSS score of 5.3, published 10 April 2026.
Which products and versions are affected?
log4net (NuGet) ECOSYSTEM:introduced=0,fixed=3.3.0.
Is there a fix for CVE-2026-40021?
Yes. log4net (NuGet): upgrade to 3.3.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
Am I affected by CVE-2026-40021?
Check whether you run Apache Log4net or log4net (NuGet) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • log4net (NuGet): upgrade to 3.3.0 or later
    dotnet add package log4net --version 3.3.0

Affected products

  • Apache Log4net
  • log4net (NuGet) ECOSYSTEM:introduced=0,fixed=3.3.0

Identifiers

  • CVE-2026-40021
  • GHSA-4f7c-pmjv-c25w

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.