CVEfocus › CVE database › CVE-2022-23305

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

CVSS 9.8 CriticalEPSS 66.5% (in the top 1% of all CVEs)Published 2022-01-18Updated 2026-05-27Assigner: apache

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.

CWE-89

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

45Fixed
4Fix pending
12Not affected

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.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 24.04apache-log4j1.2Not affected
vulnerable_code_not_present
Ubuntu 22.04apache-log4j1.2Not affected
vulnerable_code_not_present
Ubuntu 20.04apache-log4j1.2Fixed1.2.17-9ubuntu0.2UBUNTU-CVE-2022-23305
Ubuntu 18.04apache-log4j1.2Fixed1.2.17-8+deb10u1ubuntu0.2UBUNTU-CVE-2022-23305
Ubuntu 16.04apache-log4j1.2Fix pending1.2.17-7ubuntu1+esm1 (Ubuntu Pro)UBUNTU-CVE-2022-23305
Ubuntu 14.04apache-log4j1.2Fix pending1.2.17-4ubuntu3+esm2 (Ubuntu Pro)UBUNTU-CVE-2022-23305
Debian 14apache-log4j1.2Fixed1.2.17-11DEBIAN-CVE-2022-23305
Debian 13apache-log4j1.2Fixed1.2.17-11DEBIAN-CVE-2022-23305
Debian 12apache-log4j1.2Fixed1.2.17-11DEBIAN-CVE-2022-23305
Red Hat Enterprise Linux 8parfaitFixed0:0.5.4-4.module+el8.5.0+13988+de2b8c0bRHSA-2022:0290
Red Hat Enterprise Linux 8parfait-examplesFixed0:0.5.4-4.module+el8.5.0+13988+de2b8c0bRHSA-2022:0290
Red Hat Enterprise Linux 8parfait-javadocFixed0:0.5.4-4.module+el8.5.0+13988+de2b8c0bRHSA-2022:0290
Red Hat Enterprise Linux 8pcp-parfait-agentFixed0:0.5.4-4.module+el8.5.0+13988+de2b8c0bRHSA-2022:0290
Red Hat Enterprise Linux 8si-unitsFixed0:0.6.5-2.module+el8+2463+615f6896RHSA-2022:0290
Red Hat Enterprise Linux 8si-units-javadocFixed0:0.6.5-2.module+el8+2463+615f6896RHSA-2022:0290
Red Hat Enterprise Linux 8unit-apiFixed0:1.0-5.module+el8+2463+615f6896RHSA-2022:0290
Red Hat Enterprise Linux 8unit-api-javadocFixed0:1.0-5.module+el8+2463+615f6896RHSA-2022:0290
Red Hat Enterprise Linux 8uom-libFixed0:1.0.1-6.module+el8+2463+615f6896RHSA-2022:0290
Red Hat Enterprise Linux 8uom-lib-javadocFixed0:1.0.1-6.module+el8+2463+615f6896RHSA-2022:0290
Red Hat Enterprise Linux 8uom-parentFixed0:1.0.3-3.module+el8+2463+615f6896RHSA-2022:0290
Red Hat Enterprise Linux 8uom-seFixed0:1.0.4-3.module+el8+2463+615f6896RHSA-2022:0290
Red Hat Enterprise Linux 8uom-se-javadocFixed0:1.0.4-3.module+el8+2463+615f6896RHSA-2022:0290
Red Hat Enterprise Linux 8uom-systemsFixed0:0.7-1.module+el8+2463+615f6896RHSA-2022:0290
Red Hat Enterprise Linux 8uom-systems-javadocFixed0:0.7-1.module+el8+2463+615f6896RHSA-2022:0290
Red Hat Enterprise Linux 7log4jFixed0:1.2.17-18.el7_4RHSA-2022:0442
Red Hat Enterprise Linux 7log4j-javadocFixed0:1.2.17-18.el7_4RHSA-2022:0442
Red Hat Enterprise Linux 7log4j-manualFixed0:1.2.17-18.el7_4RHSA-2022:0442
Red Hat Enterprise Linux 7tomcatNot affected
Red Hat Enterprise Linux 7tomcat-admin-webappsNot affected
Red Hat Enterprise Linux 7tomcat-docs-webappNot affected
Red Hat Enterprise Linux 7tomcat-el-2.2-apiNot affected
Red Hat Enterprise Linux 7tomcat-javadocNot affected
Red Hat Enterprise Linux 7tomcat-jsp-2.2-apiNot affected
Red Hat Enterprise Linux 7tomcat-jsvcNot affected
Red Hat Enterprise Linux 7tomcat-libNot affected
Red Hat Enterprise Linux 7tomcat-servlet-3.0-apiNot affected
Red Hat Enterprise Linux 7tomcat-webappsNot affected
AlmaLinux 8parfaitFixed0.5.4-4.module_el8.5.0+2610+de2b8c0bALSA-2022:0290
AlmaLinux 8parfait-examplesFixed0.5.4-4.module_el8.5.0+235+62ea7738ALSA-2022:0290
AlmaLinux 8parfait-javadocFixed0.5.4-4.module_el8.5.0+2610+de2b8c0bALSA-2022:0290
AlmaLinux 8pcp-parfait-agentFixed0.5.4-4.module_el8.5.0+235+62ea7738ALSA-2022:0290
AlmaLinux 8si-unitsFixed0.6.5-2.module_el8.5.0+2610+de2b8c0bALSA-2022:0290
AlmaLinux 8si-units-javadocFixed0.6.5-2.module_el8.5.0+235+62ea7738ALSA-2022:0290
AlmaLinux 8unit-apiFixed1.0-5.module_el8.5.0+235+62ea7738ALSA-2022:0290
AlmaLinux 8unit-api-javadocFixed1.0-5.module_el8.5.0+235+62ea7738ALSA-2022:0290
AlmaLinux 8uom-libFixed1.0.1-6.module_el8.5.0+2610+de2b8c0bALSA-2022:0290
AlmaLinux 8uom-lib-javadocFixed1.0.1-6.module_el8.5.0+235+62ea7738ALSA-2022:0290
AlmaLinux 8uom-parentFixed1.0.3-3.module_el8.5.0+2610+de2b8c0bALSA-2022:0290
AlmaLinux 8uom-seFixed1.0.4-3.module_el8.5.0+2610+de2b8c0bALSA-2022:0290
AlmaLinux 8uom-se-javadocFixed1.0.4-3.module_el8.5.0+2610+de2b8c0bALSA-2022:0290
AlmaLinux 8uom-systemsFixed0.7-1.module_el8.5.0+2610+de2b8c0bALSA-2022:0290
AlmaLinux 8uom-systems-javadocFixed0.7-1.module_el8.5.0+235+62ea7738ALSA-2022:0290
Rocky Linux 8parfaitFixed0:0.5.4-4.module+el8.5.0+728+553fbdb8RLSA-2022:0290
Rocky Linux 8si-unitsFixed0:0.6.5-2.module+el8.3.0+214+edf13b3fRLSA-2022:0290
Rocky Linux 8unit-apiFixed0:1.0-5.module+el8.3.0+214+edf13b3fRLSA-2022:0290
Rocky Linux 8uom-libFixed0:1.0.1-6.module+el8.3.0+214+edf13b3fRLSA-2022:0290
Rocky Linux 8uom-parentFixed0:1.0.3-3.module+el8.3.0+214+edf13b3fRLSA-2022:0290
Rocky Linux 8uom-seFixed0:1.0.4-3.module+el8.3.0+214+edf13b3fRLSA-2022:0290
Rocky Linux 8uom-systemsFixed0:0.7-1.module+el8.3.0+214+edf13b3fRLSA-2022:0290
Maven librarylog4j:log4jFix pendingGHSA-65fg-84f6-3jq3
Maven libraryorg.zenframework.z8.dependencies.commons:log4j-1.2.17Fix pendingGHSA-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.

Workaround: Users should upgrade to Log4j 2 or remove usage of the JDBCAppender from their configurations.

References

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.