- **Version**: v7.0.0 - **Platform**: Darwin josser-mbp 16.1.0 Darwin Kernel Version 16.1.0: Thu Oct 13 21:26:57 PDT 2016; root:xnu-3789.21.3~60/RELEASE_X86_64 x86_64 - **Subsystem**: don't know, regexp? Hi! Not sure that this is correct place for such issue, because it looks more like v8 bug. However, here is code which is stuck and never finished: ``` javascript var r = new RegExp("^(http|https|ftp)\://([a-zA-Z0-9\.\-]+(\:[a-zA-Z0-9\.&%\$\-]+)*@)*((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])|([a-zA-Z0-9\-]+\.)*[a-zA-Z0-9\-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(\:[0-9]+)*(/($|[a-zA-Z0-9\.\,\?\'\\\+&%\$#\=~_\-]+))*$"); var url = "http://www.something.com/bookstore/making-process-improvement-work-a-concise-action-guide-0132929554"; r.test(url); ``` Same code in chrome also eating 100% CPU and hang but not reproducible in safari or firefox. That's why I think it's v8 issue. Thank you and sorry for bad english :)
Activity
benjamingr commentedon Oct 28, 2016
I can also reproduce this on earlier versions of Node
cjihrig commentedon Oct 28, 2016
The nested
*s and+s make this look like a ReDoS. I can reproduce the hang on Firefox as well.bnoordhuis commentedon Oct 28, 2016
V8 doesn't bail out on catastrophic backtracking like SM does (and presumably JSC too). See https://bugs.chromium.org/p/v8/issues/detail?id=287 and the many issues linked from it for more discussion.
I'm going to close this because it's not under our control and the V8 team has stated they don't intend to change it.