# CVE-2026-40023: Other in Apache Log4cxx

> Attackers can suppress log records by injecting forbidden XML characters, impairing audit trails and detection in applications using Apache Log4cxx.

- **Severity:** Medium 6.3 (`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`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 10 Apr 2026
- **Updated:** 10 Apr 2026
- **Also known as:** DEBIAN-CVE-2026-40023, GHSA-q8qr-wp2r-738r, MGASA-2026-0218, UBUNTU-CVE-2026-40023, openSUSE-SU-2026:10566-1, openSUSE-SU-2026:20705-1

## What is CVE-2026-40023?

CVE-2026-40023 is a medium-severity vulnerability in Apache Log4cxx, published on 10 Apr 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Apache Log4cxx's  XMLLayout https://logging.apache.org/log4cxx/1.7.0/classlog4cxx_1_1xml_1_1XMLLayout.html , in versions before 1.7.0, fails to sanitize characters forbidden by the  XML 1.0 specification https://www.w3.org/TR/xml/#charsets  in log messages, NDC, and MDC property keys and values, producing invalid XML output. Conforming XML parsers must reject such documents with a fatal error, which may cause downstream log processing systems to drop or fail to index affected records.

An attacker who can influence logged data can exploit this to suppress individual log records, impairing audit trails and detection of malicious activity.

Users are advised to upgrade to Apache Log4cxx 1.7.0, which fixes this issue.

Weakness: CWE-116 (Improper Encoding or Escaping of Output)

## Which versions are affected by CVE-2026-40023?

It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `log4cxx` | openSUSE:Tumbleweed | All versions | 1.7.0-2.1 |

Products: Apache Log4cxx.

## How do I fix CVE-2026-40023?

Upgrade to a fixed version.

## Is CVE-2026-40023 being exploited?

There is no known exploitation of CVE-2026-40023 in the wild and no public exploit code.

## Other vulnerabilities in Apache Log4cxx

- [CVE-2023-31038](https://insights.sbomify.com/CVE-2023-31038/): Apache Log4cxx: SQL injection when using ODBC appender (high 8.8)
- [CVE-2025-54813](https://insights.sbomify.com/CVE-2025-54813/): Apache Log4cxx: Improper escaping with JSONLayout (medium 6.3)
- [CVE-2025-54812](https://insights.sbomify.com/CVE-2025-54812/): Apache Log4cxx: Improper HTML escaping in HTMLLayout (low 2.1)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-40023 and fix it if it is affected.

What it is: CVE-2026-40023 is a medium-severity vulnerability in Apache Log4cxx, published on 10 Apr 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-40023 in the wild and no public exploit code.

Affected product: Apache Log4cxx. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-40023/ (Markdown: https://insights.sbomify.com/CVE-2026-40023/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-40023
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-40023
- OSV: https://osv.dev/vulnerability/CVE-2026-40023

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-40023/
Summaries are generated and may contain mistakes; the official description above is the record.
