Security Hardening
Meridian provides defense-in-depth from the language level through the transport level to the application level.
Rust-Level Safety
Properties enforced by the compiler, not by convention:
| Guarantee | Mechanism |
|---|---|
| No buffer overflows | Bounds-checked array access |
| No use-after-free | Ownership system, Drop trait |
| No double-free | Move semantics, single owner |
| No data races | Send/Sync traits |
| No null pointer dereference | Option<T> instead of nullable pointers |
| No uninitialized memory | All variables initialized before use |
These guarantees eliminate entire vulnerability classes that have caused real CVEs in C/C++ proxies.
Protocol-Level Defenses
Request Smuggling Prevention
HTTP request smuggling exploits ambiguity between Content-Length and Transfer-Encoding. Meridian’s strict parser:
- Rejects requests with both
Content-LengthandTransfer-Encoding - Rejects requests with multiple
Content-Lengthvalues - Rejects
Content-Lengthwith whitespace padding - Only accepts
chunkedas aTransfer-Encodingvalue
These checks are verified by coverage-guided fuzzing with a dedicated smuggling-detection fuzzer.
Slowloris Defense
60-second timeout on header reading. Clients that don’t complete headers within this window are disconnected.
Per-IP Connection Limits
Configurable limit (default 256) on connections per source IP. Prevents a single client from exhausting connection resources. Uses RAII guards for automatic cleanup.
Path Normalization
Request paths are normalized before routing:
//api//data→/api/data/api/../secret→/secret/api/./data→/api/data/../../etc/passwd→/etc/passwd
Header Size Limits
64KB maximum header size. 128 maximum headers per request.
Generic Error Responses
Error responses never leak internal topology. Cluster names, endpoint addresses, and circuit breaker state are logged but never sent to clients.
TLS
Meridian uses rustls for TLS termination — a pure-Rust implementation audited by Cure53. See TLS Configuration.
Fuzz Testing
All parser surfaces are continuously fuzz-tested:
- HTTP/1.1 request parser
- Chunked transfer-encoding dechunker
- Body framing decision logic
- Path normalization
- Request smuggling detection
- TOML configuration parser
See Fuzzing for details.