CVE-2021-45046: Apache Log4j2 Deserialization of Untrusted Data
Apache Log4j2 · listed in the CISA catalog of actively exploited vulnerabilities since 2023-05-01.
- CVSS v3.1 (CVE record)
- 9.0
- critical
- EPSS (exploit probability, 30 days)
- >99.9%
- among the highest 0.1% of all CVEs
- Added to CISA KEV
- 2023-05-01
- US federal due date 2023-05-22
- Ubuntu priority
- high
CVE-2021-45046 explained
CVE-2021-45046 exists because the earlier fix for CVE-2021-44228 in Apache Log4j2 was incomplete in certain non-default configurations. Attacker-crafted Thread Context Map (MDC) data containing a JNDI Lookup pattern can cause an information leak and code execution. It is listed in the CISA Known Exploited Vulnerabilities catalog with known ransomware use.
Impact
An attacker who controls Thread Context Map (MDC) input can cause an information leak, remote code execution in some environments and local code execution in all environments. This requires a non-default Pattern Layout that uses a Context Lookup or a Thread Context Map pattern (%X, %mdc or %MDC). The attack works over the network without privileges or user interaction. Attack complexity is high. The impact can extend beyond the vulnerable component.
Who is affected
The facts list one affected Ubuntu release. On Ubuntu 20.04 LTS, the source package apache-log4j2 is fixed in version 2.16.0-0.20.04.1, available from the standard archive. Standard support for Ubuntu 20.04 LTS has ended, and further fixes for that release are only available with Ubuntu Pro (ESM). The facts contain no Debian information.
Written with AI from the data on this page and checked against it automatically.
Official 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.
CISA required action: Apply updates per vendor instructions.
CISA notes
Upstream versions (CVE record)
From the CVE record published by the vendor or CVE numbering authority.
- Apache Software Foundation Apache Log4jAffectedFixed in
- ≥ Apache Log4j2, < 2.16.0
- 2.16.0
| Product | Affected | Fixed in |
|---|---|---|
| Apache Software Foundation Apache Log4j |
|
|
Ubuntu and Debian releases
A server is vulnerable if it has a package built from the listed source package installed in a version lower than the fixed version for its release.
Ubuntu 20.04 LTS·apache-log4j2
Fixed: 2.16.0-0.20.04.1
What to do
- Find all systems running Ubuntu 20.04 LTS that have packages built from
apache-log4j2installed. - Update
apache-log4j2to version2.16.0-0.20.04.1or later. - Restart every Java application and service that uses Log4j2 so it loads the fixed library.
- Check applications for bundled copies of Log4j2 that the system package update does not replace.
- Consider enabling Ubuntu Pro (ESM) or upgrading to a supported release, because standard support for Ubuntu 20.04 LTS has ended.
Written with AI from the data on this page and checked against it automatically.
Check and fix on a server
Run on each Ubuntu or Debian server. Replace apache-log4j2 with the source package from the table above.
1. Show installed packages built from the source package, with their versions
dpkg-query -W -f='${binary:Package} ${Version} ${source:Package}\n' | awk '$3=="apache-log4j2"'2. Compare each installed version with the fixed version for your release from the table
I=INSTALLED_VERSION; F=FIXED_VERSION # replace both
dpkg --compare-versions "$I" lt "$F"; case $? in 0) echo vulnerable ;; 1) echo "fixed or newer" ;; *) echo "check the versions" ;; esac3. Install the fix
sudo apt update && sudo apt install --only-upgrade $(dpkg-query -W -f='${binary:Package} ${source:Package}\n' | awk '$2=="apache-log4j2"{print $1}')Services keep running the old code until they are restarted – restart the affected service or check with needrestart.
CISA's assessment (SSVC)
- Exploitation
- Exploited in the wild
- Automatable
- No – each attack needs manual steps
- Technical impact
- Total – full control of the component or total information disclosure
Weakness: CWE-917 Improper Neutralization of Special Elements used in an Expression Language Statement ('Expression Language Injection')
Questions about CVE-2021-45046
- Are default Log4j2 configurations affected?
- The issue applies to certain non-default configurations. These use a Pattern Layout with a Context Lookup or a Thread Context Map pattern (%X, %mdc or %MDC). Apply the update anyway, because the issue is known to be exploited.
- Is this vulnerability exploited in the wild?
- Yes. CISA added it to its Known Exploited Vulnerabilities catalog on 2023-05-01, with known ransomware use. CISA's required action is to apply updates per vendor instructions.
- Do I need to restart anything after updating?
- Yes. Running Java applications keep using the old library until they are restarted. Restart all services that use Log4j2 after the update.
Written with AI from the data on this page and checked against it automatically.
References
Other advisories
- psirt.global.sonicwall.com/vuln-detail/SNWLID-2021-0032
- oracle.com/security-alerts/alert-cve-2021-44228.html
- cert-portal.siemens.com/productcert/pdf/ssa-661247.pdf
- intel.com/content/www/us/en/security-center/advisory/inte…
- 20211210 Vulnerabilities in Apache Log4j Library Affecting Cisco Products: December 2021
Data: CISA Known Exploited Vulnerabilities (public domain) · CVE Program records incl. CISA ADP enrichment · OSV.dev (CC BY 4.0) incl. Ubuntu and Debian security data · FIRST EPSS · endoflife.date. Updated automatically – facts last changed 2026-11-21. Always confirm with the vendor's or distribution's advisory before patching.