Skip to content

Regular expression caused exponential backtracking on Java #39

@aldy505

Description

@aldy505
  1. This part of the regular expression may cause exponential backtracking on strings starting with 'class' and containing many repetitions of 'a'.
    { pattern: /(public\s*)?class\s*(.*)+(\s)?\{/, type: 'keyword' },

According to the LGTM rule (click that link to see detailed rule):

Some regular expressions take a long time to match certain input strings to the point where the time it takes to match a string of length n is proportional to nk or even 2n. Such regular expressions can negatively affect performance, or even allow a malicious user to perform a Denial of Service ("DoS") attack by crafting an expensive input string for the regular expression to match.

See LGTM for detailed issue.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions