Vulnerability · Published Jan 18, 2022 · Assigned by apache

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

Critical 9.8

In plain English

A critical-severity SQL injection in Apache Log4j 1.x from Apache Software Foundation. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 66.5% (higher than 99.3% of all known vulnerabilities). Ready-made attack tooling exists: public proof-of-concept code. Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)9.8Critical
Exploit odds (30 days)66.5%top 0.7% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack tooling1Public PoC

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.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
AlmaLinux:8parfait0.5.4-4.module_el8.5.0+2610+de2b8c0bALSA-2022:0290
AlmaLinux:8parfait0.5.4-4.module_el8.5.0+235+62ea7738ALSA-2022:0290
AlmaLinux:8parfait-examples0.5.4-4.module_el8.5.0+2610+de2b8c0bALSA-2022:0290
AlmaLinux:8parfait-examples0.5.4-4.module_el8.5.0+235+62ea7738ALSA-2022:0290
AlmaLinux:8parfait-javadoc0.5.4-4.module_el8.5.0+235+62ea7738ALSA-2022:0290
AlmaLinux:8parfait-javadoc0.5.4-4.module_el8.5.0+2610+de2b8c0bALSA-2022:0290
AlmaLinux:8pcp-parfait-agent0.5.4-4.module_el8.5.0+2610+de2b8c0bALSA-2022:0290
AlmaLinux:8pcp-parfait-agent0.5.4-4.module_el8.5.0+235+62ea7738ALSA-2022:0290
AlmaLinux:8si-units0.6.5-2.module_el8.5.0+235+62ea7738ALSA-2022:0290
AlmaLinux:8si-units0.6.5-2.module_el8.5.0+2610+de2b8c0bALSA-2022:0290
AlmaLinux:8si-units-javadoc0.6.5-2.module_el8.5.0+2610+de2b8c0bALSA-2022:0290
AlmaLinux:8si-units-javadoc0.6.5-2.module_el8.5.0+235+62ea7738ALSA-2022:0290
AlmaLinux:8unit-api1.0-5.module_el8.5.0+2610+de2b8c0bALSA-2022:0290
AlmaLinux:8unit-api1.0-5.module_el8.5.0+235+62ea7738ALSA-2022:0290
AlmaLinux:8unit-api-javadoc1.0-5.module_el8.5.0+2610+de2b8c0bALSA-2022:0290
AlmaLinux:8unit-api-javadoc1.0-5.module_el8.5.0+235+62ea7738ALSA-2022:0290
AlmaLinux:8uom-lib1.0.1-6.module_el8.5.0+2610+de2b8c0bALSA-2022:0290
AlmaLinux:8uom-lib1.0.1-6.module_el8.5.0+235+62ea7738ALSA-2022:0290
AlmaLinux:8uom-lib-javadoc1.0.1-6.module_el8.5.0+2610+de2b8c0bALSA-2022:0290
AlmaLinux:8uom-lib-javadoc1.0.1-6.module_el8.5.0+235+62ea7738ALSA-2022:0290
AlmaLinux:8uom-parent1.0.3-3.module_el8.5.0+2610+de2b8c0bALSA-2022:0290
AlmaLinux:8uom-parent1.0.3-3.module_el8.5.0+235+62ea7738ALSA-2022:0290
AlmaLinux:8uom-se1.0.4-3.module_el8.5.0+235+62ea7738ALSA-2022:0290
AlmaLinux:8uom-se1.0.4-3.module_el8.5.0+2610+de2b8c0bALSA-2022:0290
AlmaLinux:8uom-se-javadoc1.0.4-3.module_el8.5.0+235+62ea7738ALSA-2022:0290
AlmaLinux:8uom-se-javadoc1.0.4-3.module_el8.5.0+2610+de2b8c0bALSA-2022:0290
AlmaLinux:8uom-systems0.7-1.module_el8.5.0+235+62ea7738ALSA-2022:0290
AlmaLinux:8uom-systems0.7-1.module_el8.5.0+2610+de2b8c0bALSA-2022:0290
AlmaLinux:8uom-systems-javadoc0.7-1.module_el8.5.0+2610+de2b8c0bALSA-2022:0290
AlmaLinux:8uom-systems-javadoc0.7-1.module_el8.5.0+235+62ea7738ALSA-2022:0290
Debian:12apache-log4j1.21.2.17-11DEBIAN-CVE-2022-23305
Debian:13apache-log4j1.21.2.17-11DEBIAN-CVE-2022-23305
Debian:14apache-log4j1.21.2.17-11DEBIAN-CVE-2022-23305
Mavenlog4j:log4jno fix listedGHSA-65fg-84f6-3jq3
Mavenorg.zenframework.z8.dependencies.commons:log4j-1.2.17no fix listedGHSA-65fg-84f6-3jq3
Rocky Linux:8parfait0:0.5.4-4.module+el8.5.0+728+553fbdb8RLSA-2022:0290
Rocky Linux:8si-units0:0.6.5-2.module+el8.3.0+214+edf13b3fRLSA-2022:0290
Rocky Linux:8unit-api0:1.0-5.module+el8.3.0+214+edf13b3fRLSA-2022:0290
Rocky Linux:8uom-lib0:1.0.1-6.module+el8.3.0+214+edf13b3fRLSA-2022:0290
Rocky Linux:8uom-parent0:1.0.3-3.module+el8.3.0+214+edf13b3fRLSA-2022:0290
Rocky Linux:8uom-se0:1.0.4-3.module+el8.3.0+214+edf13b3fRLSA-2022:0290
Rocky Linux:8uom-systems0:0.7-1.module+el8.3.0+214+edf13b3fRLSA-2022:0290

Affected products (as reported)

VendorProductVersions
Apache Software Foundation Apache Log4j 1.x 1.2.1 – before unspecifiedunspecified – before 2.0-alpha1

Weakness: CWE-89 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

References