CVE-2022-23305
log4j: SQL injection in Log4j 1.x when application is configured to use JDBCAppender
Severity
ModerateRed Hat Product Security
CVSS 3.1
Review impact separately from score.
Published · January 18, 2022
Updated · November 2, 2026
Description
A flaw was found in the Java logging library Apache Log4j in version 1.x. JDBCAppender in Log4j 1.x is vulnerable to SQL injection in untrusted data. This allows a remote attacker to run SQL statements in the database if the deployed application is configured to use JDBCAppender with certain interpolation tokens.
Statement
Note this issue only affects Log4j 1.x when specifically configured to use the JDBCAppender, which is not the default.
Red Hat Satellite bundles log4j-over-slf4j with Candlepin, however, product is not affected as it uses logback framework for logging.
Red Hat Virtualization and OpenShift Container Platform in the OCP Metering stack (the Hive/Presto/Hadoop components) ship a vulnerable version of the log4j package, however JDBCAppender is not used. Therefore the impact of this vulnerability for these products is rated Low.
CVSS score applicability
The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.
Mitigation
These are the possible mitigations for this flaw for releases version 1.x:
- Comment out or remove JDBCAppender in the Log4j configuration if it is used
- Remove the JDBCAppender class from the server's jar files. For example:
zip -q -d log4j-*.jar org/apache/log4j/jdbc/JDBCAppender.class
CVSS / CWE
CVSS 3.1 · 8.8CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
CWE-89 · Improper Neutralization of Special Elements used in an SQL Command