Back in Black: Towards Formal, Black Box Analysis of Sanitizers and Filters
George Argyros, Ioannis Stais, Aggelos Kiayias, Angelos D. Keromytis
摘要
We tackle the problem of analyzing filter and sanitizer programs remotely, i.e. given only the ability to query the targeted program and observe the output. We focus on two important and widely used program classes: regular expression (RE) filters and string sanitizers. We demonstrate that existing tools from machine learning that are available for analyzing RE filters, namely automata learning algorithms, require a very large number of queries in order to infer real life RE filters. Motivated by this, we develop the first algorithm that infers symbolic representations of automata in the standard membership/equivalence query model. We show that our algorithm provides an improvement of x15 times in the number of queries required to learn real life XSS and SQL filters of popular web application firewall systems such as mod-security and PHPIDS. Active learning algorithms require the usage of an equivalence oracle, i.e. an oracle that tests the equivalence of a hypothesis with the target machine. We show that when the goal is to audit a target filter with respect to a set of attack strings from a context free grammar, i.e. find an attack or infer that none exists, we can use the attack grammar to implement the equivalence oracle with a single query to the filter. Our construction finds on average 90% of the target filter states when no attack exists and is very effective in finding attacks when they are present. For the case of string sanitizers, we show that existing algorithms for inferring sanitizers modelled as Mealy Machines are not only inefficient, but lack the expressive power to be able to infer real life sanitizers. We design two novel extensions to existing algorithms that allow one to infer sanitizers represented as single-valued transducers. Our algorithms are able to infer many common sanitizer functions such as HTML encoders and decoders. Furthermore, we design an algorithm to convert the inferred models into BEK programs, which allows for further applications such as cross checking different sanitizer implementations and cross compiling sanitizers into different languages supported by the BEK backend. We showcase the power of our techniques by utilizing our black-box inference algorithms to perform an equivalence checking between different HTML encoders including the encoders from Twitter, Facebook and Microsoft Outlook email, for which no implementation is publicly available.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 6 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- SymCerts: Practical Symbolic Execution for Exposing Noncompliance in X.509 Certificate Validation Implementations 引用了 SFADiff: Automated Evasion Attacks and Fingerprinting Using Black-box Differential Automata Learning
- Be Aware of What You Let Pass: Demystifying URL-based Authentication Bypass Vulnerability in Java Web Applications 引用了 Parse Me, Baby, One More Time: Bypassing HTML Sanitizer via Parsing Differentials
- Sound and Precise Symbolic Automata Model for Stateful Software Systems 引用了 SFADiff: Automated Evasion Attacks and Fingerprinting Using Black-box Differential Automata Learning
引用它的顶会 Paper6
- SymCerts: Practical Symbolic Execution for Exposing Noncompliance in X.509 Certificate Validation ImplementationsSze Yiu Chau, Omar Chowdhury, Md. Endadul Hoque, Huangyi Ge 等S&P 2017 · 67 次引用
- SFADiff: Automated Evasion Attacks and Fingerprinting Using Black-box Differential Automata LearningGeorge Argyros, Ioannis Stais, Suman Jana, Angelos D. Keromytis 等CCS 2016 · 65 次引用
- Parse Me, Baby, One More Time: Bypassing HTML Sanitizer via Parsing DifferentialsDavid Klein, Martin JohnsS&P 2024 · 7 次引用
- Be Aware of What You Let Pass: Demystifying URL-based Authentication Bypass Vulnerability in Java Web ApplicationsQiyi Zhang, Fengyu Liu, Zihan Lin, Yuan ZhangCCS 2025
- Sound and Precise Symbolic Automata Model for Stateful Software SystemsXinlong Wu, Ruiyu Zhou, Peisen Yao, Qingkai ShiCAV 2026
相关 Paper
- XSSky: Detecting XSS Vulnerabilities through Local Path-Persistent FuzzingYoukun Shi, Yuan Zhang, Tianhao Bai, Feng Xue 等USENIX Security 2025
- HVLearn: Automated Black-Box Analysis of Hostname Verification in SSL/TLS ImplementationsSuphannee Sivakorn, George Argyros, Kexin Pei, Angelos D. Keromytis 等S&P 2017 · 88 次引用
- Active Learning of Symbolic NetKAT AutomataMark Moeller, Tiago Ferreira, Thomas Lu, Nate Foster 等PLDI 2025 · 4 次引用
- Supply-Chain Vulnerability Elimination via Active Learning and RegenerationNikos Vasilakis, Achilles Benetopoulos, Shivam Handa, Alizee Schoen 等CCS 2021 · 22 次引用
- V-Star: Learning Visibly Pushdown Grammars from Program InputsXiaodong Jia, Gang TanPLDI 2024 · 4 次引用
