Improving Developers' Understanding of Regex Denial of Service Tools through Anti-Patterns and Fix Strategies

12/15/2022
by   Sk Adnan Hassan, et al.
0

Regular expressions are used for diverse purposes, including input validation and firewalls. Unfortunately, they can also lead to a security vulnerability called ReDoS (Regular Expression Denial of Service), caused by a super-linear worst-case execution time during regex matching. Due to the severity and prevalence of ReDoS, past work proposed automatic tools to detect and fix regexes. Although these tools were evaluated in automatic experiments, their usability has not yet been studied; usability has not been a focus of prior work. Our insight is that the usability of existing tools to detect and fix regexes will improve if we complement them with anti-patterns and fix strategies of vulnerable regexes. We developed novel anti-patterns for vulnerable regexes, and a collection of fix strategies to fix them. We derived our anti-patterns and fix strategies from a novel theory of regex infinite ambiguity - a necessary condition for regexes vulnerable to ReDoS. We proved the soundness and completeness of our theory. We evaluated the effectiveness of our anti-patterns, both in an automatic experiment and when applied manually. Then, we evaluated how much our anti-patterns and fix strategies improve developers' understanding of the outcome of detection and fixing tools. Our evaluation found that our anti-patterns were effective over a large dataset of regexes (N=209,188): 100 art 50 than the state of the art when applied manually (N=20): 100 them effectively vs. 50 and fix strategies increased developers' understanding using automatic tools (N=9): from median "Very weakly" to median "Strongly" when detecting vulnerabilities, and from median "Very weakly" to median "Very strongly" when fixing them.

READ FULL TEXT
research
04/21/2020

SQLCheck: Automated Detection and Diagnosis of SQL Anti-Patterns

The emergence of database-as-a-service platforms has made deploying data...
research
06/23/2020

A Catalogue of Game-Specific Anti-Patterns

With the ever-increasing use of games, game developers are expected to w...
research
10/23/2020

Automatic Repair of Vulnerable Regular Expressions

A regular expression is called vulnerable if there exist input strings o...
research
04/13/2022

Characterizing and Mitigating Anti-patterns of Alerts in Industrial Cloud Systems

Alerts are crucial for requesting prompt human intervention upon cloud a...
research
03/29/2022

Uniqueness of the Gibbs measure for the anti-ferromagnetic Potts model on the infinite Δ-regular tree for large Δ

In this paper we prove that for any integer q≥ 5, the anti-ferromagnetic...
research
10/29/2018

Abelian Anti-Powers in Infinite Words

An abelian anti-power of order k (or simply an abelian k-anti-power) is ...
research
06/04/2021

Understanding and Countering Stereotypes: A Computational Approach to the Stereotype Content Model

Stereotypical language expresses widely-held beliefs about different soc...

Please sign up or login with your details

Forgot password? Click here to reset