AdguardTeam / FiltersCompiler

A tool that compiles & validates filters
GNU Lesser General Public License v3.0
52 stars 12 forks source link

Protection from ReDos #162

Open ameshkov opened 1 year ago

ameshkov commented 1 year ago

Check this issue: https://github.com/AdguardTeam/AdguardBrowserExtension/issues/2240

The point is that a poor regular expression may cause the extension to completely break the browser. I suggest adding more checks for regular expressions in the filtering rules.

More on catastrophic backtracking and relevant articles:

Instead of static analysis, we may consider checking every regular expression against a few hundreds of random URLs and detect the "slow regexes" this way.