# CVE-2021-45105: Apache Log4j2 does not always protect from infinite recursion in lookup evaluation

> An attacker controlling Thread Context Map data can cause a denial of service via infinite recursion in Log4j2 lookup evaluation.

- **Severity:** Medium 5.9 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/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 Dec 2021
- **Updated:** 29 May 2026
- **Also known as:** DEBIAN-CVE-2021-45105, DSA-5024-1, GHSA-p6xc-xr62-6r2g, MGASA-2021-0572, MINI-24mm-f3g3-p5hx, RHSA-2022:1462, RHSA-2022:1463, ROOT-APP-MAVEN-CVE-2021-45105, UBUNTU-CVE-2021-45105, USN-5203-1, openSUSE-SU-2021:1605-1, openSUSE-SU-2021:4118-1, openSUSE-SU-2024:11691-1

## What is CVE-2021-45105?

CVE-2021-45105 is a medium-severity denial of service vulnerability in Debian Debian Linux, published on 18 Dec 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Apache Log4j2 versions 2.0-alpha1 through 2.16.0 (excluding 2.12.3 and 2.3.1) did not protect from uncontrolled recursion from self-referential lookups. This allows an attacker with control over Thread Context Map data to cause a denial of service when a crafted string is interpreted. This issue was fixed in Log4j 2.17.0, 2.12.3, and 2.3.1.

Weakness: CWE-674 (Uncontrolled Recursion), CWE-20 (Improper Input Validation)

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

14 open source packages ship an affected version, including org.ops4j.pax.logging:pax-logging-log4j2 and org.apache.logging.log4j:log4j-core. It affects 116 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.ops4j.pax.logging:pax-logging-log4j2` | Maven | From 1.10.0 | 1.10.9 |
| `org.ops4j.pax.logging:pax-logging-log4j2` | Maven | From 1.10.0 | 1.10.9 |
| `org.ops4j.pax.logging:pax-logging-log4j2` | Maven | From 1.11.0 | 1.11.12 |
| `org.ops4j.pax.logging:pax-logging-log4j2` | Maven | From 1.11.0 | 1.11.12 |
| `org.ops4j.pax.logging:pax-logging-log4j2` | Maven | From 1.8.0 | 1.9.2 |
| `org.ops4j.pax.logging:pax-logging-log4j2` | Maven | From 1.8.0 | 1.9.2 |
| `org.ops4j.pax.logging:pax-logging-log4j2` | Maven | From 2.0.0 | 2.0.13 |
| `org.ops4j.pax.logging:pax-logging-log4j2` | Maven | From 2.0.0 | 2.0.13 |
| `org.apache.logging.log4j:log4j-core` | Maven | All versions | 2.3.1 |
| `org.apache.logging.log4j:log4j-core` | Maven | All versions | 2.3.1 |
| `org.apache.logging.log4j:log4j-core` | Maven | From 2.13.0 | 2.17.0 |
| `org.apache.logging.log4j:log4j-core` | Maven | From 2.13.0 | 2.17.0 |
| `org.apache.logging.log4j:log4j-core` | Maven | From 2.4.0 | 2.12.3 |
| `org.apache.logging.log4j:log4j-core` | Maven | From 2.4.0 | 2.12.3 |
| `rh-sso7-keycloak` | Red Hat:red_hat_single_sign_on:7.5::el7 | All versions | 0:15.0.6-1.redhat_00001.1.el7sso |
| `rh-sso7-keycloak-server` | Red Hat:red_hat_single_sign_on:7.5::el7 | All versions | 0:15.0.6-1.redhat_00001.1.el7sso |
| `rh-sso7-keycloak` | Red Hat:red_hat_single_sign_on:7.5::el8 | All versions | 0:15.0.6-1.redhat_00001.1.el8sso |
| `rh-sso7-keycloak-server` | Red Hat:red_hat_single_sign_on:7.5::el8 | All versions | 0:15.0.6-1.redhat_00001.1.el8sso |
| `log4j` | openSUSE:Leap 15.2 | All versions | 2.17.0-lp152.3.12.1 |
| `log4j` | openSUSE:Leap 15.3 | All versions | 2.17.0-4.13.1 |

Products: Apache Log4j, Debian Debian Linux, Netapp Cloud Manager, Oracle Agile Engineering Data Management, Oracle Agile Plm Mcad Connector, Oracle Agile Product Lifecycle Management, Oracle Autovue for Agile Product Lifecycle Management, Oracle Banking Deposits and Lines of Credit Servicing, Oracle Banking Enterprise Default Management, Oracle Banking Loans Servicing, Oracle Banking Party Management, Oracle Banking Payments, Oracle Banking Platform, Oracle Banking Trade Finance, Oracle Banking Treasury Management, Oracle Business Intelligence, Oracle Communications Asap, Oracle Communications Billing and Revenue Management, Oracle Communications Cloud Native Core Console, Oracle Communications Cloud Native Core Network Function Cloud Native Environment and 96 more.

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

Upgrade org.ops4j.pax.logging:pax-logging-log4j2 to a fixed version for your release line: 1.10.9, 1.11.12, 1.9.2 or 2.0.13.

## Is CVE-2021-45105 being exploited?

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

Public exploit code:

- Log4j_dos_CVE-2021-45105 (github_poc): https://github.com/cckuailong/Log4j_dos_CVE-2021-45105
- log4j2 dos exploit,CVE-2021-45105 exploit,Denial of Service poc (github_poc): https://github.com/iAmSOScArEd/log4j2_dos_exploit
- Discover and remediate Log4Shell vulnerability [CVE-2021-45105] (github_poc): https://github.com/name/log4j-remediation
- https://github.com/pravin-pp/log4j2-CVE-2021-45105 (github_poc): https://github.com/pravin-pp/log4j2-CVE-2021-45105
- Replicating CVE-2021-45105 (github_poc): https://github.com/tejas-nagchandi/CVE-2021-45105
- https://github.com/dileepdkumar/https-github.com-pravin-pp-log4j2-CVE-2021-45105-1 (github_poc): https://github.com/dileepdkumar/https-github.com-pravin-pp-log4j2-CVE-2021-45105-1

## Other vulnerabilities in Debian Debian Linux

- [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-45105 and fix it if it is affected.

What it is: CVE-2021-45105 is a medium-severity denial of service vulnerability in Debian Debian Linux, published on 18 Dec 2021. 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-2021-45105 in the wild and no public exploit code.

Affected packages and fixed versions:
- org.ops4j.pax.logging:pax-logging-log4j2 (Maven): affected from 1.10.0; fixed in 1.10.9
- org.ops4j.pax.logging:pax-logging-log4j2 (Maven): affected from 1.10.0; fixed in 1.10.9
- org.ops4j.pax.logging:pax-logging-log4j2 (Maven): affected from 1.11.0; fixed in 1.11.12
- org.ops4j.pax.logging:pax-logging-log4j2 (Maven): affected from 1.11.0; fixed in 1.11.12
- org.ops4j.pax.logging:pax-logging-log4j2 (Maven): affected from 1.8.0; fixed in 1.9.2
- org.ops4j.pax.logging:pax-logging-log4j2 (Maven): affected from 1.8.0; fixed in 1.9.2
- org.ops4j.pax.logging:pax-logging-log4j2 (Maven): affected from 2.0.0; fixed in 2.0.13
- org.ops4j.pax.logging:pax-logging-log4j2 (Maven): affected from 2.0.0; fixed in 2.0.13
- org.apache.logging.log4j:log4j-core (Maven): affected all versions; fixed in 2.3.1
- org.apache.logging.log4j:log4j-core (Maven): affected all versions; fixed in 2.3.1
- org.apache.logging.log4j:log4j-core (Maven): affected from 2.13.0; fixed in 2.17.0
- org.apache.logging.log4j:log4j-core (Maven): affected from 2.13.0; fixed in 2.17.0

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-45105/ (Markdown: https://insights.sbomify.com/CVE-2021-45105/index.md)
```

## Sources

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

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