# Log4Shell

> A 2021 hole in Log4j, a Java tool for logs. One line of text could run code.

**Field:** Software Development  
**Category:** Security  
**Also known as:** CVE-2021-44228, Log4j Vulnerability, Log4j RCE

## Think of it like

Think of it like a note pad that does what any note on it says.

## Definition

Log4Shell was a hole in Log4j, a popular Java tool for writing logs. It became public in December 2021. If an app logged text a user sent, a special string in that text could make the server fetch and run code from far away. It scored 10 out of 10, the top score. The fix was simple: update Log4j. The hard part was finding every place it hid.

## Example

Jack's app logs each search. Under Log4Shell, one odd search string could have made his server fetch and run outside code. He updates Log4j to a fixed version that day.

## Why it matters

One small tool, deep inside other software, put whole firms at risk at once.

## Common mistake

Checking only your own code. Log4j was often pulled in by another package, so teams had to scan every package they used.

## Three principles

- **Logs were the door.** Logged text could start remote code.
- **Top score.** It scored 10 out of 10.
- **Hidden deep.** Often inside other packages, never chosen directly.

## Related terms

- [Remote Code Execution (RCE)](https://learn.benibix.com/term/development/remote-code-execution)
- [Security Vulnerability](https://learn.benibix.com/term/development/vulnerability)
- [Common Vulnerabilities and Exposures (CVE)](https://learn.benibix.com/term/development/cve)
- [Dependency Scanning](https://learn.benibix.com/term/development/dependency-scanning)
- [Supply Chain Attack](https://learn.benibix.com/term/development/supply-chain-attack)

![A timeline of five points: a flaw goes into the code, attackers find it and write an exploit, the maker hears of it, a CVE and a patch go out, and people who update are safe. A dashed, lit-up box over the second and third points is marked zero-day, no fix exists yet. Notes say the vulnerability is the flaw and the exploit is the code that uses it.](https://learn.benibix.com/diagrams/dev2-vuln-timeline.svg)

---

Source: https://learn.benibix.com/term/development/log4shell
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
