CVE-2021-45105 — log4j-core
MEDIUMCVE-2021-45105 is a medium-severity (CVSS 5.9) Improper Input Validation vulnerability in org.apache.logging.log4j:log4j-core. 4 public exploit references exist, so weaponization risk is real. A fix is available for org.apache.logging.log4j:log4j-core — see the affected versions and patch details below.
Apache Log4j2 vulnerable to Improper Input Validation and Uncontrolled Recursion
Exploitation Status
No confirmed exploitation observed yet
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2021-45105.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
CVE-2021-45105 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.
Where this sits among everything scored
Of 394,415 CVEs with a current EPSS score, this one falls in the ≥ 90% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
org.apache.logging.log4j:log4j-core☕org.apache.logging.log4j:log4j-core☕org.apache.logging.log4j:log4j-core☕org.ops4j.pax.logging:pax-logging-log4j2☕org.ops4j.pax.logging:pax-logging-log4j2☕org.ops4j.pax.logging:pax-logging-log4j2☕org.ops4j.pax.logging:pax-logging-log4j2Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects Maven packages — download data is not available via public APIs for these ecosystems.
Description
Apache Log4j2 versions 2.0-alpha1 through 2.16.0 (excluding 2.12.3) 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 and 2.12.3.
Affected packages
Only the org.apache.logging.log4j:log4j-core package is directly affected by this vulnerability. The org.apache.logging.log4j:log4j-api should be kept at the same version as the org.apache.logging.log4j:log4j-core package to ensure compatability if in use.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| ☕Maven | org.apache.logging.log4j:log4j-core | ≥ 2.4.0&&< 2.12.3 | 2.12.3org.apache.logging.log4j:log4j-core:2.12.3 |
| ☕Maven | org.apache.logging.log4j:log4j-core | ≥ 2.13.0&&< 2.17.0 | 2.17.0org.apache.logging.log4j:log4j-core:2.17.0 |
| ☕Maven | org.apache.logging.log4j:log4j-core | all versions | 2.3.1org.apache.logging.log4j:log4j-core:2.3.1 |
| ☕Maven | org.ops4j.pax.logging:pax-logging-log4j2 | ≥ 1.8.0&&< 1.9.2 | 1.9.2org.ops4j.pax.logging:pax-logging-log4j2:1.9.2 |
| ☕Maven | org.ops4j.pax.logging:pax-logging-log4j2 | ≥ 1.10.0&&< 1.10.9 | 1.10.9org.ops4j.pax.logging:pax-logging-log4j2:1.10.9 |
| ☕Maven | org.ops4j.pax.logging:pax-logging-log4j2 | ≥ 1.11.0&&< 1.11.12 | 1.11.12org.ops4j.pax.logging:pax-logging-log4j2:1.11.12 |
Affected Products
log4japachedebian linuxdebiancloud managernetappagile engineering data managementoracleagile plm mcad connectororacleagile product lifecycle managementoracleResearch use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for org.apache.logging.log4j:log4j-core, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update org.apache.logging.log4j:log4j-core to 2.12.3 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2021-45105 is resolved across your whole dependency graph.
Workarounds
Cap what an attacker can consume: apply request size, rate and timeout limits in front of the affected component, and run it with memory and CPU limits so exhaustion degrades one worker rather than the whole service.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
Red Hat Product Security has performed an analysis of this flaw and has classified the Attack Complexity(AC) as High because there are multiple factors involved which are beyond attacker's control: - The application has to use the logging configuration using a Context Map Lookup (for example, $${ctx:loginId}) which is…
For Log4j 2 versions up to and including 2.16.0, this flaw can be mitigated by: - In PatternLayout in the Log4j logging configuration, replace Context Lookups like ${ctx:loginId} or $${ctx:loginId} with Thread Context Map patterns (%X, %mdc, or %MDC) like %X{loginId}. - Otherwise, in the Log4j logging configuration, remove references to Context Lookups like ${ctx:loginId} or $${ctx:loginId} where they originate from sources external to the application such as HTTP headers or user input.Source: Red Hat security advisory for CVE-2021-45105 (CC BY 4.0)
| Product | Fixed in | Advisory |
|---|---|---|
| OpenShift Logging 5.0 | openshift-logging/elasticsearch6-rhel8:v5.0.11-2 | RHSA-2022:0047 |
| OpenShift Logging 5.1 | openshift-logging/elasticsearch6-rhel8:v6.8.1-82 | RHSA-2022:0042 |
| OpenShift Logging 5.2 | openshift-logging/elasticsearch6-rhel8:v6.8.1-83 | RHSA-2022:0043 |
| OpenShift Logging 5.3 | openshift-logging/elasticsearch6-rhel8:v6.8.1-84 | RHSA-2022:0044 |
| Red Hat AMQ Streams 1.6.6 | see advisory | RHSA-2022:0219 |
| Red Hat Data Grid 8.2.3 | log4j-core | RHSA-2022:0205 |
| Red Hat Fuse 7.8.2, 7.9.1, 7.10.1 | log4j-core | RHSA-2022:0203 |
| Red Hat Integration Camel Extensions for Quarkus 2.2 | see advisory | RHSA-2022:0222 |
Frequently Asked Questions
Is CVE-2021-45105 in your dependencies?
Find it across Maven, including transitive dependencies.