Log4Shell showed that one logging library, buried several layers deep in other software, could put a large share of the world's Java estate within reach of unauthenticated remote code execution in a single weekend. CVE-2021-44228 was disclosed in December 2021, yet vulnerable copies of Apache Log4j 2 still turn up in vendor appliances, old build artefacts and forgotten internal services. This guide is a defensive profile for security engineers and vulnerability managers: what happened and when, why it was so severe, exactly which versions are affected and fixed across the four related CVEs, and how to detect exploitation attempts and stay clear of the next library-level flaw. It assumes you already run a vulnerability programme; see the Vulnerability Management Guide for the general process.
Key takeaways
- Upgrade, do not just configure. Apache's own advisories list version upgrades as the remediation for CVE-2021-44228 and its follow-ups; the safe floor for the 2021 cluster on Java 8 or later is 2.17.1, and current 2.x releases also fix later issues.
- The first fix was not the last. 2.15.0 was incomplete (CVE-2021-45046), and two more issues followed (CVE-2021-45105, CVE-2021-44832), so anything frozen at 2.15.0 or 2.16.0 is still exposed to at least one of them.
- Inventory was the real bottleneck. The US Cyber Safety Review Board found that Log4j was often embedded in other components and that no represented organisation used SBOMs to find it.
- Treat it as endemic. The Board expects vulnerable instances to remain in systems for many years, perhaps a decade or longer, so periodic re-scanning and supplier attestation belong in steady-state operations.
- Patched is not the same as clean. Hosts that were exposed before patching need a compromise assessment, credential rotation and egress review, not only a version change.
At a glance
| Item | Detail |
|---|---|
| Name | Log4Shell |
| CVE | CVE-2021-44228 |
| Component | Apache Log4j 2, the log4j-core artefact (Log4j 1.x is a separate, end-of-life codebase) |
| Weakness | JNDI features in configuration, log messages and parameters did not protect against attacker-controlled LDAP and other JNDI endpoints (CISA KEV lists CWE-20, CWE-400 and CWE-502) |
| Severity | CVSS 3.1 base score 10.0, Critical (AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H), as listed by Apache |
| Impact | Remote code execution by an unauthenticated attacker who can get a crafted string logged |
| CISA KEV | Added 10 December 2021, federal due date 24 December 2021, known ransomware campaign use: Known |
| Fixed in | 2.15.0 (Java 8+), 2.12.2 (Java 7), 2.3.1 (Java 6); later releases needed for the related CVEs |
| ATT&CK | T1190 Exploit Public-Facing Application (initial access) |
What happened and when
The timeline below follows the Cyber Safety Review Board's July 2022 report, which remains the most complete official account.
| Date | Event |
|---|---|
| 24 November 2021 | An Alibaba Cloud security engineer reports the flaw to the Apache Software Foundation by email. |
| 1 December 2021 | Earliest known exploitation activity, which the Board judged to be testing; it found no further evidence of use before public disclosure. |
| 5 to 6 December 2021 | Apache commits a fix and tags a release candidate, without a security advisory. |
| 9 December 2021 | Public disclosure, including a post with a redacted proof of concept. |
| 10 December 2021 | Apache releases 2.15.0 and publishes CVE-2021-44228; CISA adds it to the KEV catalogue the same day. |
| 14 December 2021 | 2.16.0 released, addressing CVE-2021-45046 (incomplete fix in 2.15.0). |
| 18 December 2021 | 2.17.0 released, addressing CVE-2021-45105 (denial of service through recursive lookups). |
| 28 December 2021 | 2.17.1 released, addressing CVE-2021-44832 (JDBC Appender with attacker-controlled configuration). |
| 11 July 2022 | The Cyber Safety Review Board publishes its review, with 19 recommendations in four themes. |
Scale arrived fast. The Board cites Cloudflare observing around 400 exploitation attempts per second five days after disclosure, and Akamai estimating that about 57% of first-week activity came from already-known malicious actors. It also recorded that exploitation was lower than many experts predicted and that it learned of no significant attacks on critical infrastructure. The cost landed on defenders instead: one US federal cabinet department reported 33,000 hours of response work.
Why it was so severe
- Trivial trigger: the attacker only had to get a string into something the application logged, such as a request header, form field or username. No authentication, no user interaction, and the CVSS vector is network, low complexity.
- Code fetched from outside: the lookup feature resolved JNDI references, so a vulnerable server could be made to contact an attacker's LDAP endpoint and load code from it. This is why outbound connections from servers became a key detection and containment point.
- Ubiquity and depth: Log4j 2 is the default or common logging library across Java applications, middleware and appliances. It was frequently a transitive dependency, shaded into another JAR, or shipped inside a vendor product the customer could not inspect.
- Reach beyond the perimeter: the string did not need to hit the internet-facing server that received it. Any back-end system that later logged the same value (a SIEM pipeline, a ticketing system, an analytics job) could trigger.
- Moving fixes: three follow-up releases in under three weeks meant teams that patched quickly had to patch again, and early workarounds circulated faster than they were validated.
- Privileged hosts: logging servers, build systems and management appliances often hold service account credentials, API keys and tokens, so code execution there led quickly to lateral movement.
Affected versions and fixes
Ranges below are from the Apache Logging Services security page, with CVE-2021-44832 confirmed against the GitHub Advisory Database. Ranges use interval notation: a square bracket includes the version, a round bracket excludes it. Apache maintained three lines: Java 8 and later, Java 7 and Java 6.
| CVE | CVSS 3.1 | Affected log4j-core | Fixed (Java 8+ / Java 7 / Java 6) |
|---|---|---|---|
| CVE-2021-44228 | 10.0 Critical | [2.0-beta9, 2.3.1), [2.4, 2.12.2), [2.13.0, 2.15.0) | 2.15.0 / 2.12.2 / 2.3.1 |
| CVE-2021-45046 | 9.0 Critical | [2.0-beta9, 2.3.1), [2.4, 2.12.3), [2.13.0, 2.16.0) | 2.16.0 / 2.12.3 / 2.3.1 |
| CVE-2021-45105 | 5.9 Medium | [2.0-alpha1, 2.3.1), [2.4, 2.12.3), [2.13.0, 2.17.0) | 2.17.0 / 2.12.3 / 2.3.1 |
| CVE-2021-44832 | 6.6 Medium | [2.0-beta7, 2.3.2), [2.4, 2.12.4), [2.13.0, 2.17.1) | 2.17.1 / 2.12.4 / 2.3.2 |
- Minimum for the 2021 cluster: 2.17.1 on Java 8 or later, 2.12.4 on Java 7, 2.3.2 on Java 6. In practice, move to a current 2.x release: Apache's security page lists further CVEs fixed in 2025 and 2026 releases, so 2.17.1 is a historic floor, not a target.
- Only log4j-core matters: an application carrying only
log4j-api, or the SLF4J bridge without core, is not affected by these CVEs. Scanners that flag on the API JAR alone create noise. - Log4j 1.x: Apache states that Log4j 1 reached end of life in 2015 and is no longer supported. It is not vulnerable to CVE-2021-44228 in the same way, but Apache notes that configurations using a JMSAppender are affected by a related issue (CVE-2021-4104), and 1.x carries other unfixed flaws. Plan migration rather than treating 1.x as safe. See Java End of Life Versions for the runtime side.
- Configuration workarounds: Apache's advisories list upgrades as the remediation and give configuration-only mitigations only for the denial-of-service issue (CVE-2021-45105), noting they are insufficient on releases older than 2.12.2 and 2.16.0. Treat any December 2021 workaround still in place as a debt item to replace with an upgrade.
- Vendor products: appliances and commercial software ship their own copy. The fix is the vendor's patched release, tracked through vendor advisories and supplier statements; replacing a JAR inside a vendor product usually breaks support.
Related CVEs
- CVE-2021-45046 (incomplete fix): in certain non-default configurations using a Thread Context lookup, an attacker controlling Thread Context Map data could still cause information leaks and remote code execution in some environments. CISA added it to KEV on 1 May 2023, with known ransomware use, which is a reminder that the follow-ups were exploited too.
- CVE-2021-45105 (denial of service): self-referential lookups caused uncontrolled recursion and a
StackOverflowErrorthat terminated the process. Availability impact only. - CVE-2021-44832 (configuration-controlled RCE): requires an attacker who can already write the logging configuration; a JDBC Appender could then reference a JNDI data source that loads remote code. The fix restricts JNDI data source names to the
javaprotocol. Low practical risk on its own, but it matters where configuration files are writable by a compromised service account. - CVE-2021-4104 (Log4j 1.x): the related JMSAppender exposure in the end-of-life 1.x line, relevant when sweeping legacy estates.
Detection and defence
Detection here is about two questions: where is a vulnerable copy, and was it used. The table maps each layer to what to look for and its limits.
| Layer | What to monitor or search | Limits |
|---|---|---|
| Software inventory | SBOMs and software composition analysis results for log4j-core by version, including transitive and shaded copies; file-system scans of servers and container images for the JAR and for the lookup class inside fat JARs | Shaded or renamed classes and vendor appliances evade name-based search |
| Web and API edge | WAF and reverse proxy logs for lookup-expression syntax in headers, paths, query strings and bodies, including obfuscated and nested forms | Easily evaded by encoding; useful for spotting scanning and targeting, not proof of compromise |
| Egress | Outbound LDAP, LDAPS, RMI and unusual DNS from application servers, especially to new external destinations shortly after suspicious inbound requests | Needs a baseline of normal server egress; DNS callbacks may be scanners testing reachability |
| Endpoint and process | Java processes spawning shells or scripting interpreters, downloading files or writing new executables (ATT&CK T1059 Command and Scripting Interpreter, T1105 Ingress Tool Transfer) | Some middleware legitimately spawns child processes; tune by host role |
| Identity | New use of service account credentials, API keys or cloud tokens stored on affected hosts, from new locations or at odd times | Requires knowing which non-human identities live on which hosts |
A defensive sequence for a newly found vulnerable instance:
- Classify exposure: internet-facing, internal but reachable from user input, or batch-only. Internet-facing first, then systems that log data originating outside the organisation.
- Restrict egress immediately: deny outbound LDAP, RMI and arbitrary internet traffic from the host while the upgrade is prepared. This is the most effective interim control because the exploit chain depends on a callback. See Cloud Egress Filtering.
- Upgrade: rebuild in-house applications on a current 2.x release, redeploy from the pipeline and confirm the old JAR is gone from the running image, not only from the source repository. For vendor products, apply the vendor release. Follow the Emergency Out-of-Band Patching Playbook for change and rollback steps.
- Verify: re-scan the deployed artefact and host, and record the evidence in the ticket.
- Assess compromise: if the host was exposed before the fix, review edge, egress and process logs back to 1 December 2021 or the date it was deployed, whichever is later. Look for persistence such as new accounts, scheduled tasks and web shells.
- Rotate secrets: rotate credentials, keys and tokens readable on any host with signs of exploitation. Patching closes the entry point but does not revoke what was already taken, the same lesson as the ToolShell SharePoint exploitation, where stolen machine keys kept working after the fix.
Lessons that still apply
- SBOMs only help if they answer questions quickly: the Board found SBOMs were limited by inconsistent fields and missing component version information. Store them centrally, include transitive dependencies with versions, and test that you can answer "where is component X at version Y" in minutes. See the SBOM Guide and SBOM operations.
- Use VEX to cut noise: exploitability statements from suppliers let you close findings where the vulnerable code path is absent. See the VEX Guide.
- Ask suppliers before the crisis: contracts should require timely vulnerability statements and component disclosure. NCSC's December 2021 advice was to contact suppliers if you did not know whether you used Log4j, which only works if you know who your suppliers are.
- Prioritise by exploitation: KEV status and exposure, not CVSS alone, should drive the queue. See the CISA KEV Catalogue Guide and the Risk-Based Vulnerability Management Guide.
Metrics
- Time to answer: minutes from a new library CVE to a complete list of affected applications and versions.
- Inventory coverage: percentage of production applications and container images with a current SBOM including transitive dependencies.
- Residual instances: count of
log4j-corebelow 2.17.1, and of any 1.x, found in each quarterly sweep (target zero, trend visible). - Supplier response: percentage of critical suppliers that returned a component statement within the contractual window.
- Egress default deny: percentage of server subnets where outbound internet traffic is denied by default.
Framework mapping
| Framework | Reference | How it applies |
|---|---|---|
| NIST CSF 2.0 | ID.AM-02, ID.RA-01, ID.RA-08, PR.PS-02, DE.CM-09, RS.MI-02 | Software inventory, vulnerability identification and disclosure handling, maintaining software, monitoring runtime, eradication |
| NIST SP 800-53 Rev 5 | CM-8, RA-5, SI-2, SR-4 | Component inventory, vulnerability scanning, flaw remediation, provenance of components |
| CISA KEV | CVE-2021-44228, CVE-2021-45046 | Both listed, both with known ransomware campaign use |
| MITRE ATT&CK v20 | T1190, T1059, T1105 | Initial access through the public-facing application, follow-on execution and tool transfer |
Practitioner checklist
- Search SBOMs, SCA results, container registries and host file systems for
log4j-core, including shaded copies, and record version and owner for each hit. - Raise every in-house application to a current 2.x release, never below 2.17.1 (Java 8+), 2.12.4 (Java 7) or 2.3.2 (Java 6).
- Confirm the deployed artefact, not just the repository, no longer contains the old JAR.
- Collect patched-version statements from every vendor whose product contains Log4j, and track open items with dates.
- Plan retirement of remaining Log4j 1.x components.
- Replace any December 2021 configuration workaround still in place with an upgrade.
- Deny outbound LDAP, RMI and general internet traffic from servers by default.
- Alert on Java processes spawning shells or downloading executables.
- For any host exposed before patching, run a compromise assessment and rotate the credentials, keys and tokens it held.
- Re-run the sweep quarterly and after every acquisition or major vendor onboarding.
Standards and references
- Apache Logging Services: Security vulnerabilities
- GitHub Advisory Database: CVE-2021-44832 (GHSA-8489-44mv-ggj8)
- Cyber Safety Review Board: Review of the December 2021 Log4j Event
- CISA: Known Exploited Vulnerabilities Catalog
- NCSC: Log4j vulnerability, what everyone needs to know
- MITRE ATT&CK: T1190 Exploit Public-Facing Application
- NIST: Cybersecurity Framework 2.0
Related NHI Mgmt Group resources: Vulnerability Management Guide, Software Supply Chain Security Guide, Maven Central and Gradle Supply Chain Security Guide, Software Composition Analysis (SCA) Guide, Top 10 Supply Chain Attacks.