Module A-16·25 min read

ReDoS mitigation, memory exhaustion payload attacks, event loop saturation runbooks, and cascade failure recovery for financial infrastructure.

JJS
Written by Jatin Jain Saraf · Senior Software Engineer

Module 15 — Resiliency Runbooks & High-Load Security Defenses

What this module covers: A blockchain indexer processing 50,000 events/second is a valuable target. An attacker who can send one malicious payload that blocks the event loop for 30 seconds can effectively take the service offline. A ReDoS attack requires only an HTTP request. A memory exhaustion attack requires only a cleverly crafted JSON payload. This module covers the exact attack surfaces in high-throughput Node.js applications, the defensive patterns that prevent them, and the runbooks your team needs written down before the incident happens — because the worst time to write a runbook is during an outage.


ReDoS: Regular Expression Denial of Service

ReDoS exploits catastrophic backtracking in certain regular expression patterns. When these patterns are given carefully crafted input, the regex engine's backtracking algorithm takes exponential time.

The Vulnerable Pattern

javascript

Identifying Vulnerable Patterns

Vulnerable patterns share common characteristics:

  1. Nested quantifiers: (a+)+, (a|aa)+
  2. Alternation with common prefixes: (abc|abcd)+
  3. Overlapping quantifiers: (\w+\s*)+
javascript

Safe Validation Patterns

javascript

Runtime Protection: statement_timeout for Regex

For regexes you cannot replace, enforce time limits:

javascript

JSON Payload Bombs: Memory Exhaustion via Deserialization

A crafted JSON payload can expand exponentially in memory after parsing.

javascript

Defense: Request Size Limits and Depth Limits

javascript

Schema-First Validation: Reject Before Parsing

Sign in to keep reading

The rest of this module is free — sign in with Google to unlock it and track your progress.

Sign in & Register

Discussion

0

Join the discussion

Loading comments...

© 2026 Jatin Jain Saraf (JJS). All rights reserved.