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

Queries: update package to reject very deeply nested regexps which could crash Loki #5541

Merged
merged 1 commit into from
Mar 4, 2022

Commits on Mar 4, 2022

  1. Update grafana/regexp package to reject very deeply nested regexps

    This is a cherry-pick of golang/go@ac07163
    with the following description:
    
    regexp/syntax: reject very deeply nested regexps in Parse
    
    The regexp code assumes it can recurse over the structure of
    a regexp safely. Go's growable stacks make that reasonable
    for all plausible regexps, but implausible ones can reach the
    “infinite recursion?” stack limit.
    
    This CL limits the depth of any parsed regexp to 1000.
    That is, the depth of the parse tree is required to be ≤ 1000.
    Regexps that require deeper parse trees will return ErrInternalError.
    bboreham committed Mar 4, 2022
    Configuration menu
    Copy the full SHA
    4a7fdc3 View commit details
    Browse the repository at this point in the history