What is Nostr?
Lea Rosema /
npub17z9…cyur
2024-11-08 11:11:31

Lea Rosema on Nostr: TIL about #ReDoS in #javascript which is about abusing regular expressions to make ...

TIL about #ReDoS in #javascript which is about abusing regular expressions to make the expression execution super slow. Got aware of that via the CodeQL github workflow.

https://codeql.github.com/codeql-query-help/javascript/js-redos/

One thing that seems to be problematic is ambiguity where it is difficult to tell what belongs to a group and what doesn't.

Example code:
const aah = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'

/a+$/.test(aah) // 1ms
/(a+)+$/.test(aah) // 100000ms
Author Public Key
npub17z9xxlms992p30r4gztmxd4mpuwgl7yadck544q0e5jckvcqpczs7ncyur