Table of contents
Title
Table of contents
Title

Log4Shell

Updated

Log4Shell is the remote code execution vulnerability tracked as CVE-2021-44228 in Apache Log4j. In the affected releases, a string an attacker pushes into a log line — a username, an HTTP header, a chat message — is processed as a JNDI lookup, and the application fetches and runs code from a server the attacker controls.

Five years on, CISA still lists Log4Shell among the vulnerabilities known to be exploited, and flags it as used in ransomware campaigns. The reason is rarely the patch. It is the inventory. In Fluid Attacks' benchmark of 36 third-party AppSec tools against a web application containing 1,201 vulnerabilities, the best automated scanner reported 22.7% of them — 8.8% of its total risk exposure. A dependency is only as fixed as your inventory is complete.

This page covers what Log4Shell is, how the JNDI lookup chain works, how it differs from the three Log4j flaws that followed, how to find the library in indirect dependencies and packaged artifacts, and how to verify and rank the fix.

What is Log4Shell?

Log4Shell is the name given to CVE-2021-44228, a critical flaw that lets an unauthenticated attacker run arbitrary code on a server by getting a crafted string into something the application logs. Log4j is one of the most widely used logging libraries in Java, which turned a single library bug into an internet-wide event.

The scope is narrower than the panic suggested, and the detail matters when you scan. According to the CVE record published by the Apache Software Foundation as CVE Numbering Authority, Log4Shell affects log4j-core from 2.0-beta9 through 2.15.0, excluding the security releases 2.12.2, 2.12.3 and 2.3.1.

What Log4Shell is not: a flaw in every Log4j module. The same record states it is specific to log4j-core and does not affect log4net, log4cxx or other Apache Logging Services projects. Nor is it Log4j 1.x, which reached end of life in 2015 and carries separate issues.

The CVE record credits the discovery to Chen Zhaojun of the Alibaba Cloud Security Team and was published on December 10, 2021. What made Log4Shell legible to people who had never opened a pom.xml were the public demonstrations in Minecraft Java Edition, where a crafted message typed into a server's chat box reached the logging system — an example Fluid Attacks covered at the time. They showed the mechanism, not a breach of any particular service.

How does Log4Shell work?

Log4Shell works because Log4j treated log messages as something to interpret rather than something to record. In the affected versions, message lookup substitution expanded ${...} expressions inside a log message, and one of the resolvers it reached was JNDI, the Java Naming and Directory Interface.

The chain has five links, none of which requires the attacker to be authenticated:

  1. Attacker-controlled input: any field the application logs — a User-Agent header, a login name, a filename.

  2. The log call: the value is written through the logging library.

  3. Lookup substitution: Log4j expands the ${jndi:...} expression inside the message instead of writing it out literally.

  4. The outbound request: JNDI contacts the LDAP or RMI endpoint named in the string, on a host the attacker controls.

  5. The payload: the server returns a reference to a remote Java class, which the application loads and executes.

The result is remote code execution with the privileges of the Java process, which is what separates Log4Shell from an ordinary logging bug. What follows depends on the attacker: cryptomining, a reverse shell, credential theft, a foothold to sell.

Two details explain why Log4Shell mitigation advice shifted so often in December 2021. The attacker never needs to reach the logging configuration — only a field that ends up logged, which is usually everything. And the exploit string can be obfuscated, which is why rules matching on ${jndi:ldap:// alone aged badly; the joint advisory on mitigating Log4Shell warned that actors were adopting increasingly sophisticated obfuscation techniques.

Apache's answer was to change the default: from 2.15.0 the behavior is disabled, and from 2.16.0 — with 2.12.2, 2.12.3 and 2.3.1 — the functionality was removed entirely.

Why was Log4Shell so critical?

Java stands as one of the leading programming languages being used for many backend systems, from small business servers to organizational automation systems and IoT devices. The majority of these systems implement logging by different means. The simplest way to do this has been to use the Log4j library. After it was reported that the library contained a vulnerability, many declared it a critical breach because:

  • Log4Shell, being a zero-day vulnerability, was something cybercriminals took advantage of before anyone knew about it. Evidence indicates that the attackers first exploited it a few days prior to its public announcement.

  • About 40% of all networks across the world could be vulnerable to Log4j flaws. At the time, the most affected commercial services included Amazon Web Services, iCloud, Cloudflare, Minecraft: Java Edition, Tencent QQ, Steam and many others. The Washington Post called it “the most serious security breach ever” and the fallout is said to last for years.

  • Java is also used in equipment for industries, governments, hospitals and other customized devices. The Log4j library is known to be used by these devices as well as conventional computers and servers.

  • The well-known VMware Horizon desktop and app software solution was highly exploited, receiving a lot of attacks that successfully breached this software.

  • This is hypothetical, but Log4j is an open-source library that can be used by many developers, who might not follow licensing norms and not inform of its usage. Meaning, Log4j could’ve been implemented in applications that don’t know they’re using it, thus rendering them vulnerable without the users' or owners' knowledge.

Why Log4Shell still matters

Log4Shell matters today because unpatched Java systems keep turning up, not because the vulnerability is novel. It was added to CISA's Known Exploited Vulnerabilities catalog on December 10, 2021, is still listed, and carries the catalog's "known ransomware campaign use" flag. That alone makes Log4Shell a standing item, not history.

The clearest public account of exploitation is CISA's 2022 joint advisory with the US Coast Guard Cyber Command, AA22-174A. Threat actors, including state-sponsored ones, exploited Log4Shell on unpatched, public-facing VMware Horizon and Unified Access Gateway servers, implanted loader malware with remote command and control, moved laterally over RDP, reached a disaster recovery network, and exfiltrated sensitive data.

The advisory's instruction is worth repeating. CISA told organizations that had not promptly applied the patches or workarounds to assume compromise and begin threat hunting, rather than patch and move on. Log4Shell was an initial access vector, and the access outlived the exploit window.

The underlying problem was never only the patch. Many teams could not answer, quickly, whether their software used the library at all. Fluid Attacks made that point at the time: many organizations did not know which programs included Log4j, because they kept no inventory of their software's components and subcomponents.

Log4Shell at Fluid Attacks

Fluid Attacks treats Log4Shell as an inventory problem first and a patch problem second. Finding every instance means knowing every component in the software, whether the vulnerable code is actually called, and whether it ships to production.

What we assess, and under what rules

Log4Shell is detected through Software Composition Analysis (SCA), which checks the dependencies declared and resolved in the software a client develops against vulnerability advisories, with reachability analysis layered on top. The scope is the client's own applications and the components they pull in, not the whole network.

In the platform, the result lands in Inventory > Packages, which lists every third-party dependency across a group's active repositories, with vulnerabilities per severity rating and the locations of each.

What it looks like in practice

Question

Where it is answered

Evidence you get

Is the component present?

Packages, dependency row

Name, repository, vulnerabilities by severity, number of locations

Is it direct or transitive?

Package Imports, Transitivity column: D, T, U

For a transitive one, the path from the direct package down to the affected one

Does it ship to production?

Package Imports, Stage column: Build or Run

Whether the component reaches the live environment or only the development one

Does the code call the vulnerable function?

Packages, "Reachable" tag; Vulnerabilities, origin "Inherited"

File path and line of code that calls or leads to the vulnerable function, plus a screenshot of the code in context

What is the full inventory?

Packages, Export SBOM

CycloneDX or SPDX, in JSON or XML, with package name, version, location and the resolved graph

Packages section showing direct and transitive dependencies and their stagePackages section showing direct and transitive dependencies and their stage

Package Imports: for a Log4Shell finding, the Transitivity column marks D, T or U, and Stage separates Build from Run.

A scanner and a pentester on the same application

The numbers below come from one controlled comparison, so they describe that application rather than every application. In Fluid Attacks' benchmark, 36 third-party AppSec tools, Fluid Attacks' own scanner and one pentester were measured against a web application seeded with 1,201 vulnerabilities worth 461,500 CVSSF units.

The pentester reported 1,076 true positives with zero false positives: 100% precision and 89.6% recall, covering 98.9% of the risk exposure. The best automated evaluator was Fluid Attacks' own scanner, at 99% precision but 22.7% recall and 8.8% of risk exposure. Average recall across the other 34 tools was 1.7%.

The gap is not volume. Of the 1,201 vulnerabilities, 743 — 61.9% — were found only by the pentester, carrying 86.8% of total exposure. In the State of Attacks 2026 report, covering client systems tested from January 1 to December 31, 2025, automated tools detected 55.8% of total risk exposure, but 87% of critical-severity vulnerabilities came from manual review. That gap is what Pentesting as a Service (PTaaS) exists to close.

What a dependency scan does not tell you

Two limits are worth stating plainly, because they change how much weight a clean Log4Shell scan deserves.

The first is where risk actually lives. In the same benchmark application, 80% of the 1,201 vulnerabilities sat in the codebase and 13% in the backend; dependencies and the frontend shared the rest. A dependency CVE is worth chasing, but a scanner that finds no vulnerable Log4j has told you almost nothing about the rest of the application.

The second is what reachability analysis can and cannot say. At the Latent and Potential levels, Fluid Attacks supports any advisory from its data sources for the supported languages and package managers. At the Reachable level it covers only CVEs whose vulnerable functions are modeled in its database, as the documentation on supported CVEs states. A finding not flagged reachable is not automatically harmless either: exposure and runtime context still count.

The practice that decides the rest

How findings are counted decides whether a team acts on them. In a monorepo, Fluid Attacks reads the root lockfile and reports each CVE once per repository, however many workspaces use the affected dependency, because one shared lockfile means one installed copy and one fix.

Many tools count a finding per workspace instead. The number climbs, the remediation work does not, and a single buried instance of Log4Shell becomes forty tickets that all close with the same edit.

Log4Shell is not the only Log4j vulnerability

Log4Shell is one of four Log4j flaws, not all of them. Three more followed within weeks, each with its own fix, and conflating them is how teams patch to a version that does not solve the problem.

CVE

Problem

Affected log4j-core

CVE-2021-44228 (Log4Shell)

JNDI features in configurations, log messages and parameters do not protect against attacker-controlled endpoints

2.0-beta9 through 2.15.0, excluding 2.12.2, 2.12.3 and 2.3.1

CVE-2021-45046

The 2.15.0 fix proved incomplete in non-default configurations, allowing an information leak and code execution

All releases before 2.16.0

CVE-2021-45105

Uncontrolled recursion from self-referential lookups, causing denial of service

2.0-alpha1 through 2.16.0, excluding 2.12.3 and 2.3.1

CVE-2021-44832

A JDBC Appender pointing at a JNDI LDAP data source allows code execution when the attacker controls that server

2.0-beta7 through 2.17.0, excluding 2.3.2 and 2.12.4

Affected versions as stated in each CVE record, published by the Apache Software Foundation as CVE Numbering Authority.

Read the ranges in order and the story tells itself: every fix became the next flaw's starting point. 2.15.0 closed Log4Shell, and CVE-2021-45046 found that fix incomplete. 2.16.0 closed CVE-2021-45046, and CVE-2021-45105 reached it anyway.

This is why the version to install today is none of the four. It is whichever branch Apache currently maintains, and that table is in the next section. A team that patched Log4Shell in December 2021 and never looked again is almost certainly on an unmaintained branch.

How to find Log4Shell in transitive dependencies

A Log4Shell hunt fails when it only reads declared, direct dependencies. The library often arrives indirectly, so the question is not "do we import Log4j" but "does the vulnerable artifact end up on the classpath, and from where".

Six places to check, roughly in order of how often they are missed:

  • Direct dependency: declared in pom.xml or build.gradle. The easy case.

  • Transitive dependency: pulled in by a package you do declare. mvn dependency:tree with Apache Maven resolves the chain, and the platform shows the same path.

  • Packaged JARs: a vendor JAR that embeds the library without declaring it. The manifest shows nothing.

  • Uber-JARs and shaded artifacts: classes repackaged under another namespace, breaking name-based matching.

  • Container images: application servers and base images carry their own copies.

  • Deployed artifacts and forgotten systems: staging, disaster recovery networks, appliances. One unpatched edge server is enough.

An SBOM makes this answerable rather than anecdotal. From Packages, the inventory exports as CycloneDX or SPDX, JSON or XML, for a Git repository or Docker images, with the dependency tree of primary and indirect packages.

The free scanners released at the height of the Log4Shell response — Palantir's log4j-sniffer and the CERT/CC scanner — still earn their place sweeping filesystems and archives, where a manifest-driven inventory has nothing to read.

How to fix Log4Shell and verify that the fix worked

Fixing Log4Shell means getting a maintained version of the library onto every classpath that has one, then proving it. Do not pin to a 2021 release: those branches are unmaintained.

Branch

Status

Latest release

3.0.x

Active Development

3.0.0-beta3

2.26.x

Active Development

—

2.25.x

Active Maintenance

2.25.3

2.24.x

End of Maintenance

2.24.3

2.12.x

End of Maintenance

2.12.4 (last with Java 7 support)

2.3.x

End of Maintenance

2.3.2 (last with Java 6 support)

Maintenance status from the Apache Log4j download page, consulted on November 17, 2026. Pick the maintained branch compatible with your Java runtime rather than a version quoted in an old article.

For the upgrade, the platform's "How to fix" tab offers three paths — a Minimal fix that closes the reported flaw but may add others, a Safe update that closes it without adding any, and a Complete fix to the latest release with no known vulnerabilities. For an indirect package it also names the direct one carrying the vulnerable code.

Three update options for a vulnerable dependency on the platform

The "How to fix" tab offers a Minimal fix, a Safe update and a Complete fix for each vulnerable dependency.

Verification is the step most Log4Shell write-ups skip:

  • Rebuild the artifacts: an updated manifest with a stale JAR fixes nothing.

  • Redeploy, images and old-template environments included.

  • Re-run the analysis and confirm the resolved version, not the declared one.

  • If the system was internet-facing while unpatched, review logs for outbound LDAP or RMI connections and follow CISA's guidance on assuming compromise.

  • Keep it from returning. In the State of Attacks 2026 data, systems using Fluid Attacks' CI Gate reached a 72.2% remediation rate against 58% without it.

A web application firewall belongs here as a stopgap, not a fix. The vulnerable component is what has to change.

How to prioritize Log4Shell findings

A CVSS of 10.0 tells you how bad Log4Shell can be, not which instance to fix first. When an inventory returns dozens of hits across repositories, environments and images, severity gives no running order.

Fluid Attacks' platform ranks vulnerabilities using seven prioritization attributes that an organization orders by weight:

  1. Transitivity: whether the flaw sits in a component you control directly.

  2. Use: whether the component runs in production or only in development.

  3. KEV: whether CISA lists the CVE as exploited in the wild. Log4Shell is on that list.

  4. % EPSS: the probability of exploitation in the next 30 days, from FIRST's Exploit Prediction Scoring System.

  5. Fixing cost: Fluid Attacks' estimate of the remediation effort.

  6. VLAI Severity: a severity level estimated from the CVE description.

  7. Reachability: whether your code calls the vulnerable function. See reachability analysis for how the Latent, Potential and Reachable levels differ.

These attributes adjust the priority score by up to two CVSS v4.0 points without changing the recorded severity. A high EPSS value on a component whose Stage reads Run is what moves a Log4Shell finding to the top. The ordering is worth the ten minutes: in the State of Attacks 2026 data, the roughly 2% of clients who set a custom arrangement had a mean remediation rate of 64.4%, against 34% on the default. That ranking is what turns a long list into a risk-based work queue.

Priority policy screen with the seven prioritization attributes in order

The seven priority attributes are dragged into whatever order the team decides.

Conclusions

Log4Shell is a solved vulnerability with an unsolved distribution problem. The patch has existed since December 2021; what persists is Java software whose owners cannot list what it is built from, which is why Log4Shell remains in CISA's exploited-vulnerabilities catalog years later.

Three things close Log4Shell properly. Build an inventory that reaches indirect dependencies, packaged JARs and container images. Upgrade to a maintained Log4j branch, then rebuild, redeploy and re-scan to prove it. And rank what remains by where the component actually runs, not by a severity score that reads 10.0 everywhere.

Frequently asked questions

Is Log4Shell still exploitable in 2026?

Yes, on systems that were never patched. The CVE is still listed in CISA's exploited-vulnerabilities catalog, and CISA's 2022 advisory on VMware Horizon documented intrusions that began with Log4Shell months after the fix was available. The library is fixed; unpatched deployments of it are not.

What is the difference between Log4Shell and the other Log4j vulnerabilities?

Log4Shell is CVE-2021-44228 specifically. CVE-2021-45046 covers an incomplete fix in 2.15.0 under non-default configurations, CVE-2021-45105 is a denial of service through uncontrolled recursion, and CVE-2021-44832 an RCE in certain JDBC Appender setups. Each had its own fix release, which is why patching to the first available version was not enough.

Does a web application firewall protect against Log4Shell?

It reduces opportunistic attempts; it does not remove the vulnerability. The exploit string can be obfuscated, and CISA's joint advisory on mitigating Log4Shell warned that threat actors were adopting increasingly sophisticated obfuscation techniques. Treat a firewall as cover while you upgrade, not as the remediation.

How do I find Log4j when it is not a direct dependency?

Resolve the full dependency tree, then look beyond it. mvn dependency:tree and a CycloneDX or SPDX inventory expose indirect packages, but neither sees the library embedded in a vendor JAR, repackaged in an Uber-JAR or baked into a container image. Those need filesystem and image scanning.

Does Fluid Attacks detect Log4Shell?

Yes, through Software Composition Analysis (SCA), with reachability and transitivity attached to each finding. The platform reports whether the affected component is direct or indirect, whether it runs in production or only at build time, and whether your code reaches the vulnerable function. The limit is worth knowing: in Fluid Attacks' benchmark of 36 third-party AppSec tools against an application with 1,201 vulnerabilities, the best automated scanner found 22.7% of them, while a pentester reached 89.6% recall with no false positives.

Find Log4Shell before someone else does

Our scanners inventory every dependency in your software and our pentesters test what they cannot reach, so a component like Log4j is found, ranked and verified rather than assumed. Start free trial · Contact us.

Get started with Fluid Attacks' SCA solution right now

Reduce risk without slowing delivery

Fast and accurate results from one continuous security program powered by AI, scanners, and pentesters.

Reduce risk without slowing delivery

Fast and accurate results from one continuous security program powered by AI, scanners, and pentesters.

Reduce risk without slowing delivery

Fast and accurate results from one continuous security program powered by AI, scanners, and pentesters.