One String, Full RCE: How Log4Shell Actually Works
Log4j2 evaluated JNDI expressions in logged strings, so attacker-controlled input reaching a log line triggered an outbound lookup to an attacker-controlled server. The author confirmed the vulnerable lookup path with a DNS callback but did not execute code.
blog.snapsec.co
Published on blog.snapsec.co
Log4Shell (CVE-2021-44228) let a single logged string turn Log4j2 into remote code execution — no auth, no complex chain, just text landing in a log line.
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
Impact
The callback confirmed vulnerable JNDI processing, which could lead to remote code execution, though the text notes this proof alone does not demonstrate code execution.
What the attacker needed
Attacker-controlled input reaches a log line; vulnerable Log4j2 version; outbound network access from app server
The fix
Log4j2 should be upgraded to a supported release, with the full dependency tree checked, and outbound network access from app servers restricted.
How it was found
- Generate a unique subdomain from a DNS logging service.
- Place that subdomain in a JNDI lookup payload.
- Submit the payload through a feature that writes user input to a server-side log.
- Check the DNS logging dashboard for inbound requests to the controlled subdomain.
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.
Log4j2 is a logging library that writes messages to files. Older versions treated text like ${...} as a command and fetched code from a server named in that text. If a user could get such text into a log message, the server would contact the attacker's machine, which could lead to running the attacker's code.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.