Join our Newsletter — 33% off our NHI Course
Home› Glossary› Cyber Security› ReDoS
Cyber Security

ReDoS

← Back to Glossary
By NHI Mgmt Group Updated November 3, 2026 Domain: Cyber Security

Regular expression denial of service is a performance attack that exploits inefficient regex execution. An attacker sends crafted input that forces excessive backtracking, consuming CPU and slowing or blocking service.

What ReDoS Means in Practice

ReDoS, or regular expression denial of service, is not about the regex being “wrong” in a functional sense, but about how the matching engine behaves under stress. The danger comes from patterns and inputs that interact badly, causing the engine to explore many paths before it can conclude a match or mismatch.

That makes ReDoS a performance and availability problem first. A single request can burn far more CPU than expected, and when the vulnerable regex sits on a hot path, latency can spread quickly across threads, workers, queues, or event loops.

Why Certain Regexes Become Dangerous

ReDoS typically appears when a pattern invites excessive backtracking, especially with nested quantifiers, ambiguous alternation, or repeated optional groups. The attacker does not need special privileges, just an input shape that forces the engine into worst-case search behaviour.

Not all regex engines fail the same way. Some engines support linear-time matching or safer modes, while others rely on backtracking semantics that can become expensive when the pattern and input combine badly. That is why the same expression can be harmless in one environment and dangerous in another.

In practice, the risk is highest where regexes are used in request handling, validation, filtering, routing, parsing, or security controls. If the matching step sits in a latency-sensitive path, the service can become slow long before it fully fails.

How Organisations Check Exposure and Reduce Blast Radius

The first question is where the regex actually runs: code, proxy rules, WAF logic, API gateways, authentication flows, or user-facing form handling. From there, teams can review the specific patterns, the engine semantics, and whether untrusted input can reach the matcher without length or complexity limits.

Exposure review should focus on hot paths and internet-facing entry points. A regex that is safe in a batch job may be unacceptable in a synchronous request path, especially if one expensive evaluation can tie up CPU and degrade the whole service.

Mitigation usually combines safer regex design, engine choice, timeouts, input length caps, and workload isolation. Where feasible, organisations should prefer linear-time patterns or constrained matching modes, then back that up with testing that measures behaviour on hostile inputs rather than only on normal cases. NHIMG’s Regular Expression Denial of Service Guide covers safe regex shapes, timeouts, and test techniques in more depth.

Detection and Post-Incident Review

ReDoS is often detected as an operational symptom before it is named as the cause: sudden CPU spikes, rising tail latency, thread starvation, timeouts, or request pile-ups tied to one endpoint or rule set. Logging the slow path alone is rarely enough; teams also need profiling or tracing that shows which regex or code path consumed the time.

After remediation, review whether the vulnerable pattern was ever used as a gate for security or business logic. If the regex controlled access, validation, or routing, the incident may have created both availability impact and a secondary trust problem, because the system behaved unpredictably under load.

Post-patch verification should confirm that the revised pattern, timeout, or engine choice really changed runtime behaviour. ReDoS fixes can look complete in code review while remaining fragile in production if the surrounding input path still allows pathological strings.

Operational Controls That Belong Around ReDoS

Denial of Service at Application Layer Guide is useful where ReDoS sits alongside other application-layer resource exhaustion risks, because the operational response is usually shared: rate controls, graceful degradation, per-request limits, and service protection.

Regex safety is also part of input handling discipline, so Input Validation and Output Encoding Guide helps place regex review inside a broader validation strategy rather than treating it as a one-off code smell.

For teams that want an external control reference, NIST SP 800-53 Rev 5 Security and Privacy Controls provides the control context for integrity, configuration, logging, and resilience measures that help contain this kind of failure.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP ASVS, NIST SP 800-53 Rev 5 and CIS Controls v8 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP ASVSV1 — Encoding and SanitizationReDoS is driven by unsafe input handling and regex-based validation paths.
V16 — Security Logging and Error HandlingReDoS often surfaces through latency, timeout, and error patterns that need logging.
Recommendation — Review regex validation as part of V1 input handling and replace pathological patterns with safer checks. Instrument slow regex paths so repeated pathological evaluations are visible in logs and traces.
NIST SP 800-53 Rev 5SI-10 — Information Input ValidationReDoS exploits attacker-controlled input that triggers excessive processing.
SC-5 — Denial of Service ProtectionReDoS is an application-layer resource exhaustion attack.
Recommendation — Apply SI-10 to validate inputs before they reach expensive regex evaluation. Use SC-5 controls to limit the impact of request patterns that can exhaust processing capacity.
CIS Controls v8CIS-4 — Secure Configuration of Enterprise Assets and SoftwareUnsafe regex behaviour is often introduced through code and runtime configuration choices.
Recommendation — Harden software settings and runtime limits so regex-heavy paths cannot monopolize resources.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on November 3, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org