WAF-A-MoLE: Evading Web Application Firewalls through Adversarial Machine Learning Luca Demetrio Andrea Valenza
[email protected] [email protected] Università di Genova Università di Genova Gabriele Costa Giovanni Lagorio
[email protected] [email protected] IMT School for Advanced Studies Lucca Università di Genova ABSTRACT 1 admin ' OR 1=1# Web Application Firewalls are widely used in production envi- 2 admin ' OR 0X1 =1 or 0x726!=0x726 OR 0 x1Dd ronments to mitigate security threats like SQL injections. Many not IN /*(seleCt0X0)>c^Bj>N]*/(( SeLeCT industrial products rely on signature-based techniques, but ma- 476) ,( SELECT ( SElEct 477)),0X1de) oR chine learning approaches are becoming more and more popular. 8308 noT lIkE 8308\ x0c AnD truE OR ' The main goal of an adversary is to craft semantically malicious FZ6/q' LiKE 'fz6/qI ' anD TRUE anD '>U' payloads to bypass the syntactic analysis performed by a WAF. != '>uz '#t'%'03; Nd In this paper, we present WAF-A-MoLE, a tool that models the presence of an adversary. This tool leverages on a set of muta- tion operators that alter the syntax of a payload without affecting Figure 1: Two semantically equivalent payloads. the original semantics. We evaluate the performance of the tool against existing WAFs, that we trained using our publicly available SQL query dataset. We show that WAF-A-MoLE bypasses all the possible exploitation patterns, e.g., payloads carrying a SQL injec- considered machine learning based WAFs. tion. Since WAFs work at application-level, they have to deal with KEYWORDS highly expressive languages such as SQL and HTML.