Skip to content
This repository has been archived by the owner on Dec 25, 2022. It is now read-only.

Fix Regular Expression injection #289

Merged
merged 1 commit into from Mar 25, 2021
Merged

Fix Regular Expression injection #289

merged 1 commit into from Mar 25, 2021

Conversation

jorgectf
Copy link
Contributor

@jorgectf jorgectf commented Mar 23, 2021

The fact of not sanitizing user input appended to a regular expression may lead to a Regular Expression Denial of Service by an attacker crafting a regular expression taking too much to load, or simply change the behaviour of the program.

Vulnerable code:

match_obj = re.search("\\d{" + str(digits) + "}", filename)

References:

OWASP ReDoS

@codeclimate
Copy link

codeclimate bot commented Mar 23, 2021

Code Climate has analyzed commit c42d48b and detected 0 issues on this pull request.

View more on Code Climate.

@tubone24
Copy link
Owner

@tubone24 tubone24 self-requested a review March 25, 2021 01:07
@tubone24 tubone24 merged commit f3e7020 into tubone24:master Mar 25, 2021
@jorgectf jorgectf deleted the fix-regex-injection branch March 25, 2021 08:00
@jorgectf
Copy link
Contributor Author

🎉

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants