daxingplay / kmc

module compiler for kissy
MIT License
32 stars 36 forks source link

Unsafe use of eval #54

Open cristianstaicu opened 8 years ago

cristianstaicu commented 8 years ago

In file lib/index.js the following use of eval is dangerous

var requiredModules = eval('(' + requires[i]).requires;

A malicious package may place a require clause that would lead to code execution. Either validate all inputs passed to eval using a regex or use a more advanced sanitization library like: https://github.com/cristianstaicu/eval-sanitizer