Improper Encoding or Escaping of Output Affecting log4net package, versions [,3.3.0)


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.12% (31st percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Improper Encoding or Escaping of Output vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-DOTNET-LOG4NET-16032174
  • published14 Apr 2026
  • disclosed10 Apr 2026
  • creditf00dat

Introduced: 10 Apr 2026

NewCVE-2026-40021  (opens in a new tab)
CWE-116  (opens in a new tab)

How to fix?

Upgrade log4net to version 3.3.0 or higher.

Overview

Affected versions of this package are vulnerable to Improper Encoding or Escaping of Output in the XmlLayout and XmlLayoutSchemaLog4J layouts due to improper sanitisation of unescaped XML 1.0 forbidden characters in MDC property keys, values, or the identity field. An attacker can cause silent loss of log events by injecting forbidden characters into these fields, resulting in exceptions that prevent affected log records from being written.

CVSS Base Scores

version 4.0
version 3.1