# CVE-2021-45046: Apache Log4j2 Thread Context Message Pattern and Context Lookup Pattern vulnerable to a denial of service attack

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** CRITICAL 9.0
- **CVSS:** 9.0 (v3.1, CNA) `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Network; Attack complexity: High; Privileges required: None; User interaction: None; Scope: Changed (impact reaches other components); Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Yes: in CISA KEV since 2023-05-01; federal due date 2023-05-22; known ransomware use
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 99.98% (percentile 100, 2026-11-26)
- **CWE:** CWE-917
- **Aliases:** GHSA-7rjr-3q55-vv33
- **Published:** 2021-12-14T16:55:09.000Z
- **Modified:** 2026-10-02T20:30:05.438Z

## Who should check

- Projects that depend on Maven package org.apache.logging.log4j:log4j-core (\>= 2.13.0, \< 2.16.0)
- Projects that depend on Maven package org.ops4j.pax.logging:pax-logging-log4j2 (\>= 1.8.0, \< 1.9.2)
- Anyone running Apache Software Foundation Apache Log4j \>= Apache Log4j2, \< 2.16.0

## Description

It was found that the fix to address CVE-2021-44228 in Apache Log4j 2.15.0 was incomplete in certain non-default configurations. This could allows attackers with control over Thread Context Map (MDC) input data when the logging configuration uses a non-default Pattern Layout with either a Context Lookup (for example, $${ctx:loginId}) or a Thread Context Map pattern (%X, %mdc, or %MDC) to craft malicious input data using a JNDI Lookup pattern resulting in an information leak and remote code execution in some environments and local code execution in all environments. Log4j 2.16.0 (Java 8) and 2.12.2 (Java 7) fix this issue by removing support for message lookup patterns and disabling JNDI functionality by default.

## Affected and fixed versions

- Maven `org.apache.logging.log4j:log4j-core`: affected \>= 2.13.0, \< 2.16.0; fixed 2.16.0, 2.12.2, 2.3.1 (osv)
- Maven `org.ops4j.pax.logging:pax-logging-log4j2`: affected \>= 1.8.0, \< 1.9.2; fixed 1.9.2, 1.10.8, 1.11.11, 2.0.12 (osv)
- Apache Software Foundation Apache Log4j: \>= Apache Log4j2, \< 2.16.0 (cvelist)

## Mitigation

- Upgrade org.apache.logging.log4j:log4j-core to one of 2.16.0, 2.12.2, 2.3.1 (or later in the same release line).
- Upgrade org.ops4j.pax.logging:pax-logging-log4j2 to one of 1.9.2, 1.10.8, 1.11.11, 2.0.12 (or later in the same release line).

## Timeline

- 2021-12-14: Published
- 2023-05-01: Added to CISA KEV (exploited in the wild)
- 2023-05-22: CISA remediation due date for US federal agencies
- 2026-10-02: Last modified

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2021-45046. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2021-45046.md
Affected: org.apache.logging.log4j:log4j-core >= 2.13.0, < 2.16.0; org.ops4j.pax.logging:pax-logging-log4j2 >= 1.8.0, < 1.9.2
Fixed in: 2.16.0, 2.12.2, 2.3.1, 1.9.2, 1.10.8, 1.11.11, 2.0.12

Steps:
1. Search this machine and project for org.apache.logging.log4j:log4j-core (Maven), org.ops4j.pax.logging:pax-logging-log4j2 (Maven), Apache Software Foundation Apache Log4j: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2021-45046 being exploited?

Yes. CISA lists CVE-2021-45046 in its Known Exploited Vulnerabilities catalog since 2023-05-01, which means attacks have been seen. No public exploit code is known. EPSS estimates a 99.98% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2021-45046?

Critical: CVSS 9.0 (v3.1, scored by CNA). Remote, no login needed. The attack needs conditions outside the attacker's control, which makes it harder.

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

org.apache.logging.log4j:log4j-core \>= 2.13.0, \< 2.16.0; org.ops4j.pax.logging:pax-logging-log4j2 \>= 1.8.0, \< 1.9.2.

### Is there a fix for CVE-2021-45046?

Yes. Fixed in 2.16.0, 2.12.2, 2.3.1, 1.9.2, 1.10.8, 1.11.11, 2.0.12. Upgrade org.apache.logging.log4j:log4j-core to one of 2.16.0, 2.12.2, 2.3.1 (or later in the same release line). Upgrade org.ops4j.pax.logging:pax-logging-log4j2 to one of 1.9.2, 1.10.8, 1.11.11, 2.0.12 (or later in the same release line).

### How do I check if I'm affected by CVE-2021-45046?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://logging.apache.org/log4j/2.x/security.html>
- vendor: <https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-apache-log4j-qRuKNEbd>
- vendor: <https://www.debian.org/security/2021/dsa-5022>
- vendor: <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/EOKPQGV24RRBBI4TBZUDQMM4MEH7MXCY/>
- vendor: <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/SIG7FZULMNK2XF6FZRU4VWYDQXNMUGAJ/>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2021-45046>
- patch: <https://www.oracle.com/security-alerts/cpujan2022.html>
- other: <https://psirt.global.sonicwall.com/vuln-detail/SNWLID-2021-0032>
- other: <https://www.oracle.com/security-alerts/alert-cve-2021-44228.html>
- other: <https://www.cve.org/CVERecord?id=CVE-2021-44228>
- other: <http://www.openwall.com/lists/oss-security/2021/12/14/4>
- other: <https://www.kb.cert.org/vuls/id/930724>
- other: <https://cert-portal.siemens.com/productcert/pdf/ssa-661247.pdf>
- other: <https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00646.html>
- other: <http://www.openwall.com/lists/oss-security/2021/12/15/3>
- other: <https://cert-portal.siemens.com/productcert/pdf/ssa-714170.pdf>
- other: <http://www.openwall.com/lists/oss-security/2021/12/18/1>
- other: <https://cert-portal.siemens.com/productcert/pdf/ssa-397453.pdf>
- other: <https://cert-portal.siemens.com/productcert/pdf/ssa-479842.pdf>
- other: <https://www.oracle.com/security-alerts/cpuapr2022.html>
- other: <https://www.oracle.com/security-alerts/cpujul2022.html>
- other: <https://security.gentoo.org/glsa/202310-16>
- other: <https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2021-45046>
- other: <https://www.openwall.com/lists/oss-security/2021/12/18/1>
- other: <https://www.openwall.com/lists/oss-security/2021/12/15/3>
- other: <https://www.openwall.com/lists/oss-security/2021/12/14/4>
- other: <https://sec.cloudapps.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-apache-log4j-qRuKNEbd>
- other: <https://logging.apache.org/security.html#CVE-2021-45046>
- other: <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/SIG7FZULMNK2XF6FZRU4VWYDQXNMUGAJ>
- other: <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/EOKPQGV24RRBBI4TBZUDQMM4MEH7MXCY>
- other: <https://github.com/apache/logging-log4j2/compare/rel/2.3...rel/2.3.1>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2021-45046>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-7rjr-3q55-vv33> (license: <https://creativecommons.org/licenses/by/4.0/>)
- CISA KEV: CISA Known Exploited Vulnerabilities Catalog <https://www.cisa.gov/known-exploited-vulnerabilities-catalog>

HTML: <https://flawdb.com/CVE-2021-45046> · JSON: <https://flawdb.com/api/v1/entries/CVE-2021-45046>
