CVE-2025-54812: Apache Log4cxx: Improper HTML escaping in HTMLLayout
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.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 1.5.0
Event History
Frequently Asked Questions
What is the severity of CVE-2025-54812?
CVE-2025-54812 is classified as a medium severity vulnerability due to improper output neutralization for logs in Apache Log4cxx.
How do I fix CVE-2025-54812?
To fix CVE-2025-54812, ensure you update Apache Log4cxx to the latest version that addresses this issue.
What is the impact of CVE-2025-54812?
The impact of CVE-2025-54812 allows an attacker to inject HTML or JavaScript, potentially leading to cross-site scripting attacks.
Which versions of Apache Log4cxx are affected by CVE-2025-54812?
Apache Log4cxx versions prior to 1.5.0 are affected by CVE-2025-54812.
What mitigation strategies can be used for CVE-2025-54812?
Mitigation strategies for CVE-2025-54812 include validating and sanitizing logger names before using them in output.