CVE-2022-23305
SQL injection in JDBC Appender in Apache Log4j V1
Reported by apache · Published January 18, 2022
log4j is fixed in 1.2.17 (Maven Central)
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| log4j:log4j | Maven Central | 1.2.17 |
| org.zenframework.z8.dependencies.commons:log4j-1.2.17 | Maven Central | 2.0.0, 2.0 |
| druid | Chainguard | 35.0.1-r1 |
| log4j-manual | Amazon Linux | 1.2.17-18.amzn2 |
| log4j-javadoc | Amazon Linux | 1.2.17-18.amzn2 |
| druid | Wolfi | 35.0.1-r1 |
| log4j | Amazon Linux | 1.2.17-18.amzn2 |
| mysql_enterprise_monitor | oracle | 8.0.29 |
| e-business_suite_information_discovery | oracle | 12.2.11 |
| Apache Log4j 1.x | Apache Software Foundation | unspecified, 2.0-alpha1 |
| hyperion_data_relationship_management | oracle | 11.2.8.0 |
| log4j | apache | 1.2.17 |
4 more packages have a fixed version. See every fix in Lookup.
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| Apache Software Foundation | Apache Log4j 1.x | 1.2.1, unspecified |
| chainguard | druid | 0 |
| Maven | log4j:log4j | 0 |
| Apache Software Foundation | Apache Log4j 1.x | 1.2.1, * |
| amazon:2 | log4j-manual | 0 |
| amazon:2 | log4j-javadoc | 0 |
| wolfi | druid | 0 |
| Maven | org.zenframework.z8.dependencies.commons:log4j-1.2.17 | 0 |
| amazon:2 | log4j | 0 |
Timeline
- Jan 17, 2022 CVE Published
- Feb 8, 2022 EPSS Score (30 in total, the first dated here)
- Mar 17, 2026 Security Advisory (56 in total, the first dated here)
- Jul 5, 2026 Coalition ESS Score
- Nov 18, 2026 PoC Published
- Nov 21, 2026 Distribution Patch (51 in total, the first dated here)
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2022-23305
vulnetix vdb fixes CVE-2022-23305
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2022-23305/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- x_refsource_MISC
- x_refsource_MISC
- [oss-security] 20220118 CVE-2022-23305: SQL injection in JDBC Appender in Apache Log4j V1 mailing-listx_refsource_MLIST
- x_refsource_MISC
- x_refsource_CONFIRM
- x_refsource_MISC
- CVE-2022-RCE exploit
- CVE-2022-23305_POC exploit
- log4shell-finder exploit
- https://nvd.nist.gov/vuln/detail/CVE-2022-23305 advisory
- https://github.com/advisories/GHSA-65fg-84f6-3jq3 advisory
- https://security.netapp.com/advisory/ntap-20220217-0007 advisory