# Supply Chain Attack

> An attack that hides bad code in a package. Other apps then pull it in.

**Field:** Software Development  
**Category:** Security  
**Also known as:** Software Supply Chain Attack, Dependency Attack, Malicious Package

## Think of it like

Think of it like bad flour. Every baker who uses it bakes the problem into the bread.

## Definition

A supply chain attack hides bad code inside something other apps depend on. Instead of breaking into your app, the attacker poisons something you install. It might be a library, a tool or an update. Everyone who pulls in that package gets the bad code too. In 2024 a backdoor was found hidden in xz, a tool on many Linux systems. Apps today pull in hundreds of packages, so the risk is wide.

## Example

Lucy installs a popular npm package. An attacker took over its author's account and pushed a new version. It sends her secrets to a stranger's server.

## Why it matters

One poisoned package can reach thousands of apps at once. Your code is only as safe as everything it pulls in.

## Common mistake

Installing the newest version of each package with no checks. Pin versions and scan updates before you trust them.

## Three principles

- **Poison the source.** Not your app directly.
- **Spreads to everyone.** Who installs it.
- **Pin and scan.** Know what you pull in.

## Related terms

- [Dependency Scanning](https://learn.benibix.com/term/development/dependency-scanning)
- [Common Vulnerabilities and Exposures (CVE)](https://learn.benibix.com/term/development/cve)
- [Package Manager](https://learn.benibix.com/term/development/package-manager)
- [Dependency](https://learn.benibix.com/term/development/dependency)
- [Package Registry](https://learn.benibix.com/term/development/package-registry)
- [Lockfile](https://learn.benibix.com/term/development/lockfile)
- [Malware](https://learn.benibix.com/term/infrastructure/malware)

---

Source: https://learn.benibix.com/term/development/supply-chain-attack
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.
