For those who don't know about it, Find Security Bugs is a plugin for the Java static analysis tool FindBugs. This plugin consist of a set rules that focus only on security weakness.
FindSecurityBugs used inside Eclipse IDE |
(If you are not a user of the tool, this post will likely not be of great interest.)
What is new in 1.2.1?
Few rules were added and enhanced. The major ones are:
- Better coverage for the SaxParser api vulnerable to XXE. The default configuration of the SaxParser is still vulnerable in the latest JDK.
- Detect usage of XMLDecoder which is a parser that is not design to parse XML from external source. For more information, refer to Dinis Cruz article "Using XMLDecoder to execute server-side Java Code..".
- Better coverage for weak hashing functions. This change consist in the addition of api of the Apache-Commons library.
- Detection of Static IV when encrypting messages. This rule will trigger if an instance of IvParameterSpec is construct and the bytes were not generated randomly in the same method. This rule is likely to trigger many alerts that require manual evaluation.
- Detection of ESAPI Encryptor usage. The latest version of ESAPI is still weak if you are using the default configuration. The description of the bug will guide you with a list of verification.
- Evaluation of dynamic script with ScriptEngine. You definitely want to use a sandbox in most context.
- Evaluation of dynamic expression with SpEL (Spring Expression Language). This api is part of Spring core components and should never be expose to an end-user.
I will soon publish an article about the two last rules to present the vulnerabilities and exploitation scenarios.
Thanks to Dave Wichers, the descriptions have received important improvements.You can see the changes on the bugs description page.
Project status and future
Two years after I started this project, I am very pleased to see it being use in a wide range of organisations. At first, it was really just a "weekend project" that aim to automate part of my work when doing code review. I am now finding a variety of reference to the tool in enterprise and academic contexts.
The latest version of the OWASP Top 10 and the OWASP Testing Guide mention it.
The latest version of the OWASP Top 10 and the OWASP Testing Guide mention it.
"There are other free, open source, code review tools. The most promising is FindBugs, and its new security focused plugin called: FindSecurityBugs, both of which are for Java."The SWAMP project (Software Assurance Marketplace) is using FindSecurityBugs to cover the analysis of Java code.
OWASP Top 10 - PDF format, page 18
"Currently, the SWAMP offers seven static analysis tools, which are: Findbugs with FindSecurityBugs, Clang Static Analyzer, CPPCheck, GCC, PMD, error-prone, and Checkstyle."It was use in the code review of the Norwegian Voting System in 2013.
SWAMP FAQ
"An early step taken to get better acquainted with the code base, was by running automated tools for static analysis. In particular, FindBugs with the “Find Security Bugs”-plugin, as well as PMD, were used. These are freely available tools that are simple to set up and run, which use heuristic techniques to discover possible or probable code errors. [...] In particular, FindBugs has been quite helpful."Finally, the austrian company Porsche Informatik has create the Sonar plugin last year. The support for the latest version should be integrate soon.
Source code audit of Norwegian electronic voting system, Page 18
~~~
The plugin will continue to grow but it is likely that the number of new rules decrease as I am getting less ideas. There is still room for improvement for many existing rules.
References
- Find Security Bugs : The plugin website (downloads, tutorials, list of bugs found, ...)
- Find Security Bugs on github : Where to start contributing or submitting an issue.
- FindBugs : FindBugs website
Nice job Phil !
ReplyDelete