CVERadar
CRITICAL · CVSS 3.1 9CISA KEV · added 2023-05-01Metasploit modulePublic PoCKnown ransomware useEPSS 99.98% (p100)Threat level 95

CVE-2021-45046: Apache Log4j2 Deserialization of Untrusted Data Vulnerability

Apache · Log4j2 · NVD published 2021-12-15 · posted 2026-10-21 · last modified 2026-06-17

What it is

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.

WeaknessCWE-917
CVSS vectorCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H (source: [email protected])
CISA due date2023-05-22 (for US federal agencies under BOD; a good deadline for everyone)
ATT&CK tacticsExecution → Impact

Exploitation evidence

First exploit evidence seen: 2021-12-09 (earliest date across the sources below).

Exploited in the wild

  • CISA KEV: listed since 2023-05-01. Source

Public exploit code

Metasploit

GitHub proof-of-concept repositories

11 public repositories from 11 accounts, first seen 2021-12-15. Most starred: lijiejie/log4j2_vul_local_scanner (85 stars), view repository.

Verify before running: public PoCs can be malicious. Read the code and only run it in an isolated lab. A PoC means exploit code is public, not that this CVE is exploited in the wild.

Sources: CISA KEV · Rapid7 Metasploit Framework module metadata · nomi-sec/PoC-in-GitHub.

Defend the Chain

The attack chain for CVE-2021-45046 laid across the MITRE ATT&CK Enterprise tactics. Solid cards come from the MITRE CTID KEV mappings; dashed cards are inferred by CVERadar from the CWE or description. Correct defences are real ATT&CK mitigations for that technique.

Threat level 95/100
Defender level 1 · 0 XP
Chain links broken: 0/2

Pick a red technique card on the board, then choose the defence that stops it.

Defend against T1059 Command and Scripting Interpreter CTID: primary impact

CVE 2021-45046 is a Log4J-related vulnerability that could enable enables an attacker to cause Remote Code Execution or other effects in certain non-default configurations. This specific vulnerability has been reported to have been leveraged in cryptomining and ransomware operations.

How to fix it

CISA required action

Apply updates per vendor instructions. (source: CISA KEV)

Fixed versions

  • apache log4j: upgrade to 2.12.2 or later (affected from 2.0.1)
  • apache log4j: upgrade to 2.16.0 or later (affected from 2.13.0)
  • siemens captial: upgrade to 2019.1 or later
  • siemens e-car operation center: upgrade to 2021-12-13 or later
  • siemens gma-manager: upgrade to 8.6.2j-398 or later
  • siemens industrial edge management hub: upgrade to 2021-12-13 or later
  • siemens mindsphere: upgrade to 2021-12-11 or later
  • siemens navigator: upgrade to 2021-12-13 or later
  • siemens solid edge harness design: upgrade to 2020 or later
  • siemens spectrum power 4: upgrade to 4.70 or later
  • siemens spectrum power 7: upgrade to 2.30 or later
  • siemens vesys: upgrade to 2019.1 or later
  • sonicwall email security: upgrade to 10.0.12 or later
  • siemens 6bk1602-0aa12-0tp0 firmware: upgrade to 2.7.0 or later
  • siemens 6bk1602-0aa22-0tp0 firmware: upgrade to 2.7.0 or later
  • siemens 6bk1602-0aa32-0tp0 firmware: upgrade to 2.7.0 or later
  • siemens 6bk1602-0aa42-0tp0 firmware: upgrade to 2.7.0 or later
  • siemens 6bk1602-0aa52-0tp0 firmware: upgrade to 2.7.0 or later

Derived from the NVD CPE configuration (versionEndExcluding / versionEndIncluding). Always confirm with the vendor advisory.

Vendor advisories and patches

MITRE ATT&CK mitigations for this chain

  • M1033 Limit Software Installation (for T1059) : Prevent user installation of unrequired command and scripting interpreters.
  • M1045 Code Signing (for T1059) : Where possible, only permit execution of signed scripts.
  • M1042 Disable or Remove Feature or Program (for T1059) : Disable or remove any unnecessary or unused shells or interpreters.
  • M1038 Execution Prevention (for T1059) : Use application control where appropriate. For example, PowerShell Constrained Language mode can be used to restrict access to sensitive or otherwise dangerous language elements such as those used to execute arbitrary Windows APIs or files (e.g., `Add-Type`).
  • M1049 Antivirus/Antimalware (for T1059) : Anti-virus can be used to automatically quarantine suspicious files.
  • M1026 Privileged Account Management (for T1059) : When PowerShell is necessary, consider restricting PowerShell execution policy to administrators. Be aware that there are methods of bypassing the PowerShell execution policy, depending on environment configuration. PowerShell JEA (Just Enough Administration) may also be used to sandbox administration and limit what c
  • M1047 Audit (for T1059) : Inventory systems for unauthorized command and scripting interpreter installations.
  • M1021 Restrict Web-Based Content (for T1059) : Script blocking extensions can help prevent the execution of scripts and HTA files that may commonly be used during the exploitation process. For malicious code served up through ads, adblockers can help prevent that code from executing in the first place.
  • M1040 Behavior Prevention on Endpoint (for T1059, T1486) : On Windows 10, enable Attack Surface Reduction (ASR) rules to prevent [Visual Basic](https://attack.mitre.org/techniques/T1059/005) and [JavaScript](https://attack.mitre.org/techniques/T1059/007) scripts from executing potentially malicious downloaded content .
  • M1053 Data Backup (for T1486) : Consider implementing IT disaster recovery plans that contain procedures for regularly taking and testing data backups that can be used to restore organizational data. Ensure backups are stored off system and is protected from common methods adversaries may use to gain access and destroy the backups to prevent recovery

Detection Generic guidance

  • Execution: Watch for the service process spawning shells or script interpreters (cmd.exe, powershell, sh, bash, python) via EDR process-tree rules.
  • Impact: Monitor service availability, unexpected encryption activity and mass file changes.

Response checklist Generic guidance

  1. Inventory: find every instance of the affected product and version (include internet-facing and forgotten ones).
  2. Patch or mitigate per the vendor advisory; if you cannot patch, remove internet exposure or apply the vendor workaround.
  3. Assume compromise if the system was exposed before patching: hunt for the indicators in the advisory and review logs back to the disclosure date.
  4. Rotate credentials and secrets stored on or used by the affected system if compromise cannot be ruled out.

Sources