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.
- 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
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
Which versions are affected by CVE-2025-54812?
It affects 1 product.
Linux distribution packages (1)
log4cxx openSUSE:Tumbleweed | All versions | 1.5.0-1.1 |
Products include Apache Log4cxx.
How do I fix CVE-2025-54812?
Upgrade to a fixed version.
Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.
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
Sources
Also known as DEBIAN-CVE-2025-54812, GHSA-7mpr-gcjx-jcmw, UBUNTU-CVE-2025-54812, openSUSE-SU-2025:15549-1.