RESP (Redis)
— Redis Serialization ProtocolRESP is the wire protocol that clients use to communicate with Redis servers. It balances simplicity (human-readable string format) with high parsing performance (binary safe with prefix length indicators).
Interactive Session: How RESP (Redis) Works
Step through the packet exchange sequence between nodes.
Interactive Execution Sandbox
Interact with a live or clearly-labelled simulated instance of RESP (Redis).
Threat Model & Attack Simulation
How this protocol is attacked in practice, what defenders can see, and which control stops it.
Threat model & attack simulation
SimulatedDefensive education. Every step runs in this page; no traffic is generated or sent.
Unauthenticated Redis access
InjectionRedis bound to a reachable interface without a password allows arbitrary commands, including writes and module loading.
Connect to 6379
The attacker reaches the port and sends RESP commands.
Connections from outside the application subnet.
Session forgery, data loss and host compromise.
Defences that matter
- Bind to localhost or a private interface
- ACLs and requirepass
- Firewall port 6379 and disable dangerous commands
This is a conceptual model for defenders, not an exploit toolkit. It contains no payloads, tooling or instructions for attacking systems you do not own.
Protocol Specification & Architecture
Key characteristics, real-world deployment patterns, and trade-offs.
Core Technical Features
- Simple type prefixes: Simple String (+), Error (-), Integer (:), Bulk String ($), Array (*)
- Binary safe: handles arbitrary binary images, pickled objects, and compressed blobs
- Pipelining: client can issue 10,000 commands in a single TCP socket burst without waiting for individual replies
- RESP3 adds maps (%), sets (~), booleans (#), and streaming attributes
Real-World Use Cases
- High-speed in-memory database caching
- Distributed locks via Redlock
- Sub-millisecond leaderboard ranking and rate limiting
Advantages & Strengths
- Extremely simple to implement client parsers in any language
- Tens of thousands of operations per second per core
Limitations & Vulnerabilities
- Text-based prefix parsing introduces minor byte overhead compared to pure binary formats like Protobuf