Improving ReDoS detection and finding more bugs using Dlint and r2c
Blog post from Semgrep
The text discusses the use of the r2c distributed analysis platform and Dlint tool to identify and improve the detection of ReDoS (Regular Expression Denial of Service) vulnerabilities in Python code. It highlights the challenge of catastrophic backtracking in regular expressions, which can lead to false positives in detection, and describes improvements made to Dlint's algorithm to reduce these false positives by ensuring that subexpressions are backtrackable. The text also examines a specific ReDoS vulnerability, CVE-2020-6817, found in Mozilla's Bleach library, which sanitizes HTML input. The vulnerability allows for a denial-of-service attack when style attributes are enabled, but the issue was quickly identified and addressed by the Mozilla security team. The platform's ability to continuously evaluate large code repositories is emphasized as a key aspect of modern DevSecOps practices, aiding in the ongoing improvement of code security and the identification of new vulnerabilities.