Skip to content
Book Open access

LARA: Static ReDoS Detection for Regular Expressions with Lookahead via Matching Automata

Oct 2026 · Proceedings of the 41st IEEE/ACM International Conference on Automated Software Engineering · 0 citations · 61 references

Abstract

Regular expressions (regexes) with lookahead assertions are widely used in modern software, yet their interaction with backtracking engines can cause Regular expression Denial of Service (ReDoS) vulnerabilities. Existing static methods rely on 𝜀-NFA ambiguity analysis, which cannot capture lookahead evaluation cost, while dynamic and hybrid methods incur high cost or incomplete coverage. We present LARA, a static ReDoS detector for regular expressions with lookahead (REwLA), which subsumes standard regexes. Our core contribution is the matching NFA, which transforms a REwLA into a standard 𝜀-NFA. The matching NFA is not language-equivalent to the original REwLA; however, we prove that its match degree equals the la-match degree of the original REwLA, so the same complexity upper bound is preserved, including lookahead overhead. This reduces lookahead-aware ReDoS detection to standard 𝜀-NFA ambiguity analysis, enabling existing detection techniques to be applied directly to the matching NFA. We evaluate LARA on 42,794 deduplicated real-world REwLA. Among 5,889 vulnerabilities jointly confirmed by multiple tools and validated on real backtracking engines, LARA identifies 5,871, outperforming all baselines. On 400 confirmed vulnerable regexes from 177 real-world ReDoS CVEs, LARA achieves 99.50% recall. LARA successfully exploits 4,468 vulnerabilities on real engines, with a median analysis time of 0.05 s and 7.67 MB memory.

Read PDF

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.