Skip to content

Vulnerable Regular Expression in utils.py #3811

Closed
@yetingli

Description

@yetingli

Type of Issue
Potential Regex Denial of Service (ReDoS)

Description
The vulnerable regular expressions are located in

https://github.com/PyCQA/pylint/blob/2261844748be0f881719963d2fb5932dd4e4a2e2/pylint/pyreverse/utils.py#L54

https://github.com/PyCQA/pylint/blob/2261844748be0f881719963d2fb5932dd4e4a2e2/pylint/pyreverse/utils.py#L55

The ReDOS vulnerabilities of the regex are mainly due to the sub-pattern [^\W_]+\w* and can be exploited with the following string
"__"+"1"*5000 + "!"

I think you can limit the input length or modify these regexes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions