Skip to content
Vol. 1 · Ed. 2026
CyberGlossary
Entry № 477

Fork Bomb

Reviewed byCybersecurity entrepreneur & security researcher

What is Fork Bomb?

Fork BombA denial-of-service technique in which a process repeatedly forks itself, exhausting process tables, memory, and CPU on the host.


A fork bomb is malicious or accidental code that spawns child processes recursively, doubling on each cycle until kernel limits, memory, or CPU are saturated and the system becomes unresponsive. The classic POSIX one-liner :(){ :|:& };: defines a function named : that pipes two copies of itself into the background and then invokes it; each generation doubles the process count, so the process table fills within seconds. The idea long predates Unix — one of its earliest names is the "wabbit" or rabbit program, reportedly seen on a University of Washington Burroughs mainframe around 1969-1974.

Fork bombs do not propagate over networks like worms; they are local resource-exhaustion attacks, but very effective on shared multi-user hosts, CI runners and containers, where a single unprivileged user can deny service to everyone.

Defences cap the resources a process tree may consume rather than blocking the syscall. On Linux the key controls are ulimit -u / PAM pam_limits (nproc) to bound per-user processes, and the cgroups pids controller (pids.max) — which Docker and Kubernetes expose via --pids-limit — to cap a container's task count. Account isolation, untrusted-code sandboxes and dedicated CI executors contain the blast radius further.

flowchart TD
  A[":() function<br/>calls itself twice"] --> B[Child 1]
  A --> C[Child 2]
  B --> D[Grandchild]
  B --> E[Grandchild]
  C --> F[Grandchild]
  C --> G[Grandchild]
  D --> H["... exponential growth ..."]
  E --> H
  F --> H
  G --> H
  H --> I{"pids.max / ulimit -u<br/>reached?"}
  I -->|No limit| J[Process table exhausted — host hangs]
  I -->|Limit set| K[New forks fail with EAGAIN — host survives]

Examples

  1. 01

    The bash one-liner `:(){ :|:& };:` used as a textbook DoS demonstration.

  2. 02

    Buggy CI scripts that accidentally fork inside an infinite loop.

Frequently asked questions

What is Fork Bomb?

A denial-of-service technique in which a process repeatedly forks itself, exhausting process tables, memory, and CPU on the host. It belongs to the Malware category of cybersecurity.

What does Fork Bomb mean?

A denial-of-service technique in which a process repeatedly forks itself, exhausting process tables, memory, and CPU on the host.

How do you defend against Fork Bomb?

Defences for Fork Bomb typically combine technical controls and operational practices, as detailed in the full definition above.

What are other names for Fork Bomb?

Common alternative names include: Wabbit, Rabbit virus.

Related terms

See also