Safeguard
Tag

regex

Safeguard articles tagged "regex" — guides, analysis, and best practices for software supply chain and application security.

6 articles

Application Security

How catastrophic regex backtracking causes ReDoS — and how to stop it

A single bad regex took Cloudflare's global network to ~100% CPU for 27 minutes in 2019. Here's the backtracking mechanics behind ReDoS and how to rewrite unsafe patterns.

Jul 13, 20266 min read
Application Security

ReDoS in Python and FastAPI: how one regex takes down an event loop

CVE-2024-3772 let a single crafted email string trigger catastrophic backtracking in Pydantic's own validator — the exact code path every FastAPI request body runs through.

Jul 8, 20266 min read
Vulnerability Guides

What is ReDoS (Regular Expression Denial of Service)?

A single badly written regular expression can freeze an entire service under a short, crafted input. This is ReDoS — and it has taken down Cloudflare and Stack Overflow. Here's how to avoid it.

Jul 5, 20265 min read
Security

Mobile Number Validation in JavaScript: A Security-Aware Guide

Mobile number validation in JavaScript is easy to get wrong with a naive regex. Here is how to validate phone numbers correctly, safely, and without ReDoS.

Mar 5, 20255 min read
AppSec

URL Validation in JavaScript: Regex Patterns and Safer Options

URL validation regex in JavaScript is tempting but brittle. Here are patterns that work, the ones that cause ReDoS, and why the URL constructor is usually the better tool.

Feb 24, 20256 min read
Application Security

Regular Expression Denial of Service (ReDoS): Detection and Prevention

A single bad regex can bring down your entire application. ReDoS attacks exploit catastrophic backtracking to consume unbounded CPU time.

May 8, 20224 min read

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.

regex — Safeguard Blog