paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Decision procedures for path feasibility of string-manipulating programs with complex operations

复杂操作字符串操作程序的路径可行性判定过程
POPL 3(POPL)2019匹配度 2/10 · 该论文研究字符串操作程序的路径可行性判定与字符串约束求解,属于程序分析与形式化方法领域,但并未涉及用户画像中的核心方向:LLM/Agent 与静态分析的交叉、浮点程序分析或贝叶斯程序分析。因此与研究方向仅有很弱的领域相关性。引用 80 inbox
Taolue Chen, Matthew Hague, Anthony W. Lin, Philipp Rümmer, Zhilin Wu
crossref: 2026-09-10

AI 速览

一句话:提出保证字符串操作程序路径可行性可判定的语义条件,并实现可扩展求解器 OSTRICH。

本文研究字符串程序路径可行性判定,应用于符号执行与 XSS 检测。路径为无循环赋值/断言序列,需判断是否存在成功执行输入。作者提出两条通用语义条件:断言具有正则单体分解,赋值函数逆关系保持正则性;覆盖拼接、换能器、replaceall、反转、正则匹配及部分长度函数,且严格包含已有可判定理论。该条件给出概念简单的判定过程与可扩展架构,但过于一般,难以兼顾速度与完备性;为此限制为部分确定性函数,或用语法片段处理非确定函数并归约到 SLOTH。作者实现 OSTRICH,内置拼接、反转、函数换能器与 replaceall,并与其他求解器对比验证。

问题
字符串操作程序的路径可行性判定:给定无循环的赋值与断言序列,判断是否存在输入使所有断言成立。
方法
提出两条语义条件(正则单体分解与逆关系保持正则性)来保证可判定性,并给出两个实用限制:仅允许部分确定性字符串函数,或将非确定函数片段归约到 SLOTH;据此实现字符串求解器 OSTRICH。
评估
理论上给出复杂度结果并证明条件覆盖多种字符串操作与已有可判定理论;实验上将 OSTRICH 与竞争求解器比较,展示其有效性。
原文摘要(Abstract)

The design and implementation of decision procedures for checking path feasibility in string-manipulating programs is an important problem, with such applications as symbolic execution of programs with strings and automated detection of cross-site scripting (XSS) vulnerabilities in web applications. A (symbolic) path is given as a finite sequence of assignments and assertions (i.e. without loops), and checking its feasibility amounts to determining the existence of inputs that yield a successful execution. Modern programming languages (e.g. JavaScript, PHP, and Python) support many complex string operations, and strings are also often implicitly modified during a computation in some intricate fashion (e.g. by some autoescaping mechanisms). In this paper we provide two general semantic conditions which together ensure the decidability of path feasibility: (1) each assertion admits regular monadic decomposition (i.e. is an effectively recognisable relation), and (2) each assignment uses a (possibly nondeterministic) function whose inverse relation preserves regularity. We show that the semantic conditions are expressive since they are satisfied by a multitude of string operations including concatenation, one-way and two-way finite-state transducers, replaceall functions (where the replacement string could contain variables), string-reverse functions, regular-expression matching, and some (restricted) forms of letter-counting/length functions. The semantic conditions also strictly subsume existing decidable string theories (e.g. straight-line fragments, and acyclic logics), and most existing benchmarks (e.g. most of Kaluza’s, and all of SLOG’s, Stranger’s, and SLOTH’s benchmarks). Our semantic conditions also yield a conceptually simple decision procedure, as well as an extensible architecture of a string solver in that a user may easily incorporate his/her own string functions into the solver by simply providing code for the pre-image computation without worrying about other parts of the solver. Despite these, the semantic conditions are unfortunately too general to provide a fast and complete decision procedure. We provide strong theoretical evidence for this in the form of complexity results. To rectify this problem, we propose two solutions. Our main solution is to allow only partial string functions (i.e., prohibit nondeterminism) in condition (2). This restriction is satisfied in many cases in practice, and yields decision procedures that are effective in both theory and practice. Whenever nondeterministic functions are still needed (e.g. the string function split), our second solution is to provide a syntactic fragment that provides a support of nondeterministic functions, and operations like one-way transducers, replaceall (with constant replacement string), the string-reverse function, concatenation, and regular-expression matching. We show that this fragment can be reduced to an existing solver SLOTH that exploits fast model checking algorithms like IC3. We provide an efficient implementation of our decision procedure (assuming our first solution above, i.e., deterministic partial string functions) in a new string solver OSTRICH. Our implementation provides built-in support for concatenation, reverse, functional transducers (FFT), and replaceall and provides a framework for extensibility to support further string functions. We demonstrate the efficacy of our new solver against other competitive solvers.

链接与引用

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

BibTeX
@article{paperbot622,
  title = {Decision procedures for path feasibility of string-manipulating programs with complex operations},
  author = {Taolue Chen and Matthew Hague and Anthony W. Lin and Philipp Rümmer and Zhilin Wu},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {3},
  number = {POPL},
  year = {2019},
  doi = {10.1145/3290362}
}