Issue metadata
Sign in to add a comment
|
Long RegEx that does not match with a long string crashes website
Reported by
skortenb...@gmail.com,
Jun 14 2018
|
||||||||||||||||||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36 Steps to reproduce the problem: Copy the following commands in the browser console and execute them: 1. var text = "https://test.example.com/examplefolder/index.html?param1=eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCIsInZlciI6MX0.eyJpc3MiOiJjb21wb25lbnRMaWNlbmNlU2VydmVyIiwibGljIjoiMGUxNzZmZDgtZjdjZS00OWQwLTg4NDEtMGExMzE3ODQ3YjI4Iiwic3ViIjoiNjQ5NDItMDYwMzQiLCJ0aWQiOjQxODExNiwiY2lkIjoxfQ.fq8ikVqrnpd_s86lz8H4c_GULO2EHdbT8bq4NRAy5fGyxtiSSZRHPL900FvKbbOOtuvdtplvNqG8tEmZH2WUwA¶m2=0¶m3=64942-06034¶m4=1¶m5=webshadow¶m6=418116¶m7=37913C¶m8=0¶m9=1&_=15289629061724455544455&INVALID_STRING_PART=" 2. var regEx = /^(https?:)?(\/\/)?((([\däöüa-z-]+\.)+)([a-z]{2,12})|((([0-9]{1,3}\.){3})[0-9]{1,3})|(localhost))(:[0-9]{2,5})?(\/?)(\/[\wäöü\.-]+)*((#.*)|((\/?\?((##.+##)|([\wäöü#%\.-]+(=[\wäöü,#%\.\/-]+)?))+)(\&((##.+##)|([\wäöü,#%\.-]+(=[\wäöü,#%\.-]+)?)))*?)?)\/?$/gi 3. regEx.test(text) What is the expected behavior? regEx.test(text) should return false. What went wrong? Website freezes and in some cases the complete browser crashes. Did this work before? N/A Chrome version: 67.0.3396.87 Channel: stable OS Version: 10.0 Flash Version: Works as intended when the regex matches, with shorter strings the site does not crash but return takes a long time.
,
Jun 14 2018
I know that the performance of this regex is not great, but it worked fine in older Chrome versions. I updated today after I recieved reports from colleagues that their browser freezes. You are right that other browsers hang too, but that does not mean Chrome has to do the same.
,
Jun 14 2018
The test case you've posted above doesn't work in older versions of Chrome. Tested in Chrome 31, 41, 51, 61, 66, 67, 69. Didn't finish even after a minute.
,
Jun 14 2018
,
Jun 14 2018
The repro case locks up my tab as well.
,
Jun 15 2018
|
|||||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||||
Comment 1 by woxxom@gmail.com
, Jun 14 2018