Regolith is a server-side TypeScript and JavaScript library designed to prevent Regular Expression Denial of Service (ReDoS) attacks using Rust and linear Regex.
ReDoS attacks exploit vulnerable Regex patterns with specific inputs to cause service unavailability; Regolith offers a linear worst case time complexity compared to the exponential worst case of default RegExp.
Regolith aims to be a drop-in replacement for RegExp, immune to ReDoS attacks, requiring minimal changes for developers.
The trade-off for Regolith's immunity to ReDoS attacks is the exclusion of backreferences and look-around features in the Rust Regex library.