svent / jsdetox

A Javascript malware analysis tool
https://svent.dev/projects/jsdetox/
592 stars 77 forks source link

Error parsing javascript #13

Closed likemusic closed 10 years ago

likemusic commented 10 years ago

Show "Error parsing javascript" when try analyse this - https://gist.github.com/likemusic/14057418ebb7549c6704

svent commented 10 years ago

Thanks for your bug report and the sample file.

I found two problems parsing the file:

  1. Unescaped '/' characters embedded in RegEx character classes, like 'regex = /[/]/'
  2. Very long variable declaration statements led to a stack error (this was not always a problem in my tests, but on some machines this led to errors)

I implemented the following fixes:

  1. Solved by switching the rkelly library to the fork provided by @nene, containing a fix for this problem
  2. These errors are now handled specifically and the user is informed that adjusting the stack limit might help