CVE-2021-45046Apache Log4j2 Thread Context Message Pattern and Context Lookup Pattern vulnerable to a denial of service attack
- 9.0CriticalCVSS base score
- 100.0%Exploitation in 30 daysEPSS · top 0.1% of all CVEs
- YesKnown exploitedin CISA's KEV since 1 May 2023
- 2Public exploitsMetasploit, Nuclei and Exploit-DB
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.
Exploited in the wild
CISA lists this vulnerability in its Known Exploited Vulnerabilities catalog as Apache Log4j2 Deserialization of Untrusted Data Vulnerability.
- Added
- 1 May 2023
- Fix due (US federal)
- 22 May 2023
- Used by ransomware
- Known
Apply updates per vendor instructions.
ENISA's EU Vulnerability Database lists it as exploited, from CISA's KEV, since 1 May 2023.
Public exploit
An exploit or proof of concept is public: anyone can try it against an unpatched system. The public collections list a Metasploit module and a Nuclei template for it. CISA's SSVC rates its exploitation: it is being exploited.
Show the exploits2
Metasploit modules1 module
- Log4Shell HTTP Scanner (Metasploit module) (opens in a new tab)
auxiliary/scanner/http/log4shell_scannerRank normaldisclosed 9 Dec 2021
Nuclei templates1 template
- Apache Log4j2 - Remote Code Injection (Nuclei template) (opens in a new tab)
http/cves/2021/CVE-2021-45046.yamlSeverity critical
Modules, templates and exploits as listed by the Metasploit Framework (BSD-3-Clause), ProjectDiscovery's Nuclei templates (MIT) and the Exploit Database (GPLv2), read once a day. Where the data comes from
Timeline
ID reserved
By apache
Published
- 17 months later
· 17 months later
Added to CISA KEV
Known exploited, also by ransomware
- 2 years later
· 2 years later
Record updated
Changes after publication (a new score, a public exploit, EPSS crossing 1, 10 or 50 %, leaving KEV) are kept since November 2026; earlier ones are not known.
Scores
| Scored by | CVSS | Score | Vector |
|---|---|---|---|
| CISA-ADPADP (enrichment) | 3.1 | Critical9.0 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H |
| NVDNVD · Analyzed | 3.1 | Critical9.0 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H |
- EPSS (exploitation in 30 days)
- 100.0% · top 0.1% of all CVEs (18 Nov 2026)
- CISA SSVC
- Exploitation: active · Automatable: no · Technical impact: total
The list uses the assigner's score when there is one, then CISA's, then NVD's: Critical 9.0.
Affected products
Apache Software Foundation · Apache Log4j
- affected Apache Log4j2 – < 2.16.0
Affected packages
From reviewed advisories of the GitHub Advisory Database.
- Mavenorg.apache.logging.log4j:log4j-coreGHSA-7rjr-3q55-vv33 (opens in a new tab)
- Mavenorg.ops4j.pax.logging:pax-logging-log4j2GHSA-7rjr-3q55-vv33 (opens in a new tab)
References
References22
- https://psirt.global.sonicwall.com/vuln-detail/SNWLID-2021-0032 (opens in a new tab)x_refsource_CONFIRMx_transferred
- https://www.oracle.com/security-alerts/alert-cve-2021-44228.html (opens in a new tab)x_refsource_CONFIRMx_transferred
- https://www.cve.org/CVERecord?id=CVE-2021-44228 (opens in a new tab)x_refsource_MISCx_transferred
- [oss-security] 20211214 CVE-2021-45046: Apache Log4j2 Thread Context Message Pattern and Context Lookup Pattern vulnerable to a denial of service attack (opens in a new tab)mailing-listx_refsource_MLISTx_transferred
- https://logging.apache.org/log4j/2.x/security.html (opens in a new tab)x_refsource_CONFIRMx_transferred
- VU#930724 (opens in a new tab)third-party-advisoryx_refsource_CERT-VNx_transferred
- https://cert-portal.siemens.com/productcert/pdf/ssa-661247.pdf (opens in a new tab)x_refsource_CONFIRMx_transferred
- https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00646.html (opens in a new tab)x_refsource_CONFIRMx_transferred
- 20211210 Vulnerabilities in Apache Log4j Library Affecting Cisco Products: December 2021 (opens in a new tab)vendor-advisoryx_refsource_CISCOx_transferred
- [oss-security] 20211215 Re: CVE-2021-45046: Apache Log4j2 Thread Context Message Pattern and Context Lookup Pattern vulnerable to a denial of service attack (opens in a new tab)mailing-listx_refsource_MLISTx_transferred
- https://cert-portal.siemens.com/productcert/pdf/ssa-714170.pdf (opens in a new tab)x_refsource_CONFIRMx_transferred
- DSA-5022 (opens in a new tab)vendor-advisoryx_refsource_DEBIANx_transferred
- [oss-security] 20211218 Re: CVE-2021-45046: Apache Log4j2 Thread Context Message Pattern and Context Lookup Pattern vulnerable to a denial of service attack (opens in a new tab)mailing-listx_refsource_MLISTx_transferred
- https://cert-portal.siemens.com/productcert/pdf/ssa-397453.pdf (opens in a new tab)x_refsource_CONFIRMx_transferred
- https://cert-portal.siemens.com/productcert/pdf/ssa-479842.pdf (opens in a new tab)x_refsource_CONFIRMx_transferred
- FEDORA-2021-5c9d12a93e (opens in a new tab)vendor-advisoryx_refsource_FEDORAx_transferred
- FEDORA-2021-abbe24e41c (opens in a new tab)vendor-advisoryx_refsource_FEDORAx_transferred
- https://www.oracle.com/security-alerts/cpujan2022.html (opens in a new tab)x_refsource_MISCx_transferred
- https://www.oracle.com/security-alerts/cpuapr2022.html (opens in a new tab)x_refsource_MISCx_transferred
- https://www.oracle.com/security-alerts/cpujul2022.html (opens in a new tab)x_refsource_MISCx_transferred
- https://security.gentoo.org/glsa/202310-16 (opens in a new tab)x_transferred
- https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2021-45046 (opens in a new tab)government-resource
Sources
The same CVE in the primary databases and aggregators, to check against.
- CVE.org record (opens in a new tab)
- CVE List JSON (GitHub) (opens in a new tab)
- NVD (opens in a new tab)
- CISA KEV catalog (opens in a new tab)
- FIRST EPSS (opens in a new tab)
- EUVD EUVD-2021-34769 (opens in a new tab)
- OSV.dev (opens in a new tab)
- GitHub Advisory GHSA-7rjr-3q55-vv33 (opens in a new tab)
- CIRCL Vulnerability-Lookup (opens in a new tab)
Badge for a README or a ticket
[](https://cveledger.app/cve/CVE-2021-45046)Record last updated .