What Javascript is not safe in a open-ended script?
stackoverflow.com
stackoverflow.com
alert("blah")
can just as easily be made to be
window["alert"]("blah"), where the string 'alert' could be made by a very convoluted manner. Solving this would be akin to solving the halting problem, no?