CVE-2021-45046 Apache Log4j2 Deserialization of Untrusted Data

Exploited in the wild Critical 9.0 Published Updated

Attackers can achieve remote or local code execution and information disclosure via crafted JNDI inputs in specific non-default Log4j2 configurations.

Exploited in the wild
Since 1 May 2023
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2021-45046?

CVE-2021-45046 is a critical code injection vulnerability in Debian Debian Linux, published on 14 Dec 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.

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.

Weakness: CWE-917

Which versions are affected by CVE-2021-45046?

14 open source packages ship an affected version, including org.ops4j.pax.logging:pax-logging-log4j2 and org.apache.logging.log4j:log4j-core. It affects 55 products.

PackageAffectedFixed in
org.ops4j.pax.logging:pax-logging-log4j2 MavenFrom 1.10.01.10.8
org.ops4j.pax.logging:pax-logging-log4j2 MavenFrom 1.10.01.10.8
org.ops4j.pax.logging:pax-logging-log4j2 MavenFrom 1.11.01.11.11
org.ops4j.pax.logging:pax-logging-log4j2 MavenFrom 1.11.01.11.11
org.ops4j.pax.logging:pax-logging-log4j2 MavenFrom 1.8.01.9.2
org.ops4j.pax.logging:pax-logging-log4j2 MavenFrom 1.8.01.9.2
8 more packages
org.ops4j.pax.logging:pax-logging-log4j2 MavenFrom 2.0.02.0.12
org.ops4j.pax.logging:pax-logging-log4j2 MavenFrom 2.0.02.0.12
org.apache.logging.log4j:log4j-core MavenAll versions2.3.1
org.apache.logging.log4j:log4j-core MavenAll versions2.3.1
org.apache.logging.log4j:log4j-core MavenFrom 2.13.02.16.0
org.apache.logging.log4j:log4j-core MavenFrom 2.13.02.16.0
org.apache.logging.log4j:log4j-core MavenFrom 2.4.02.12.2
org.apache.logging.log4j:log4j-core MavenFrom 2.4.02.12.2

Products include Apache Log4j, Cvat Computer Vision Annotation Tool, Debian Debian Linux, Fedoraproject Fedora, Intel Audio Development Kit, Intel Datacenter Manager and 49 more.

How do I fix CVE-2021-45046?

Upgrade org.ops4j.pax.logging:pax-logging-log4j2 to a fixed version for your release line: 1.10.8, 1.11.11, 1.9.2 or 2.0.12. US federal agencies must fix it by 22 May 2023.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2021-45046 being exploited?

Yes. Attackers have exploited CVE-2021-45046 in the wild since at least 1 May 2023, including in ransomware campaigns.

Public exploit code: 1 Metasploit module, 1 Nuclei template and 11 proofs of concept on GitHub.

All Debian Debian Linux vulnerabilities

Sources

Also known as DEBIAN-CVE-2021-45046, DSA-5022-1, GHSA-7rjr-3q55-vv33, MGASA-2021-0566, MINI-x4gq-qjph-q7m9, OESA-2021-1467 and 1 more.

Is CVE-2021-45046 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free