CVE-2022-23305SQL injection in JDBC Appender in Apache Log4j V1
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.
What to do
Likely to be exploited: EPSS gives a 67% chance of exploitation in the next 30 days. Treat it as urgent if you run an affected version.
Fixed builds are available from AlmaLinux, Debian, Red Hat, Rocky Linux, Ubuntu: see the table below for the fixed version per release.
Maven, Ubuntu have not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 24.04 | apache-log4j1.2 | Not affected vulnerable_code_not_present | ||
| Ubuntu 22.04 | apache-log4j1.2 | Not affected vulnerable_code_not_present | ||
| Ubuntu 20.04 | apache-log4j1.2 | Fixed | 1.2.17-9ubuntu0.2 | UBUNTU-CVE-2022-23305 |
| Ubuntu 18.04 | apache-log4j1.2 | Fixed | 1.2.17-8+deb10u1ubuntu0.2 | UBUNTU-CVE-2022-23305 |
| Ubuntu 16.04 | apache-log4j1.2 | Fix pending | 1.2.17-7ubuntu1+esm1 (Ubuntu Pro) | UBUNTU-CVE-2022-23305 |
| Ubuntu 14.04 | apache-log4j1.2 | Fix pending | 1.2.17-4ubuntu3+esm2 (Ubuntu Pro) | UBUNTU-CVE-2022-23305 |
| Debian 14 | apache-log4j1.2 | Fixed | 1.2.17-11 | DEBIAN-CVE-2022-23305 |
| Debian 13 | apache-log4j1.2 | Fixed | 1.2.17-11 | DEBIAN-CVE-2022-23305 |
| Debian 12 | apache-log4j1.2 | Fixed | 1.2.17-11 | DEBIAN-CVE-2022-23305 |
| Red Hat Enterprise Linux 8 | parfait | Fixed | 0:0.5.4-4.module+el8.5.0+13988+de2b8c0b | RHSA-2022:0290 |
| Red Hat Enterprise Linux 8 | parfait-examples | Fixed | 0:0.5.4-4.module+el8.5.0+13988+de2b8c0b | RHSA-2022:0290 |
| Red Hat Enterprise Linux 8 | parfait-javadoc | Fixed | 0:0.5.4-4.module+el8.5.0+13988+de2b8c0b | RHSA-2022:0290 |
| Red Hat Enterprise Linux 8 | pcp-parfait-agent | Fixed | 0:0.5.4-4.module+el8.5.0+13988+de2b8c0b | RHSA-2022:0290 |
| Red Hat Enterprise Linux 8 | si-units | Fixed | 0:0.6.5-2.module+el8+2463+615f6896 | RHSA-2022:0290 |
| Red Hat Enterprise Linux 8 | si-units-javadoc | Fixed | 0:0.6.5-2.module+el8+2463+615f6896 | RHSA-2022:0290 |
| Red Hat Enterprise Linux 8 | unit-api | Fixed | 0:1.0-5.module+el8+2463+615f6896 | RHSA-2022:0290 |
| Red Hat Enterprise Linux 8 | unit-api-javadoc | Fixed | 0:1.0-5.module+el8+2463+615f6896 | RHSA-2022:0290 |
| Red Hat Enterprise Linux 8 | uom-lib | Fixed | 0:1.0.1-6.module+el8+2463+615f6896 | RHSA-2022:0290 |
| Red Hat Enterprise Linux 8 | uom-lib-javadoc | Fixed | 0:1.0.1-6.module+el8+2463+615f6896 | RHSA-2022:0290 |
| Red Hat Enterprise Linux 8 | uom-parent | Fixed | 0:1.0.3-3.module+el8+2463+615f6896 | RHSA-2022:0290 |
| Red Hat Enterprise Linux 8 | uom-se | Fixed | 0:1.0.4-3.module+el8+2463+615f6896 | RHSA-2022:0290 |
| Red Hat Enterprise Linux 8 | uom-se-javadoc | Fixed | 0:1.0.4-3.module+el8+2463+615f6896 | RHSA-2022:0290 |
| Red Hat Enterprise Linux 8 | uom-systems | Fixed | 0:0.7-1.module+el8+2463+615f6896 | RHSA-2022:0290 |
| Red Hat Enterprise Linux 8 | uom-systems-javadoc | Fixed | 0:0.7-1.module+el8+2463+615f6896 | RHSA-2022:0290 |
| Red Hat Enterprise Linux 7 | log4j | Fixed | 0:1.2.17-18.el7_4 | RHSA-2022:0442 |
| Red Hat Enterprise Linux 7 | log4j-javadoc | Fixed | 0:1.2.17-18.el7_4 | RHSA-2022:0442 |
| Red Hat Enterprise Linux 7 | log4j-manual | Fixed | 0:1.2.17-18.el7_4 | RHSA-2022:0442 |
| Red Hat Enterprise Linux 7 | tomcat | Not affected | ||
| Red Hat Enterprise Linux 7 | tomcat-admin-webapps | Not affected | ||
| Red Hat Enterprise Linux 7 | tomcat-docs-webapp | Not affected | ||
| Red Hat Enterprise Linux 7 | tomcat-el-2.2-api | Not affected | ||
| Red Hat Enterprise Linux 7 | tomcat-javadoc | Not affected | ||
| Red Hat Enterprise Linux 7 | tomcat-jsp-2.2-api | Not affected | ||
| Red Hat Enterprise Linux 7 | tomcat-jsvc | Not affected | ||
| Red Hat Enterprise Linux 7 | tomcat-lib | Not affected | ||
| Red Hat Enterprise Linux 7 | tomcat-servlet-3.0-api | Not affected | ||
| Red Hat Enterprise Linux 7 | tomcat-webapps | Not affected | ||
| AlmaLinux 8 | parfait | Fixed | 0.5.4-4.module_el8.5.0+2610+de2b8c0b | ALSA-2022:0290 |
| AlmaLinux 8 | parfait-examples | Fixed | 0.5.4-4.module_el8.5.0+235+62ea7738 | ALSA-2022:0290 |
| AlmaLinux 8 | parfait-javadoc | Fixed | 0.5.4-4.module_el8.5.0+2610+de2b8c0b | ALSA-2022:0290 |
| AlmaLinux 8 | pcp-parfait-agent | Fixed | 0.5.4-4.module_el8.5.0+235+62ea7738 | ALSA-2022:0290 |
| AlmaLinux 8 | si-units | Fixed | 0.6.5-2.module_el8.5.0+2610+de2b8c0b | ALSA-2022:0290 |
| AlmaLinux 8 | si-units-javadoc | Fixed | 0.6.5-2.module_el8.5.0+235+62ea7738 | ALSA-2022:0290 |
| AlmaLinux 8 | unit-api | Fixed | 1.0-5.module_el8.5.0+235+62ea7738 | ALSA-2022:0290 |
| AlmaLinux 8 | unit-api-javadoc | Fixed | 1.0-5.module_el8.5.0+235+62ea7738 | ALSA-2022:0290 |
| AlmaLinux 8 | uom-lib | Fixed | 1.0.1-6.module_el8.5.0+2610+de2b8c0b | ALSA-2022:0290 |
| AlmaLinux 8 | uom-lib-javadoc | Fixed | 1.0.1-6.module_el8.5.0+235+62ea7738 | ALSA-2022:0290 |
| AlmaLinux 8 | uom-parent | Fixed | 1.0.3-3.module_el8.5.0+2610+de2b8c0b | ALSA-2022:0290 |
| AlmaLinux 8 | uom-se | Fixed | 1.0.4-3.module_el8.5.0+2610+de2b8c0b | ALSA-2022:0290 |
| AlmaLinux 8 | uom-se-javadoc | Fixed | 1.0.4-3.module_el8.5.0+2610+de2b8c0b | ALSA-2022:0290 |
| AlmaLinux 8 | uom-systems | Fixed | 0.7-1.module_el8.5.0+2610+de2b8c0b | ALSA-2022:0290 |
| AlmaLinux 8 | uom-systems-javadoc | Fixed | 0.7-1.module_el8.5.0+235+62ea7738 | ALSA-2022:0290 |
| Rocky Linux 8 | parfait | Fixed | 0:0.5.4-4.module+el8.5.0+728+553fbdb8 | RLSA-2022:0290 |
| Rocky Linux 8 | si-units | Fixed | 0:0.6.5-2.module+el8.3.0+214+edf13b3f | RLSA-2022:0290 |
| Rocky Linux 8 | unit-api | Fixed | 0:1.0-5.module+el8.3.0+214+edf13b3f | RLSA-2022:0290 |
| Rocky Linux 8 | uom-lib | Fixed | 0:1.0.1-6.module+el8.3.0+214+edf13b3f | RLSA-2022:0290 |
| Rocky Linux 8 | uom-parent | Fixed | 0:1.0.3-3.module+el8.3.0+214+edf13b3f | RLSA-2022:0290 |
| Rocky Linux 8 | uom-se | Fixed | 0:1.0.4-3.module+el8.3.0+214+edf13b3f | RLSA-2022:0290 |
| Rocky Linux 8 | uom-systems | Fixed | 0:0.7-1.module+el8.3.0+214+edf13b3f | RLSA-2022:0290 |
| Maven library | log4j:log4j | Fix pending | GHSA-65fg-84f6-3jq3 | |
| Maven library | org.zenframework.z8.dependencies.commons:log4j-1.2.17 | Fix pending | GHSA-65fg-84f6-3jq3 |
What the vendor says
As published in the CVE record by apache, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- Apache Software Foundation Apache Log4j 1.x: affected: 1.2.1 to before unspecified, unspecified to before 2.0-alpha1; fixed in
2.0-alpha1
Workaround: Users should upgrade to Log4j 2 or remove usage of the JDBCAppender from their configurations.
References
- https://logging.apache.org/log4j/1.2/index.html
- https://lists.apache.org/thread/pt6lh3pbsvxqlwlp4c5l798dv2hkc85y
- http://www.openwall.com/lists/oss-security/2022/01/18/4
- https://www.oracle.com/security-alerts/cpuapr2022.html
- https://security.netapp.com/advisory/ntap-20220217-0007/
- https://www.oracle.com/security-alerts/cpujul2022.html
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.