Regolith: A Linear-Time Regex Library Preventing ReDoS Attacks

2025-08-27
Regolith: A Linear-Time Regex Library Preventing ReDoS Attacks

Regolith is a server-side TypeScript and JavaScript library built with Rust to prevent Regular Expression Denial of Service (ReDoS) attacks using a linear regex engine. Unlike the default RegExp in TypeScript and JavaScript (which has exponential worst-case time complexity), Regolith boasts linear worst-case complexity, effectively mitigating ReDoS vulnerabilities. Designed as a drop-in replacement for RegExp, it minimizes migration effort, allowing developers to easily build ReDoS-resistant software. Still early in development, Regolith welcomes community contributions.

Development Regular Expression