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

Fix regex dos #2350

Merged
merged 1 commit into from
Aug 7, 2022
Merged

Fix regex dos #2350

merged 1 commit into from
Aug 7, 2022

Conversation

IceTank
Copy link
Contributor

@IceTank IceTank commented Dec 20, 2021

I think this should fix the regex dos. I am not sure if all types of whispers and chat messages still work. Might have to see if people report issues.

@rom1504
Copy link
Member

rom1504 commented Dec 26, 2021

let's do that first PrismarineJS/prismarine-chat#51

@Chitasa
Copy link
Contributor

Chitasa commented Dec 26, 2021

Seems to fail on the cases where prefix is longer than 5 characters https://regex101.com/r/OhOJIM/5
You can probably instead use lazy matching (ex: (?:\(.+?\)|\[.+?\]|.)*?(\w{3,16}))

@rom1504 rom1504 merged commit 3b9243b into PrismarineJS:master Aug 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants