4 ms·
+1 evil. After spending years telling us not to use eval() to execute raw JSON, now we are suppose to eval() comments? As noted with JSON, theoretically it ca
by gvb 17y ago
+1 evil.
After spending years telling us not to use eval() to execute raw JSON, now we are suppose to eval() comments? As noted with JSON, theoretically it can be used safely, but it is a wide open window of vulnerability for people "just trying to get it done", i.e. 97% of the web sites out there.
http://en.wikipedia.org/wiki/JSON#Security_issues http://en.wikipedia.org/wiki/JSON#Security_issues
"The eval technique is subject to security vulnerabilities if the data and the entire JavaScript environment is not within the control of a single trusted source. If the data is itself not trusted, for example, it may be subject to malicious JavaScript code injection attacks; unless some additional means is used to validate the data first."
(My emphasis on entire JavaScript environment.)