CVE-2022-23305 SQL injection in JDBC Appender in Apache Log4j V1

Critical 9.8 Published Updated

Attackers can execute arbitrary SQL queries via crafted log messages in Apache Log4j 1.x when the non-default JDBCAppender is configured.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2022-23305?

CVE-2022-23305 is a critical SQL injection vulnerability in Broadcom Brocade Sannav, published on 18 Jan 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

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. Note this issue only affects Log4j 1.x when specifically configured to use the JDBCAppender, which is not the default. Beginning in version 2.0-beta8, the JDBCAppender was re-introduced with proper support for parameterized SQL queries and further customization over the columns written to in logs. Apache Log4j 1.2 reached end of life in August 2015. Users should upgrade to Log4j 2 as it addresses numerous other issues from the previous versions.

Weakness: CWE-89

Which versions are affected by CVE-2022-23305?

4 open source packages ship an affected version, including log4j:log4j and org.zenframework.z8.dependencies.commons:log4j-1.2.17. It affects 28 products.

PackageAffectedFixed in
log4j:log4j MavenAll versions to 1.2.17None
log4j:log4j MavenAll versions to 1.2.17None
org.zenframework.z8.dependencies.commons:log4j-1.2.17 MavenAll versions to 2.0None
org.zenframework.z8.dependencies.commons:log4j-1.2.17 MavenAll versions to 2.0None

Products include Apache Log4j, Broadcom Brocade Sannav, Netapp Snapmanager, Oracle Advanced Supply Chain Planning, Oracle Business Intelligence, Oracle Business Process Management Suite and 22 more.

How do I fix CVE-2022-23305?

Product is end of life, replace it.

Use parameterised queries everywhere and never build SQL by joining strings. Upgrade affected software first; a web application firewall only buys time. More about SQL injection.

Is CVE-2022-23305 being exploited?

There is no known exploitation of CVE-2022-23305 in the wild and no public exploit code.

Public exploit code: 4 proofs of concept on GitHub.

All Broadcom Brocade Sannav vulnerabilities

Sources

Also known as CLEANSTART-2026-CB62266, CLSA-2022-1643918279, CLSA-2022-1643918500, CLSA-2026-1793137942, DEBIAN-CVE-2022-23305, GHSA-65fg-84f6-3jq3 and 5 more.

Is CVE-2022-23305 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free