This repository has been archived by the owner on Nov 4, 2024. It is now read-only.
Unescaped identifiers
regex causes DoS by heap exhaustion/infinite loop
#694
Labels
It's prevalent to import Sanctuary as
S
and sanctuary-def as$
, i.e:The problem is that esm's find-indexes is using the unescaped identifiers in a regex (e.g:
S
and$
), which, in this case, causes an infinite loop, i.e:pattern
becomesnew RegExp("\\b(?:S|$)\\b", "g")
which matches 0 characters, and therefore matches infinitely (e.g in the while loop).Suggested bug fix: escape the
identifiers
used in the regex.The text was updated successfully, but these errors were encountered: