Digging deeper into Log4Shell – 0Day RCE exploit found in Log4j
The Log4j logging library allowed JNDI lookups in log messages, so an attacker who could control a logged string could make the server load and execute a remote Java class. This led to remote code execution, and the vulnerability was actively exploited in the wild.
fastly.com
Published on fastly.com
CVE-2021-44228 is a Remote Code Execution vulnerability in the Apache Log4j library, a Java-based logging tool widely used in applications around the world. This vulnerability allows an attacker who can control log messages to execute arbitrary code loaded from attacker-controlled servers — and we anticipate that most…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Log4j 2.0 added JNDI lookups that were not restricted, allowing log messages to trigger remote class loading.
Impact
Attackers could execute arbitrary code on vulnerable servers, and the vulnerability was actively exploited, including by cryptominers.
What the attacker needed
Attacker can control a logged string; vulnerable Log4j version; outbound network access from server
How it was found
- The attacker inserts a JNDI string into an HTTP header such as User-Agent.
- The vulnerable Log4j instance logs the header and performs an LDAP query to the attacker's server.
- The LDAP server responds with directory information pointing to a remote Java class.
- Log4j loads and executes the Java class, achieving code execution.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Log4j is a tool that Java programs use to write log messages. It had a feature that let a log message include a special instruction to fetch something from another server. Attackers could put such an instruction into something that gets logged, like a browser's User-Agent header, and trick the server into downloading and running their code.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.