SQL Injection in Log4j 1.2.x
Published 21 Jan 2022 · Updated 8 Jun 2026
Is your project on an affected log4j:log4j?
Look after several Java apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected packages
- Affected
- <=1.2.17
- Fixed in
- No fix released
- Affected
- <=2.0
- Fixed in
- No fix released
Details
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.
Is GHSA-65fg-84f6-3jq3 in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected log4j:log4j, and gives you the command that fixes it.
More advisories for log4j:log4j
- HighCVE-2023-26464Apache Log4j 1.x (EOL) allows Denial of Service (DoS) · 10 Mar 2023
- HighCVE-2022-23302Deserialization of Untrusted Data in Log4j 1.x · 21 Jan 2022
- CriticalCVE-2022-23307Deserialization of Untrusted Data in Apache Log4j · 19 Jan 2022
- HighCVE-2021-4104JMSAppender in Log4j 1.2 is vulnerable to deserialization of untrusted data · 14 Dec 2021
- CriticalCVE-2019-17571Deserialization of Untrusted Data in Log4j · 6 Jan 2020
References
- Advisorynvd.nist.gov/vuln/detail/CVE-2022-23305
- Packagegithub.com/apache/logging-log4j1
- Linklists.apache.org/thread/pt6lh3pbsvxqlwlp4c5l798dv2hkc85y
- Linklogging.apache.org/log4j/1.2/index.html
- Linksecurity.netapp.com/advisory/ntap-20220217-0007
- Linkwww.oracle.com/security-alerts/cpuapr2022.html
- Linkwww.oracle.com/security-alerts/cpujul2022.html
- Linkwww.openwall.com/lists/oss-security/2022/01/18/4
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.