最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

What's the best tool for Javascript security auditing? - Stack Overflow

programmeradmin3浏览0评论

Something that can at least scan a batch of .js files looking for eval statements and other questionable code. Maybe just a regex pattern would do it, but I'd like to find a more sophisticated (and regularly maintained) tool.

Something that can at least scan a batch of .js files looking for eval statements and other questionable code. Maybe just a regex pattern would do it, but I'd like to find a more sophisticated (and regularly maintained) tool.

Share Improve this question asked Jan 5, 2011 at 17:02 mcqwertymcqwerty 3,4162 gold badges28 silver badges24 bronze badges 2
  • 1 Why don't you try over on security.stackexchange.? – AviD Commented Jan 6, 2011 at 21:36
  • 1 There is a security SE now? Jesus, how is one expected to keep up with this. – Anders Commented Jan 10, 2011 at 22:27
Add a ment  | 

4 Answers 4

Reset to default 3

old topic but new tool : ScanJS, developed by mozilla in order to check the Firefox OS security. https://github./mozilla/scanjs

Have you tried Douglas Crockford's JSLint? Although it doesn't scan your code for security problems, however, it does alert you on "eval" statements. OTOH, Predrag Tomasevic has wrote a JavaScript Verifier based on JSLint that can be integrated with Visual Studio (read more on this here).

I'm not aware of any Open Source tools that conduct static analysis of JavaScript.

Grepping for eval() likely isn't going to help for anything other than very simple, very obvious mistakes. It'll be even more difficult to analyze if the script has been minified or obfuscated because you'll be hard-pressed to determine if the argument is being used safely or not.

There are plenty of security problems in JavaScript that rely on the interaction with the DOM. Grepping for eval() might work, but it'll miss other execution points like hrefs or event handlers that might be attacked, e.g. href=javascript:xss or onFoo=xss. You really need a tool that deals with JavaScript and the DOM, not just a JavaScript console.

IBM/Watchfire recently released a paper about a JavaScript analyzer they've created. The paper provides details on results rather than implementation. A mercial tool might not be the way you want to go, but the paper should help shed more light on the challenges of doing this well.

This tool from Facebook seems promising.

https://github./facebook/jsgrep

发布评论

评论列表(0)

  1. 暂无评论