# CVE-2025-54813: Apache Log4cxx: Improper escaping with JSONLayout

> Attackers can inject non-printable characters into JSON logs, potentially causing downstream log consumers to fail parsing or process data incorrectly.

- **Severity:** Medium 6.3 (`CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/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:** 22 Aug 2025
- **Updated:** 4 Nov 2025
- **Also known as:** DEBIAN-CVE-2025-54813, GHSA-68p3-h5c2-5hcr, UBUNTU-CVE-2025-54813

## What is CVE-2025-54813?

CVE-2025-54813 is a medium-severity vulnerability in Apache Log4cxx, published on 22 Aug 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Improper Output Neutralization for Logs vulnerability in Apache Log4cxx.

When using JSONLayout, not all payload bytes are properly escaped. If an attacker-supplied message contains certain non-printable characters, these will be passed along in the message and written out as part of the JSON message. This may prevent applications that consume these logs from correctly interpreting the information within them.

This issue affects Apache Log4cxx: before 1.5.0.

Users are recommended to upgrade to version 1.5.0, which fixes the issue.

Weakness: CWE-117 (Improper Output Neutralization for Logs)

## Which versions are affected by CVE-2025-54813?

It affects 1 product.


Products: Apache Log4cxx.

## How do I fix CVE-2025-54813?

Upgrade to a fixed version.

## Is CVE-2025-54813 being exploited?

There is no known exploitation of CVE-2025-54813 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-2026-40023](https://insights.sbomify.com/CVE-2026-40023/): Other in Apache Log4cxx (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-2025-54813 and fix it if it is affected.

What it is: CVE-2025-54813 is a medium-severity vulnerability in Apache Log4cxx, published on 22 Aug 2025. 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-2025-54813 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-2025-54813/ (Markdown: https://insights.sbomify.com/CVE-2025-54813/index.md)
```

## Sources

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

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