
Before the flaws, the engine: Redis serves hundreds of thousands of operations
per second with one thread. The same design that makes it fast is the design
that makes a single memory bug fatal.
The event loop: one queue, no queue-jumping
Redis has one event loop, one thread, one command at a time. When 10,000 clients
send commands at once, they line up; each is read, acted on, replied to — in
order, typically in microseconds each.
Why is this faster than a threaded server? Because there are no locks. No
thread switching. No cache coherence traffic between cores. A threaded server
spends work coordinating; Redis spends all its work doing.
The price of atomicity is simplicity of reasoning — which cuts both ways:
- The good side: rate-limit counters can't race; two workers can't pop the
same job; "set if absent" is truly atomic. This is why Redis is trusted with
locks, sessions and limits. - The bad side that matters here: every command is a parser of
attacker-adjacent data, and there is exactly one thread executing them. A
corrupted parse doesn't just crash — it corrupts the single heap shared by
every session, every job and every lock in the server.
The structures: where the data actually lives
Redis is not one data type — it is a family of them, each with its own in-memory
layout and its own parser:
- STRING —
user:42 = "Alice": the dictionary. - HASH — a small map: object fields without a schema.
- LIST — the queue backbone (LPUSH/RPOP) — also used by a dozen frameworks
as a work queue with no extra dependency. - SET / SORTED SET — memberships and score-ranked boards.
- STREAMS — append-only event logs with consumer groups.
Every one of these is manipulated through the command protocol — thousands of
commands total, essentially all written in C, with manual memory
management. That sentence is the architect of the flaw story: in a codebase of
this size and age, manual memory management in parsers guarantees a pipeline of
use-after-free and out-of-bounds classes forever.
Persistence: the toggle that changes everything
Redis is memory-first, but it can persist: RDB snapshots (point-in-time
dumps) and AOF (append-only log of writes, fsynced by policy). Persistence
is optional, and many installs run with neither configured correctly — which
matters to the disclosure in two ways:
- Data loss on crash is a feature of the default, not a bug report.
- Persistence commands double as attack primitives — the classic Redis
hijack chain (Part 9) usesCONFIG SET dir+SAVEto write an
attacker-controlled file onto the host.
Why the engine matters to the looming problem
The event-loop design makes Redis fast and makes its memory singular. When
the 2026 CVEs land — Part 7 — note the pattern: a use-after-free in the
unblock-client flow corrupts the one heap that serves everyone. Single-threaded
does not mean single-risk; it means concentrated risk.
Next: Part 6 — the door that was never locked: Redis's default security, and
the design decision made in 2009 that nobody revisited.

Comments (0)