OWASP WebGoat Benchmark Edition (WBE)

= Main =  {| style="padding: 0;margin:0;margin-top:10px;text-align:left;" |-
 * valign="top" style="border-right: 1px dotted gray;padding-right:25px;" |

WebGoat Benchmark Edition
The OWASP WebGoat Benchmark Edition (WBE) is a test suite designed to evaluate the speed, coverage, and accuracy of vulnerability detection tools. Without the ability to measure these tools, it is difficult to understand their value or interpret vendor claims. The WBE contains over 20,000 test cases that are fully runnable and exploitable. The project goals is to measure the capabilities of any kind of vulnerability detection tool.

You can use this initial version with Static Analysis Security Testing Tools (SAST) and Interactive Analysis Security Testing Tools (IAST). A future goal is to support the evaluation of Dynamic Analysis Security Testing Tools (DAST), like OWASP ZAP. The current version is implemented in Java. Future versions may expand to include other languages.

Project Philosophy
Security tools (SAST, DAST, and IAST) are amazing when they find a complex vulnerability in your code. But they can drive everyone crazy with complexity, false alarms, and missed vulnerabilities. We are on a quest to measure just how good these tools are at discovering and properly diagnosing security problems in applications.

One important lesson that WBE takes from NSA's Juliet test suite is the idea of measuring BOTH true vulnerabilities and false positives. Unlike Juliet, in the WBE, true vulnerabilities and false positives are not combined in a single test case. This allows each test case to verify a single aspect of vulnerability detection. For example, one test might check to see if a tool properly handles data flow propagation when a string is split into pieces using a regular expression. Another might be the same test, with a seemingly plausible but fake propagation.

There are four kinds of test results in the WBE:

1. Tool correctly identifies a real vulnerability (TRUE positive) 2. Tool fails to identify a real vulnerability (FALSE negative) 3. Tool correctly ignores a false alarm (TRUE negative) 4. Tool fails to ignore a false alarm (FALSE positive)

We recognize that the WBE test cases are not as complex as real code. These tests are designed to test various capabilities of security tools, but the results for real code may be different or worse than the performance on the WBE. Please submit examples of code that present a challenge for security tools so that we can improve the WBE.

Scoring and Reporting Results
We encourage both vendors, open source tools, and end users to verify their application security tools using the WBE. We encourage everyone to contribute their results to the project. In order to ensure that the results are fair and useful, we ask that you follow a few simple rules when publishing results.

1. Provide an easily reproducible procedure (script preferred) to run the tool on the WBE, including: a) A description of the default “out-of-the-box” installation, version numbers, etc… b) All configuration, tailoring, onboarding, etc… performed to make the tool run c) All changes to default security rules, tests, or checks to achieve the results d) Easily reproducible steps for achieving the result 2. Summary results should be in the following table format a) The Accuracy column calculates the true positive rate by ( (FALSE pass + TRUE pass) / Grand Total ) b) The FALSE and TRUE columns calculate their rate by (FALSE pass / FALSE total) / (TRUE pass / TRUE total) 3. The overall results for a tool should be calculated by: a) Overall Accuracy: AVERAGE( Accuracy ) column b) Overall False Alarm (FA) Rate: 1 - AVERAGE( FALSE ) column c) Overall Missed Negative (MN) Rate: 1 - AVERAGE( TRUE ) column d) Total clock time for the tests to complete

Code Repo
The code for this project is hosted at the OWASP Git repository. Along with the code comes a Maven pom.xml file so you can download all the dependencies and build the entire project with ease using Maven.

Using the pom, it should be easy to verify all the code compiles correctly. To download and build everything, if you already have GIT and Maven installed, all you have to do is:

$ git clone https://github.com/OWASP/webgoat-benchmark $ cd webgoat-benchmark $ mvn compile

A future version will support packaging up the results into a WAR file that you can then run in whatever JEE app server you want.

Licensing
The OWASP WebGoat Benchmark is free to use under the GNU General Public License v2.0.

Mailing List
OWASP WebGoat Benchmark Mailing List

Project Leaders
Dave Wichers [mailto:dave.wichers@owasp.org @]

Related Projects

 * WebGoat
 * NSA's Juliet for Java
 * WAVESEP


 * valign="top" style="padding-left:25px;width:200px;" |

Quick Download
All test code and project files can be downloaded from OWASP GitHub.

News and Events

 * April 15, 2015 - First Version Released

Classifications

 * }

= Test Cases =

This initial release of the WBE has 20,983 test cases. The test case areas and quantities for the April 15, 2015 release are:

To download a spreadsheet that lists every test case, the vulnerability category, the CWE number, and the expected result (true finding/false positive), click here.

Every test case is:
 * a servlet or JSP (currently they are all servlets, but we plan to add JSPs soon)
 * either a true vulnerability or a false positive for a single issue

Metadata for each test case, including the expected result, is contained in a matching XML file

Test Coverage
For the test suite, we plan to determine, does the tool:

- Simple and complex data flow? - Simple and complex control flow? - Popular frameworks? - Inversion of control? - Reflection? Class loading? Annotations? - Popular UI technologies (particularly JavaScript frameworks)
 * Find HTTP request and response problems?
 * Handle scenarios like:

Future enhancements could cover:
 * All vulnerability types in the OWASP Top 10
 * Does the tool find flaws in libraries?
 * Does the tool find flaws spanning custom code and libraries?
 * Does tool handle web services? REST, XML, GWT, etc…
 * Does tool work with different app servers? Java platforms?

Example Test Case
Each test case is a simple Java EE servlet. BenchmarkTest00001 is an LDAP Injection test with the following metadata in the accompanying BenchmarkTest00001.xml file:

 ldapi 00001 true 90  

BenchmarkTest00001.java simply reads in all the cookie values, looks for a cookie named "foo" and uses the value of this cookie when performing an LDAP query. Here's the code for BenchmarkTest00001.java:

package org.owasp.webgoat.benchmark.testcode; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebServlet("/BenchmarkTest00001") public class BenchmarkTest00001 extends HttpServlet { private static final long serialVersionUID = 1L; @Override public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request, response); } 	@Override public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // some code javax.servlet.http.Cookie[] cookies = request.getCookies; String param = null; boolean foundit = false; if (cookies != null) { for (javax.servlet.http.Cookie cookie : cookies) { if (cookie.getName.equals("foo")) { param = cookie.getValue; foundit = true; } 			}  			if (!foundit) { // no cookie found in collection param = ""; } 		} else { // no cookies param = ""; } 		try { javax.naming.directory.DirContext dc = org.owasp.webgoat.benchmark.helpers.Utils.getDirContext; Object[] filterArgs = {"a","b"}; dc.search("name", param, filterArgs, new javax.naming.directory.SearchControls); } catch (javax.naming.NamingException e) { throw new ServletException(e); } 	}  }

= Tool Results =

As of this initial release, we don't have any vulnerability detection tool results to publish. We are working on generating results for Findbugs as our first example, and then plan to work on more after that. If you would like to contribute to this project by running a tool against the benchmark and producing a set of results in the format described in the --Scoring and Reporting Results-- section on the main project tab, please contact the project lead.

Our vision for this project is that we will develop automated test harnesses for lots of vulnerability detection tools where we can repeatably run the tools against each version of the benchmark and automatically produce results in our desired format.

FindBugs
FindBugs is a static analysis tool for Java. It finds both quality and security issues. We are only going to test its ability to find security vulnerabilities. FindBugs has detectors for the following kinds of security issues:


 * Hardcoded Database Passwords
 * HTTP Response Splitting
 * Path Traversal
 * SQL Injection
 * XSS - Cross-Site Scripting

The WBE currently has test cases for the last three types of vulnerabilities. A future release will add tests for the first two that aren't yet covered.

FindSecurityBugs
A very useful addition to FindBugs is the FindSecurityBugs plugin. This plugin significantly improves FindBug's ability to find security vulnerabilities. Once we've scored FindBugs, we'll do FindBugs with FindSecurityBugs next.

OWASP ZAP
The OWASP ZAP project lead is excited to have ZAP be scored against the WBE. However, we need to develop a UI for the application and package everything up in a WAR file so its easily deployed, before we can try to run ZAP against the benchmark.

Other Tools!
We want to test the WBE against as many tools as possible. If you are:


 * A tool vendor and want to participate in the project
 * Someone who wants to help score a free tool agains the project
 * Someone who has a license to a commercial tool and the terms of the license allow you to publish tool results, and you want to participate

please let [mailto:dave.wichers@owasp.org me] know!

= Roadmap =

2015 Roadmap
* OWASP's ZAP * Findbugs and plugins for it like FindSecurityBugs * Commercial SAST, DAST, and IAST tools
 * [June 2015] TBD
 * Analysis tool integration: So you can automatically run tools against the benchmark. We want to build test harnesses for tools like:
 * FUTURE: Expand to include attack test cases to verify whether defenses (WAF, IDS/IPS, RASP) can identify and protect against them

= Acknowledgements =

The following people have contributed to this project and their contributions are much appreciated!


 * Juan Gama - Development of initial release and continued support
 * Ken Prole - Assistance with automated score card development using CodeDx
 * Nick Sanidas - Development of initial release

We are looking for many more volunteers as numerous significant enhancements still need to be made. Please contact [mailto:dave.wichers@owasp.org Dave Wichers] if you are interested in contributing new test cases, tool results run against the benchmark, or anything else. We have a LONG wish list of ideas ...