CVE-2026-40023: 
NixOS vulnerability analysis and mitigation

Overview

CVE-2026-40023 is a vulnerability in Apache Log4cxx's XMLLayout component that allows attackers who can influence logged data to inject XML 1.0 forbidden characters into log messages, NDC, and MDC property keys/values, producing invalid XML output that conforming parsers must reject with a fatal error. This can cause downstream log processing systems to silently drop or fail to index affected log records, impairing audit trails. Affected versions include Apache Log4cxx before 1.7.0 (including Conan and Brew distributions). The vulnerability was reported by Olawale Titiloye on 2026-03-15 and publicly disclosed on 2026-04-10. It carries a CVSS v3.1 score of 5.3 (Medium) and a CVSS v4.0 score of 6.3 (Medium) (Github Advisory, Openwall OSS-Sec).

Technical details

The root cause is classified as CWE-116 (Improper Encoding or Escaping of Output): the XMLLayout formatter in Apache Log4cxx fails to sanitize or escape characters that are forbidden by the XML 1.0 specification (e.g., certain control characters) before embedding them in XML-formatted log output (Github Advisory). An attacker with the ability to influence data that gets logged — such as through user-supplied input in HTTP request parameters, headers, or application fields — can craft input containing these forbidden characters. When the application logs this data via XMLLayout, the resulting XML document becomes malformed, and any conforming XML parser processing the log stream will raise a fatal error and reject the document. The fix, implemented in pull request #609, uses character references for control characters in XML and HTML output and strips illegal characters from attribute text (GitHub PR #609).

Impact

The primary impact is on the integrity of audit trails and security monitoring: an attacker can cause individual log records to be silently dropped or fail to be indexed by downstream log processing systems (e.g., SIEMs, log aggregators), effectively suppressing evidence of malicious activity (Github Advisory, Openwall OSS-Sec). There is no direct confidentiality or availability impact on the vulnerable system itself; the affected system impact metrics show no compromise of confidentiality, integrity, or availability of the logging host. However, the subsequent system impact includes low integrity impact on downstream log processing infrastructure, as log records may be selectively suppressed to conceal attacker actions.

Exploitability

There is no public proof-of-concept exploit code and no evidence of in-the-wild exploitation at this time (Github Advisory). The EPSS score is approximately 0.157–0.292%, indicating a low near-term exploitation probability. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. Exploitation requires the attacker to control or influence data that is logged by an application using XMLLayout, which is a common but not universal configuration. No threat actor attribution has been reported.

Exploitation steps

  1. Identify target application: Determine that the target application uses Apache Log4cxx (version < 1.7.0) with XMLLayout configured as the log output format.
  2. Find an injection point: Identify an application input vector whose value is logged — such as HTTP request parameters, headers (e.g., User-Agent, X-Forwarded-For), form fields, or MDC/NDC values set from user-supplied data.
  3. Craft malicious input: Construct input containing characters forbidden by the XML 1.0 specification (e.g., control characters such as \x01–\x08, \x0B, \x0C, \x0E–\x1F, \x7F–\x84, \x86–\x9F) that will be embedded in the XML log output.
  4. Submit the input: Send the crafted input to the application so it is processed and logged via XMLLayout, causing the resulting XML log document to be malformed.
  5. Trigger log suppression: Conforming XML parsers in downstream log processing systems (SIEMs, log shippers, indexers) encounter the fatal XML parse error and drop or reject the affected log record, suppressing evidence of the attacker's activity (Github Advisory, Openwall OSS-Sec).

Indicators of compromise

  • Logs: Unexpected gaps or missing records in XML-formatted log streams; downstream log processing systems reporting XML parse errors or fatal failures when ingesting log files generated by Log4cxx XMLLayout.
  • Network/Application: Requests containing unusual control characters (e.g., bytes 0x01–0x08, 0x0B, 0x0C, 0x0E–0x1F) in HTTP headers, parameters, or body fields that are reflected in application logs.
  • Log Processing Systems: SIEM or log aggregator alerts indicating dropped or unparseable log events from hosts running Apache Log4cxx; increased XML parse error rates in log ingestion pipelines.
  • File System: Log files containing raw control characters or malformed XML structures when inspected with a hex editor or XML validator.

Mitigation and workarounds

Upgrade Apache Log4cxx to version 1.7.0 or later, which strips illegal XML 1.0 characters and uses character references for control characters in XML and HTML output (Github Advisory, GitHub PR #609). If immediate patching is not possible, implement input validation and filtering at the application layer to prevent forbidden XML characters from reaching the logging subsystem. Additionally, monitor downstream log processing systems for unexpected XML parse errors or dropped records that may indicate exploitation attempts.

Community reactions

The vulnerability was disclosed via the Apache security mailing list and the oss-security list by Piotr Karwasz on 2026-04-10, crediting Olawale Titiloye as the finder (Openwall OSS-Sec). OpenSUSE issued a security announcement for affected packages, and Tenable published Nessus detection plugins (IDs 306018 and 313699) for the vulnerability. Community reaction has been measured given the moderate severity and lack of active exploitation.

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

Debian

Affected

bookworm

log4cxx

Affected

sid

log4cxx

Affected

trixie

log4cxx

Affected

Ubuntu

Unknown

bionic (esm-apps)

log4cxx

Unknown

devel

log4cxx

Unknown

focal (esm-apps)

log4cxx

Unknown

jammy

log4cxx

Unknown

jammy (esm-apps)

log4cxx

Unknown

noble

log4cxx

Unknown

noble (esm-apps)

log4cxx

Unknown

resolute

log4cxx

Unknown

RHEL / CentOS

Unknown

Source: This report was generated using AI

Related NixOS vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-106627HIGH7.5
  • NixOS logoNixOS
  • c2patool
NoYesOct 13, 2026
CVE-2026-105902HIGH7.5
  • NixOS logoNixOS
  • c2patool
NoYesOct 13, 2026
CVE-2026-104345HIGH7.5
  • NixOS logoNixOS
  • c2patool
NoYesOct 13, 2026
CVE-2026-103297HIGH7.5
  • NixOS logoNixOS
  • c2patool
NoYesOct 13, 2026
CVE-2026-103820MEDIUM5.5
  • NixOS logoNixOS
  • c2patool
NoYesOct 13, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management