On January 18, Apache released a security bulletin that disclosed the SQL injection in JDBC Appender vulnerability (CVE-2022-23305), which affected Apache Log4j 1.x version, and the official support and maintenance is no longer carried out.
Apache Log4j is a Java-based logging utility. Apache Log4j 2 is an upgrade to Log4j that provides significant improvements over its predecessor, Log4j 1.x, and provides many of the improvements available in Logback while fixing some inherent problems in Logback’s architecture.
Vulnerability Detail
By design, the JDBCAppender in Log4j 1.2.x accepts an SQL statement as a configuration parameter where the values to be inserted are converters from PatternLayout. The message converter, %m, is likely to always be included. This allows attackers to manipulate the SQL by entering crafted strings into input fields or headers of an application that are logged allowing unintended SQL queries to be executed.
Apache has stopped maintaining Log4j 1.x in 2015. Please upgrade to Log4j 2 for security fixes. If the users are temporarily unable to perform the upgrade operation, the following measures can be used to temporarily mitigate the CVE-2022-23305 flaw:
- Remove usage of JDBCAppender from Log4j’s configuration file