Repairing ReDoS by Construction: Certified Algebraic Derivation for Language-Preserving Regex Transformation

Regular expressions (regexes) are widely used in modern software systems, yet their backtracking-based execution exposes them to Regular Expression Denial-of-Service (ReDoS) attacks, where crafted inputs trigger super-linear runtime. While prior work has made significant progress in detecting such vulnerabilities, automatically repairing them remains fundamentally challenging: existing approaches rely on heuristic rewriting or search-based mutation, often producing patches that either break functional correctness or fail to eliminate worst-case backtracking, with no formal guarantees. We focus on ReDoS vulnerabilities induced by structural ambiguity under backtracking semantics. We present ReAR, a certified algebraic framework that recasts ReDoS repair as a language-preserving transformation problem. Our key insight is that catastrophic backtracking is not inherent to the language defined by a regex, but instead arises from its structural representation. Based on this observation, ReAR performs repair via a constructive algebraic derivation that transforms vulnerable regexes into language-equivalent repairs that are free from the modeled structural hazards. ReAR follows a three-stage pipeline: ambiguity exposure, vulnerability elimination, and structural reduction. The first stage reveals latent ambiguity and hidden backtracking paths; the second removes the modeled exponential and polynomial backtracking hazards, yielding regexes that are structurally free from the ambiguity patterns targeted by our derivation system; and the third reduces structural redundancy while preserving language and remaining free from the modeled hazards. All transformations are grounded in Kleene algebra, ensuring language equivalence (L(R') = L (R)) while enforcing a complexity safety invariant, and produce machine-checkable derivation certificates. We implement ReAR and evaluate it on 460 real-world vulnerable regexes collected from CVEs and prior benchmarks. ReAR successfully repairs 85.22% of vulnerabilities, outperforming existing state-of-the-art methods, while maintaining an average repair time of 0.86 seconds per regex. We further analyze the algebraic derivation process and find that repairs typically converge within a small number of transformation steps (median: 5), with 78.57% of regexes repaired within 10 steps, demonstrating the practical efficiency of our certified approach. Beyond effectiveness, ReAR provides verifiable proof traces, transforming regex repair from heuristic patching into a principled and auditable process.

Link
https://www.semanticscholar.org/paper/33968ccd2662e911c05629842adb6e4510d8561d
Found by
Semantic Scholar
Authors
Ye-Cheng Sun, Ye-Ting Li, Hui-Na Chao, Zhi-Wu Xu, Li-Xiao Zheng, Qin Mai, Meng-Cheng Shi, Xin-Yi Wang, Heng-Yu Yang, Yang Xiao, Feng Li, Wei Huo
Categories
benchmark, evaluation
Published
2026-11-14
Last seen by the radar
2026-11-15
Citations
0
Influential citations
0
Radar score
40.35 / 100 (how it is scored)
Why it scored so
Matched: benchmark, evaluat; Primary record: Semantic Scholar
Related links
https://doi.org/10.1145/3830454.3846572
Is this record right? If you made this work and something here is wrong or missing, tell us what to fix.

More records found by Semantic Scholar