Skip to content

Fix regex dos#2350

Merged
rom1504 merged 1 commit into
PrismarineJS:masterfrom
IceTank:regex-fix
Aug 7, 2022
Merged

Fix regex dos#2350
rom1504 merged 1 commit into
PrismarineJS:masterfrom
IceTank:regex-fix

Conversation

@IceTank
Copy link
Copy Markdown
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
Copy Markdown
Member

rom1504 commented Dec 26, 2021

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

@Chitasa
Copy link
Copy Markdown
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