# CVE-2025-54812: Apache Log4cxx: Improper HTML escaping in HTMLLayout

> Attackers can inject HTML or JavaScript into log files via untrusted logger names when HTMLLayout is used, potentially stealing data or hiding information.

- **Severity:** Low 2.1 (`CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:A/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 22 Aug 2025
- **Updated:** 4 Nov 2025
- **Also known as:** DEBIAN-CVE-2025-54812, GHSA-7mpr-gcjx-jcmw, UBUNTU-CVE-2025-54812, openSUSE-SU-2025:15549-1

## What is CVE-2025-54812?

CVE-2025-54812 is a low-severity cross-site scripting vulnerability in Apache Log4cxx, published on 22 Aug 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

Improper Output Neutralization for Logs vulnerability in Apache Log4cxx.

When using HTMLLayout, logger names are not properly escaped when writing out to the HTML file.
If untrusted data is used to retrieve the name of a logger, an attacker could theoretically inject HTML or Javascript in order to hide information from logs or steal data from the user.
In order to activate this, the following sequence must occur:

  *  Log4cxx is configured to use HTMLLayout.

  *  Logger name comes from an untrusted string

  *  Logger with compromised name logs a message

  *  User opens the generated HTML log file in their browser, leading to potential XSS

Because logger names are generally constant strings, we assess the impact to users as LOW

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-54812?

It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `log4cxx` | openSUSE:Tumbleweed | All versions | 1.5.0-1.1 |

Products: Apache Log4cxx.

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

Upgrade to a fixed version.

## Is CVE-2025-54812 being exploited?

There is no known exploitation of CVE-2025-54812 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-54813](https://insights.sbomify.com/CVE-2025-54813/): Apache Log4cxx: Improper escaping with JSONLayout (medium 6.3)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-54812 and fix it if it is affected.

What it is: CVE-2025-54812 is a low-severity cross-site scripting vulnerability in Apache Log4cxx, published on 22 Aug 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2025-54812 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-54812/ (Markdown: https://insights.sbomify.com/CVE-2025-54812/index.md)
```

## Sources

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

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