# CVE-2021-4104: Deserialization of untrusted data in JMSAppender in Apache Log4j 1.2


- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Fix available:** Yes
- **Published:** 14 Dec 2021
- **Updated:** 28 May 2026
- **Also known as:** CLEANSTART-2026-FS95827, CLSA-2022-1642429303, CLSA-2022-1642429400, CLSA-2026-1787141079, CLSA-2026-1787546974, DEBIAN-CVE-2021-4104, GHSA-fp5r-v3w9-4333, MINI-5vpg-q97w-mqxp, MINI-phqj-qvjr-xvw4, RHSA-2021:5206, RHSA-2021:5269, ROOT-APP-MAVEN-CVE-2021-4104, SUSE-SU-2021:14866-1, SUSE-SU-2021:4111-1, SUSE-SU-2021:4112-1, SUSE-SU-2021:4115-1, SUSE-SU-2021:4160-1, SUSE-SU-2021:4190-1, SUSE-SU-2022:0126-1, SUSE-SU-2022:0133-1, UBUNTU-CVE-2021-4104, USN-5223-1, USN-5223-2, openSUSE-SU-2021:1612-1, openSUSE-SU-2021:1631-1, openSUSE-SU-2021:4111-1, openSUSE-SU-2021:4112-1, openSUSE-SU-2024:11682-1, openSUSE-SU-2024:11696-1

## What is CVE-2021-4104?

CVE-2021-4104 is a high-severity vulnerability in Fedoraproject Fedora, published on 14 Dec 2021. 

### Official description

JMSAppender in Log4j 1.2 is vulnerable to deserialization of untrusted data when the attacker has write access to the Log4j configuration. The attacker can provide TopicBindingName and TopicConnectionFactoryBindingName configurations causing JMSAppender to perform JNDI requests that result in remote code execution in a similar fashion to CVE-2021-44228. Note this issue only affects Log4j 1.2 when specifically configured to use JMSAppender, which is not the default. 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-502 (Deserialization of Untrusted Data)

## Which versions are affected by CVE-2021-4104?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `log4j:log4j` | Maven | From 1.2.0 to 1.2.17 | None |
| `log4j:log4j` | Maven | From 1.2.0 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 |
| `log4j` | Red Hat:enterprise_linux:7::client | All versions | 0:1.2.17-17.el7_4 |
| `log4j-javadoc` | Red Hat:enterprise_linux:7::client | All versions | 0:1.2.17-17.el7_4 |
| `log4j-manual` | Red Hat:enterprise_linux:7::client | All versions | 0:1.2.17-17.el7_4 |
| `log4j-javadoc` | Red Hat:enterprise_linux:7::computenode | All versions | 0:1.2.17-17.el7_4 |
| `log4j-manual` | Red Hat:enterprise_linux:7::computenode | All versions | 0:1.2.17-17.el7_4 |
| `log4j` | Red Hat:enterprise_linux:7::server | All versions | 0:1.2.17-17.el7_4 |
| `log4j-javadoc` | Red Hat:enterprise_linux:7::server | All versions | 0:1.2.17-17.el7_4 |
| `log4j-manual` | Red Hat:enterprise_linux:7::server | All versions | 0:1.2.17-17.el7_4 |
| `log4j` | Red Hat:enterprise_linux:7::workstation | All versions | 0:1.2.17-17.el7_4 |
| `log4j-javadoc` | Red Hat:enterprise_linux:7::workstation | All versions | 0:1.2.17-17.el7_4 |
| `log4j-manual` | Red Hat:enterprise_linux:7::workstation | All versions | 0:1.2.17-17.el7_4 |
| `log4j` | Red Hat:rhel_aus:7.3::server | All versions | 0:1.2.17-16.el7_3 |
| `log4j-javadoc` | Red Hat:rhel_aus:7.3::server | All versions | 0:1.2.17-16.el7_3 |
| `log4j-manual` | Red Hat:rhel_aus:7.3::server | All versions | 0:1.2.17-16.el7_3 |
| `log4j` | Red Hat:rhel_aus:7.4::server | All versions | 0:1.2.17-17.el7_4 |
| `log4j-javadoc` | Red Hat:rhel_aus:7.4::server | All versions | 0:1.2.17-17.el7_4 |
| `log4j-manual` | Red Hat:rhel_aus:7.4::server | All versions | 0:1.2.17-17.el7_4 |
| `log4j` | Red Hat:rhel_aus:7.6::server | All versions | 0:1.2.17-17.el7_4 |
| `log4j-javadoc` | Red Hat:rhel_aus:7.6::server | All versions | 0:1.2.17-17.el7_4 |
| `log4j-manual` | Red Hat:rhel_aus:7.6::server | All versions | 0:1.2.17-17.el7_4 |
| `log4j` | Red Hat:rhel_aus:7.7::server | All versions | 0:1.2.17-17.el7_4 |
| `log4j-javadoc` | Red Hat:rhel_aus:7.7::server | All versions | 0:1.2.17-17.el7_4 |
| `log4j-manual` | Red Hat:rhel_aus:7.7::server | All versions | 0:1.2.17-17.el7_4 |
| `log4j` | Red Hat:rhel_e4s:7.6::server | All versions | 0:1.2.17-17.el7_4 |
| `log4j-javadoc` | Red Hat:rhel_e4s:7.6::server | All versions | 0:1.2.17-17.el7_4 |
| `log4j-manual` | Red Hat:rhel_e4s:7.6::server | All versions | 0:1.2.17-17.el7_4 |
| `log4j` | Red Hat:rhel_e4s:7.7::server | All versions | 0:1.2.17-17.el7_4 |
| `log4j-javadoc` | Red Hat:rhel_e4s:7.7::server | All versions | 0:1.2.17-17.el7_4 |
| `log4j-manual` | Red Hat:rhel_e4s:7.7::server | All versions | 0:1.2.17-17.el7_4 |
| `log4j` | Red Hat:rhel_els:6 | All versions | 0:1.2.14-6.5.el6_10 |
| `log4j-debuginfo` | Red Hat:rhel_els:6 | All versions | 0:1.2.14-6.5.el6_10 |
| `log4j-javadoc` | Red Hat:rhel_els:6 | All versions | 0:1.2.14-6.5.el6_10 |
| `log4j-manual` | Red Hat:rhel_els:6 | All versions | 0:1.2.14-6.5.el6_10 |
| `rh-maven36-log4j12` | Red Hat:rhel_software_collections:3::el7 | All versions | 0:1.2.17-23.3.el7 |
| `rh-maven36-log4j12-javadoc` | Red Hat:rhel_software_collections:3::el7 | All versions | 0:1.2.17-23.3.el7 |
| `log4j` | Red Hat:rhel_tus:7.6::server | All versions | 0:1.2.17-17.el7_4 |

Products: Apache Log4j, Fedoraproject Fedora, Oracle Advanced Supply Chain Planning, Oracle Business Intelligence, Oracle Business Process Management Suite, Oracle Communications Eagle Ftp Table Base Retrieval, 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 Enterprise Manager Base Platform, Oracle Financial Services Revenue Management and Billing Analytics, Oracle Fusion Middleware Common Libraries and Tools, Oracle Goldengate, Oracle Healthcare Data Repository, Oracle Hyperion Data Relationship Management, Oracle Hyperion Infrastructure Technology, Oracle Identity Management Suite, Oracle Jdeveloper and 26 more.

## How do I fix CVE-2021-4104?

Upgrade to a fixed version.

## Is CVE-2021-4104 being exploited?

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

Public exploit code:

- log4j 1.x RCE Poc -- CVE-2021-4104 (github_poc): https://github.com/cckuailong/log4shell_1.x
- Log4j version 1.2.17 without the offending class responsible for CVE-2021-4104. (github_poc): https://github.com/open-AIMS/log4j
- https://github.com/cuijiung/log4j-CVE-2021-4104 (github_poc): https://github.com/cuijiung/log4j-CVE-2021-4104

## Other vulnerabilities in Fedoraproject Fedora

- [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-2022-23305](https://insights.sbomify.com/CVE-2022-23305/): SQL injection in JDBC Appender in Apache Log4j V1 (critical 9.8)
- [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)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2021-4104 and fix it if it is affected.

What it is: CVE-2021-4104 is a high-severity vulnerability in Fedoraproject Fedora, published on 14 Dec 2021. 
Exploitation: There is no known exploitation of CVE-2021-4104 in the wild and no public exploit code.

Affected packages and fixed versions:
- log4j:log4j (Maven): affected from 1.2.0 up to 1.2.17; no fix listed
- log4j:log4j (Maven): affected from 1.2.0 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-2021-4104/ (Markdown: https://insights.sbomify.com/CVE-2021-4104/index.md)
```

## Sources

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

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