Sound Static Analysis of Regular Expressions for Vulnerabilities to Denial of Service Attacks - Archive ouverte HAL Accéder directement au contenu
Pré-Publication, Document De Travail Année : 2022

Sound Static Analysis of Regular Expressions for Vulnerabilities to Denial of Service Attacks

Résumé

Modern programming languages often provide functions to manipulate regular expressions in standard libraries. If they offer support for advanced features, the matching algorithm has an exponential worstcase time complexity: for some so-called vulnerable regular expressions, an attacker can craft ad hoc strings to force the matcher to exhibit an exponential behaviour and perform a Regular Expression Denial of Service (ReDoS) attack. In this paper, we introduce a framework based on a tree semantics to statically identify ReDoS vulnerabilities. In particular, we put forward an algorithm to extract an overapproximation of the set of words that are dangerous for a regular expression, effectively catching all possible attacks. We have implemented the analysis in a tool called rat, and testing it on a dataset of 74,670 regular expressions, we observed that in 99.47% of the instances the analysis terminates in less than one second. We compared rat to four other ReDoS detectors, and we found that our tool is faster, often by orders of magnitude, than most other tools. While raising a low number of false positives, rat is the only ReDoS detector that does not report false negatives.
Fichier principal
Vignette du fichier
redos_preprint.pdf (494.98 Ko) Télécharger le fichier
Origine : Fichiers produits par l'(les) auteur(s)

Dates et versions

hal-03685057 , version 1 (01-06-2022)

Identifiants

  • HAL Id : hal-03685057 , version 1

Citer

Francesco Parolini, Antoine Miné. Sound Static Analysis of Regular Expressions for Vulnerabilities to Denial of Service Attacks. 2022. ⟨hal-03685057⟩
92 Consultations
132 Téléchargements

Partager

Gmail Facebook X LinkedIn More