Lune

S&P2016Top-tier venue

Back in Black: Towards Formal, Black Box Analysis of Sanitizers and Filters

George Argyros, Ioannis Stais, Aggelos Kiayias, Angelos D. Keromytis

Abstract

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.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

6 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • SymCerts: Practical Symbolic Execution for Exposing Noncompliance in X.509 Certificate Validation Implementations cites 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 cites Parse Me, Baby, One More Time: Bypassing HTML Sanitizer via Parsing Differentials
  • Sound and Precise Symbolic Automata Model for Stateful Software Systems cites SFADiff: Automated Evasion Attacks and Fingerprinting Using Black-box Differential Automata Learning
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers6

  1. SymCerts: Practical Symbolic Execution for Exposing Noncompliance in X.509 Certificate Validation ImplementationsSze Yiu Chau, Omar Chowdhury, Md. Endadul Hoque, Huangyi Ge et al.S&P 2017 · 67 citations
  2. SFADiff: Automated Evasion Attacks and Fingerprinting Using Black-box Differential Automata LearningGeorge Argyros, Ioannis Stais, Suman Jana, Angelos D. Keromytis et al.CCS 2016 · 65 citations
  3. Parse Me, Baby, One More Time: Bypassing HTML Sanitizer via Parsing DifferentialsDavid Klein, Martin JohnsS&P 2024 · 7 citations
  4. 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
  5. Sound and Precise Symbolic Automata Model for Stateful Software SystemsXinlong Wu, Ruiyu Zhou, Peisen Yao, Qingkai ShiCAV 2026

Related papers

  1. XSSky: Detecting XSS Vulnerabilities through Local Path-Persistent FuzzingYoukun Shi, Yuan Zhang, Tianhao Bai, Feng Xue et al.USENIX Security 2025
  2. HVLearn: Automated Black-Box Analysis of Hostname Verification in SSL/TLS ImplementationsSuphannee Sivakorn, George Argyros, Kexin Pei, Angelos D. Keromytis et al.S&P 2017 · 88 citations
  3. Active Learning of Symbolic NetKAT AutomataMark Moeller, Tiago Ferreira, Thomas Lu, Nate Foster et al.PLDI 2025 · 4 citations
  4. Supply-Chain Vulnerability Elimination via Active Learning and RegenerationNikos Vasilakis, Achilles Benetopoulos, Shivam Handa, Alizee Schoen et al.CCS 2021 · 22 citations
  5. V-Star: Learning Visibly Pushdown Grammars from Program InputsXiaodong Jia, Gang TanPLDI 2024 · 4 citations
Dusk over the sea between two cliffs drawn in fine vertical lines