CVEfocus › CVE database › CVE-2021-45046

CVE-2021-45046Apache Log4j2 Thread Context Message Pattern and Context Lookup Pattern vulnerable to a…

Known exploited (CISA KEV) · ransomwareCVSS 9.0 CriticalEPSS 99.9% (in the top 1% of all CVEs)Published 2021-12-14Updated 2025-10-21Assigner: apache

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.

CWE-917

What to do

This CVE is being exploited in the wild (CISA Known Exploited Vulnerabilities, added 2023-05-01). If you run an affected version, patch or mitigate now.

Fixed builds are available from Debian, Maven, Ubuntu: see the table below for the fixed version per release.

Ubuntu has not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

6Fixed
1Fix pending
10Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 22.04apache-log4j2Not affected
vulnerable_code_not_present
Ubuntu 20.04apache-log4j2Fixed2.16.0-0.20.04.1UBUNTU-CVE-2021-45046
Ubuntu 18.04apache-log4j2Not affected
vulnerable_code_not_present
Ubuntu 16.04apache-log4j2Fix pending
Debian 14apache-log4j2Fixed2.16.0-1DEBIAN-CVE-2021-45046
Debian 13apache-log4j2Fixed2.16.0-1DEBIAN-CVE-2021-45046
Debian 12apache-log4j2Fixed2.16.0-1DEBIAN-CVE-2021-45046
Red Hat Enterprise Linux 8log4j12Not affected
Red Hat Enterprise Linux 8log4j12-javadocNot affected
Red Hat Enterprise Linux 7log4jNot affected
Red Hat Enterprise Linux 7log4j-javadocNot affected
Red Hat Enterprise Linux 7log4j-manualNot affected
Red Hat Enterprise Linux 6log4jNot affected
Red Hat Enterprise Linux 6log4j-javadocNot affected
Red Hat Enterprise Linux 6log4j-manualNot affected
Maven libraryorg.apache.logging.log4j:log4j-coreFixed2.12.2GHSA-7rjr-3q55-vv33
Maven libraryorg.ops4j.pax.logging:pax-logging-log4j2Fixed2.0.12GHSA-7rjr-3q55-vv33

What the vendor says

As published in the CVE record by apache, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

Vendor advisories:

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.