Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

`like` clause evaluation can time out due to catastrophic backtracking #875

nblumhardt opened this issue Jul 17, 2019 · 0 comments


Copy link

@nblumhardt nblumhardt commented Jul 17, 2019

like clause arguments such as %foo_x% (i.e. that cannot be converted into a simple string.Contains() predicate) are converted to regular expressions for evaluation.

Because % translates to (.|\r|\n)* (plus some RegexOptions flags), the resulting expressions may cause excessive backtracking, and therefore time out.

We can fix this using atomic grouping syntax (?>.|\r|\n)*.

As a workaround, affected clauses can be rewritten today using regex directly, e.g. @Message = /(?>.|\r|\n)*foo.x(?>.|\r|\n)*/

@nblumhardt nblumhardt added the bug label Jul 17, 2019
@nblumhardt nblumhardt added this to the 6.0-pre milestone Jul 17, 2019
@nblumhardt nblumhardt closed this Jul 17, 2019
@nblumhardt nblumhardt modified the milestones: 6.0-pre, 5.1-patch6 Jan 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
1 participant
You can’t perform that action at this time.