Skip to content

Support Regex features: Lookaround, Lookahead and Lookbehind in AutoMod #6860

Discussion options

You must be logged in to vote

probably not, considering that adding these features requires switching to a backtracking based regex engine, which in turn introduces the possibility for regex denial of service.

you can try it yourself locally in nodejs, which does use backtracking. this regex match will take very long to complete. you can craft an even worse regex & input text combination that will take hours or even days to complete

/(a*)*b/.test("a".repeat(2000))

its not possible to reliably detect such denial of service attacks without heavily restricting the options of the regex.

but if you limit yourself to only the regular features, without things like lookarounds, you can use a crate like https://github.com/rust…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Denis0014
Comment options

Answer selected by Denis0014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants