paperbot · PL 论文追踪

全部论文 待读 收藏

P2 FlashRegex

FlashRegex:面向抗 ReDoS 攻击的正则表达式合成与修复
ASE Proceedings of the 35th IEEE/ACM International Conference on Automated Software Engineering2020匹配度 2/10 · 该论文研究从示例合成/修复抗 ReDoS 正则表达式,属于程序合成与安全方向,虽与 PL 和形式化方法有弱关联,但未涉及静态分析、LLM/Agent、浮点程序分析或贝叶斯程序分析等用户核心方向。引用 17 inbox
Yeting Li, Zhiwu Xu, Jialun Cao, Haiming Chen, Tingjian Ge, Shing-Chi Cheung, Haoren Zhao
crossref: 2026-09-12

AI 速览

一句话:提出 FlashRegex 框架,从示例合成或修复出抗 ReDoS 的正则表达式。

正则表达式广泛用于编程语言、字符串处理和数据库,但已有合成/修复工具未考虑 ReDoS 漏洞:若正则具有超线性最坏复杂度,攻击者可构造输入触发拒绝服务。本文提出基于示例编程的框架 FlashRegex,首次将正则合成与修复同 ReDoS 感知结合。它通过降低正则歧义,并借助布尔可满足性(SAT)或邻域搜索(NS)推导抗 ReDoS 正则。作者与五个先进工具对比:现有工具在数秒至一小时内生成了多达 394 个易受攻击正则,而 FlashRegex 约五秒内未生成超线性正则;修复易受攻击正则时,修复后抗 ReDoS 正则比现有工具和人类专家多 4 个,且无需裁剪或重排序,体现通用性、自动化与易用性。

问题
现有正则合成与修复工具未针对 ReDoS 攻击设计,可能生成具有超线性最坏复杂度的脆弱正则。
方法
提出基于示例编程的 FlashRegex,通过降低正则歧义并使用 SAT 或邻域搜索来合成/修复抗 ReDoS 正则。
评估
与五个 SOTA 工具对比生成易受攻击正则数量、耗时及修复后抗 ReDoS 正则数量,并与人类专家比较。
原文摘要(Abstract)

Regular expressions (regexes) are widely used in different fields of computer science such as programming languages, string processing and databases. However, existing tools for synthesizing or repairing regexes were not designed to be resilient to Regex Denial of Service (ReDoS) attacks. Specifically, if a regex has super-linear (SL) worst-case complexity, an attacker could provide carefully-crafted inputs to launch ReDoS attacks. Therefore, in this paper, we propose a programming-by-example framework, FlashRegex, for generating anti-ReDoS regexes by either synthesizing or repairing from given examples. It is the first framework that integrates regex synthesis and repair with the awareness of ReDoS-vulnerabilities. We present novel algorithms to deduce anti-ReDoS regexes by reducing the ambiguity of these regexes and by using Boolean Satisfiability (SAT) or Neighborhood Search (NS) techniques. We evaluate FlashRegex with five related state-of-the-art tools. The evaluation results show that our work can effectively and efficiently generate anti-ReDoS regexes from given examples, and also reveal that existing synthesis and repair tools have neglected ReDoS-vulnerabilities of regexes. Specifically, the existing synthesis and repair tools generated up to 394 ReDoS-vulnerable regex within few seconds to more than one hour, while FlashRegex generated no SL regex within around five seconds. Furthermore, the evaluation results on ReDoS-vulnerable regex repair also show that FlashRegex has better capability than existing repair tools and even human experts, achieving 4 more ReDoS-invulnerable regex after repair without trimming and resorting, highlighting the usefulness of FlashRegex in terms of the generality, automation and user-friendliness.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot5905,
  title = {FlashRegex},
  author = {Yeting Li and Zhiwu Xu and Jialun Cao and Haiming Chen and Tingjian Ge and Shing-Chi Cheung and Haoren Zhao},
  booktitle = {ASE},
  year = {2020},
  doi = {10.1145/3324884.3416556}
}