Log4Shell, Common Vulnerability and Exposure (CVE) identifier, CVE-2021-44228, is a remote code execution (RCE) vulnerability present in some versions of Log4J. The flaw affects Apache Log4J 2, versions 2.14.1 and earlier. Log4J 2.15 and later, and all versions of Apache Log4J 1, are unaffected.
Log4Shell arises from how older versions of Log4J 2 handle Java Naming and Directory Interface (JNDI) lookups. JNDI is an application programming interface (API) that Java applications use to access resources hosted on external servers. A JNDI lookup is a command that tells the app to go to a server and download a specific object, like a piece of data or a script. Older versions of Log4J 2 automatically run any code downloaded this way.
Users can send JNDI lookups to vulnerable versions of Log4J by including them in log messages. Doing so is simple. For example, in older versions of Minecraft Java Edition, which use Log4J to record user messages, a user can type the JNDI lookup into the public chat window.
Hackers can use this JNDI functionality to run malicious, arbitrary code remotely. First, the hacker sets up a server that uses a common protocol, like Lightweight Directory Access Protocol (LDAP) to avoid drawing attention. Next, they store a malicious payload on that server, such as a malware file. Finally, they send a JNDI lookup to a program, telling it to go to the attacker's LDAP server, download the payload, and run the code.