Closed euank closed 6 years ago
The DoS is not quite where I expected.
The bit where the math is evaluated, below, isn't actually taking a significant amount of time with that input:
Rather, it's one of the input filters that blows up:
That ignoreRe
is a 'regex-chain' of about 11 different regexes 'or'ed together:
I wonder who wrote this 'regex-chain' module that seems to be blowing up... Oh no, it was me, oh gosh.
The only one of those regexes that seems to grow exponentially is const onlyTime = new RC(/^(:?[0-9]+:?)+$/);
.
This doesn't appear to be regex-chain
being bad, but rather that regex being bad.