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

> Attackers can execute arbitrary SQL queries via crafted log messages in Apache Log4j 1.x when the non-default JDBCAppender is configured.

- **Severity:** Critical 9.8 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 18 Jan 2022
- **Updated:** 27 May 2026
- **Also known as:** CLEANSTART-2026-CB62266, CLSA-2022-1643918279, CLSA-2022-1643918500, CLSA-2026-1793137942, DEBIAN-CVE-2022-23305, GHSA-65fg-84f6-3jq3, MINI-qh3w-mgq7-3w78, MINI-whvf-f34m-rjgr, OESA-2022-1781, ROOT-APP-MAVEN-CVE-2022-23305, UBUNTU-CVE-2022-23305

## What is CVE-2022-23305?

CVE-2022-23305 is a critical SQL injection vulnerability in Broadcom Brocade Sannav, published on 18 Jan 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

### 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.

Weakness: CWE-89 (Improper Neutralization of Special Elements used in an SQL Command)

## Which versions are affected by CVE-2022-23305?

4 open source packages ship an affected version, including log4j:log4j and org.zenframework.z8.dependencies.commons:log4j-1.2.17. It affects 28 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `log4j:log4j` | Maven | All versions to 1.2.17 | None |
| `log4j:log4j` | Maven | All versions to 1.2.17 | None |
| `org.zenframework.z8.dependencies.commons:log4j-1.2.17` | Maven | All versions to 2.0 | None |
| `org.zenframework.z8.dependencies.commons:log4j-1.2.17` | Maven | All versions to 2.0 | None |

Products: Apache Log4j, Broadcom Brocade Sannav, Netapp Snapmanager, Oracle Advanced Supply Chain Planning, Oracle Business Intelligence, Oracle Business Process Management Suite, Oracle Communications Eagle Ftp Table Base Retrieval, Oracle Communications Instant Messaging Server, Oracle Communications Messaging Server, Oracle Communications Network Integrity, Oracle Communications Offline Mediation Controller, Oracle Communications Unified Inventory Management, Oracle E-Business Suite Cloud Manager and Cloud Backup Module, Oracle E-Business Suite Information Discovery, Oracle Enterprise Manager Base Platform, Oracle Financial Services Revenue Management and Billing Analytics, Oracle Healthcare Foundation, Oracle Hyperion Data Relationship Management, Oracle Hyperion Infrastructure Technology, Oracle Identity Management Suite and 8 more.

## How do I fix CVE-2022-23305?

Product is end of life, replace it.

## Is CVE-2022-23305 being exploited?

There is no known exploitation of CVE-2022-23305 in the wild and no public exploit code.

Public exploit code:

- Fastest filesystem scanner for log4shell (CVE-2021-44228, CVE-2021-45046) and other vulnerable (CVE-2017-5645, CVE-2019-17571, CVE-2022-23305, CVE-2022-23307 ... ) instances of log4j library. Excellent performance and low memory footprint. (github_poc): https://github.com/HynekPetrak/log4shell-finder
- test 反向辣鸡数据投放 CVE-2022-23305 工具 利用 教程 Exploit POC  (github_poc): https://github.com/AlphabugX/CVE-2022-RCE
- CVE-2022-23305 Log4J JDBCAppender SQl injection POC  (github_poc): https://github.com/tkomlodi/CVE-2022-23305_POC
- https://github.com/hoor113/CVE-2022-23305-Demo-and-Whitebox-Report (github_poc): https://github.com/hoor113/CVE-2022-23305-Demo-and-Whitebox-Report

## Other vulnerabilities in Broadcom Brocade Sannav

- [CVE-2021-44228](https://insights.sbomify.com/CVE-2021-44228/): Apache Log4j2 Remote Code Execution (critical 10.0, exploited in the wild)
- [CVE-2021-45046](https://insights.sbomify.com/CVE-2021-45046/): Apache Log4j2 Deserialization of Untrusted Data (critical 9.0, exploited in the wild)
- [CVE-2017-5645](https://insights.sbomify.com/CVE-2017-5645/): Deserialization of Untrusted Data in Log4j (critical 9.8)
- [CVE-2022-23302](https://insights.sbomify.com/CVE-2022-23302/): Deserialization of untrusted data in JMSSink in Apache Log4j 1.x (high 8.8)
- [CVE-2023-26464](https://insights.sbomify.com/CVE-2023-26464/): Apache Log4j 1.x (EOL) allows DoS in Chainsaw and SocketAppender (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2022-23305 and fix it if it is affected.

What it is: CVE-2022-23305 is a critical SQL injection vulnerability in Broadcom Brocade Sannav, published on 18 Jan 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2022-23305 in the wild and no public exploit code.

Affected packages and fixed versions:
- log4j:log4j (Maven): affected all versions up to 1.2.17; no fix listed
- log4j:log4j (Maven): affected all versions up to 1.2.17; no fix listed
- org.zenframework.z8.dependencies.commons:log4j-1.2.17 (Maven): affected all versions up to 2.0; no fix listed
- org.zenframework.z8.dependencies.commons:log4j-1.2.17 (Maven): affected all versions up to 2.0; no fix listed

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2022-23305/ (Markdown: https://insights.sbomify.com/CVE-2022-23305/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2022-23305
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2022-23305
- OSV: https://osv.dev/vulnerability/CVE-2022-23305

---
From sbomify Insights: https://insights.sbomify.com/CVE-2022-23305/
Summaries are generated and may contain mistakes; the official description above is the record.
