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.
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
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| AlmaLinux:8 | parfait | 0.5.4-4.module_el8.5.0+2610+de2b8c0b | ALSA-2022:0290 |
| AlmaLinux:8 | parfait | 0.5.4-4.module_el8.5.0+235+62ea7738 | ALSA-2022:0290 |
| AlmaLinux:8 | parfait-examples | 0.5.4-4.module_el8.5.0+2610+de2b8c0b | ALSA-2022:0290 |
| AlmaLinux:8 | parfait-examples | 0.5.4-4.module_el8.5.0+235+62ea7738 | ALSA-2022:0290 |
| AlmaLinux:8 | parfait-javadoc | 0.5.4-4.module_el8.5.0+235+62ea7738 | ALSA-2022:0290 |
| AlmaLinux:8 | parfait-javadoc | 0.5.4-4.module_el8.5.0+2610+de2b8c0b | ALSA-2022:0290 |
| AlmaLinux:8 | pcp-parfait-agent | 0.5.4-4.module_el8.5.0+2610+de2b8c0b | ALSA-2022:0290 |
| AlmaLinux:8 | pcp-parfait-agent | 0.5.4-4.module_el8.5.0+235+62ea7738 | ALSA-2022:0290 |
| AlmaLinux:8 | si-units | 0.6.5-2.module_el8.5.0+235+62ea7738 | ALSA-2022:0290 |
| AlmaLinux:8 | si-units | 0.6.5-2.module_el8.5.0+2610+de2b8c0b | ALSA-2022:0290 |
| AlmaLinux:8 | si-units-javadoc | 0.6.5-2.module_el8.5.0+2610+de2b8c0b | ALSA-2022:0290 |
| AlmaLinux:8 | si-units-javadoc | 0.6.5-2.module_el8.5.0+235+62ea7738 | ALSA-2022:0290 |
| AlmaLinux:8 | unit-api | 1.0-5.module_el8.5.0+2610+de2b8c0b | ALSA-2022:0290 |
| AlmaLinux:8 | unit-api | 1.0-5.module_el8.5.0+235+62ea7738 | ALSA-2022:0290 |
| AlmaLinux:8 | unit-api-javadoc | 1.0-5.module_el8.5.0+2610+de2b8c0b | ALSA-2022:0290 |
| AlmaLinux:8 | unit-api-javadoc | 1.0-5.module_el8.5.0+235+62ea7738 | ALSA-2022:0290 |
| AlmaLinux:8 | uom-lib | 1.0.1-6.module_el8.5.0+2610+de2b8c0b | ALSA-2022:0290 |
| AlmaLinux:8 | uom-lib | 1.0.1-6.module_el8.5.0+235+62ea7738 | ALSA-2022:0290 |
| AlmaLinux:8 | uom-lib-javadoc | 1.0.1-6.module_el8.5.0+2610+de2b8c0b | ALSA-2022:0290 |
| AlmaLinux:8 | uom-lib-javadoc | 1.0.1-6.module_el8.5.0+235+62ea7738 | ALSA-2022:0290 |
| AlmaLinux:8 | uom-parent | 1.0.3-3.module_el8.5.0+2610+de2b8c0b | ALSA-2022:0290 |
| AlmaLinux:8 | uom-parent | 1.0.3-3.module_el8.5.0+235+62ea7738 | ALSA-2022:0290 |
| AlmaLinux:8 | uom-se | 1.0.4-3.module_el8.5.0+235+62ea7738 | ALSA-2022:0290 |
| AlmaLinux:8 | uom-se | 1.0.4-3.module_el8.5.0+2610+de2b8c0b | ALSA-2022:0290 |
| AlmaLinux:8 | uom-se-javadoc | 1.0.4-3.module_el8.5.0+235+62ea7738 | ALSA-2022:0290 |
| AlmaLinux:8 | uom-se-javadoc | 1.0.4-3.module_el8.5.0+2610+de2b8c0b | ALSA-2022:0290 |
| AlmaLinux:8 | uom-systems | 0.7-1.module_el8.5.0+235+62ea7738 | ALSA-2022:0290 |
| AlmaLinux:8 | uom-systems | 0.7-1.module_el8.5.0+2610+de2b8c0b | ALSA-2022:0290 |
| AlmaLinux:8 | uom-systems-javadoc | 0.7-1.module_el8.5.0+2610+de2b8c0b | ALSA-2022:0290 |
| AlmaLinux:8 | uom-systems-javadoc | 0.7-1.module_el8.5.0+235+62ea7738 | ALSA-2022:0290 |
| Debian:12 | apache-log4j1.2 | 1.2.17-11 | DEBIAN-CVE-2022-23305 |
| Debian:13 | apache-log4j1.2 | 1.2.17-11 | DEBIAN-CVE-2022-23305 |
| Debian:14 | apache-log4j1.2 | 1.2.17-11 | DEBIAN-CVE-2022-23305 |
| Maven | log4j:log4j | no fix listed | GHSA-65fg-84f6-3jq3 |
| Maven | org.zenframework.z8.dependencies.commons:log4j-1.2.17 | no fix listed | GHSA-65fg-84f6-3jq3 |
| Rocky Linux:8 | parfait | 0:0.5.4-4.module+el8.5.0+728+553fbdb8 | RLSA-2022:0290 |
| Rocky Linux:8 | si-units | 0:0.6.5-2.module+el8.3.0+214+edf13b3f | RLSA-2022:0290 |
| Rocky Linux:8 | unit-api | 0:1.0-5.module+el8.3.0+214+edf13b3f | RLSA-2022:0290 |
| Rocky Linux:8 | uom-lib | 0:1.0.1-6.module+el8.3.0+214+edf13b3f | RLSA-2022:0290 |
| Rocky Linux:8 | uom-parent | 0:1.0.3-3.module+el8.3.0+214+edf13b3f | RLSA-2022:0290 |
| Rocky Linux:8 | uom-se | 0:1.0.4-3.module+el8.3.0+214+edf13b3f | RLSA-2022:0290 |
| Rocky Linux:8 | uom-systems | 0:0.7-1.module+el8.3.0+214+edf13b3f | RLSA-2022:0290 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| 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
- https://logging.apache.org/log4j/1.2/index.html x_refsource_MISC
- https://lists.apache.org/thread/pt6lh3pbsvxqlwlp4c5l798dv2hkc85y x_refsource_MISC
- [oss-security] 20220118 CVE-2022-23305: SQL injection in JDBC Appender in Apache Log4j V1 mailing-list, x_refsource_MLIST
- https://www.oracle.com/security-alerts/cpuapr2022.html x_refsource_MISC
- https://security.netapp.com/advisory/ntap-20220217-0007/ x_refsource_CONFIRM
- https://www.oracle.com/security-alerts/cpujul2022.html x_refsource_MISC