redos-anti-pattern

Detect catastrophic backtracking patterns in regex and provide secure alternatives.

8|1|Updated Jan 19, 2026
One-click install
npx skills add https://github.com/igbuend/grimbard --skill redos-anti-pattern
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: redos-anti-pattern
Source: https://github.com/igbuend/grimbard/tree/main/skills/redos-anti-pattern
Command: npx skills add https://github.com/igbuend/grimbard --skill redos-anti-pattern

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the critical security vulnerability of Regular Expression Denial of Service (ReDoS), which can cause applications to hang indefinitely due to poorly crafted regular expressions processing malicious input.

Core Features & Use Cases

  • Identify Vulnerable Regex: Detects patterns with exponential-time complexity, such as nested quantifiers and overlapping alternations.
  • Provide Secure Alternatives: Offers examples of linear-time regex patterns and strategies like input length limiting.
  • Use Case: When reviewing code that uses regular expressions for input validation or parsing, this skill helps identify and fix potential ReDoS vulnerabilities before they can be exploited.

Quick Start

Review the provided regular expression for potential ReDoS vulnerabilities.

Frequently Asked Questions about redos-anti-pattern

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is a regular expression denial of service vulnerability?

A regular expression denial of service (ReDoS) vulnerability occurs when poorly crafted regex processes malicious input, causing exponential-time complexity through catastrophic backtracking. This makes applications hang indefinitely during input validation or parsing tasks.

How do I detect catastrophic backtracking in regex patterns?

To detect catastrophic backtracking in regex, analyze the regex syntax for nested quantifiers and overlapping alternations. Identifying these vulnerable patterns helps mitigate exponential-time processing risks before they can be exploited by malicious input.

How can I fix vulnerable regex to prevent denial of service attacks?

To fix vulnerable regex and prevent denial of service attacks, replace exponential-time patterns with secure linear-time alternatives. You can also apply prevention strategies like input length limiting to secure your input validation and parsing logic.

What causes catastrophic backtracking in regex?

Catastrophic backtracking in regex is caused by nested quantifiers and overlapping alternations within the expression syntax. When the regex engine processes ambiguous input, it tries too many matching paths, resulting in exponential-time complexity.

Are there secure alternatives to complex regex for input validation?

Secure alternatives to complex regex for input validation include using linear-time regex patterns and implementing input length limiting. These strategies prevent the exponential processing overhead that leads to denial of service vulnerabilities.