GitHub - JakeRoggenbuck/regolith: A server-side TypeScript and JavaScript library immune to Regular Expression Denial of Service (ReDoS) attacks by using Rust and linear RegEx under the hood. Regolith has a linear worst case time complexity, compared to the default RegExp found in TypeScript and JavaScript, which has an exponential worst case.
Briefly

Regolith is a library aimed at providing a secure alternative for Regex operations within TypeScript and JavaScript environments. It uses Rust and employs linear Regex approaches to achieve a linear worst case time complexity, contrasting with the exponential worst case of default RegExp implementations. Regular Expression Denial of Service (ReDoS) attacks can exploit inefficient Regex patterns to render services unavailable, a concern for developers. Regolith serves as a drop-in replacement for existing Regex libraries, requiring minimal changes to be adopted while focusing on better performance and security.
Regolith is a server-side library that provides a safe Regex alternative in TypeScript and JavaScript, protecting against Regular Expression Denial of Service (ReDoS) attacks.
Unlike the default RegExp which has exponential worst case time complexity, Regolith achieves linear worst case performance, significantly reducing vulnerabilities to ReDoS.
Read at github.com
[
|
]