Hi!
Simon Bennets suggested on StackOverflow that I'd re-post my question here.
Quickly about myself, because I just joined the group: I'm the founder of ]project-open[, an open-source project management software for "project businesses" (SME service companies, IT departments, PMO (Project Management Office) of large enterprises, ...). We've got some 6000 productive customers running their business on ]po[, including 5 banks and ~100 companies with >1000 users.
]project-open[ is really, really big. It consists of about 4.5 million LoC and has about 1000 HTML pages (distinct base URLs). You can get ]po[ running in 10 minutes by downloading a CentOS Linux based virtual machine appliance for VMware ESXi / VMware Player. There is also a public demo server in case you want to have a quick look (but please don't do heavy testing on it). I guess this could be an interested test case for ZAP as a product. Using ]po[ as a target for (local!) testing is fine, just please send us vulnerability reports. There are several published issues (2x SQL injection, 1x persistent XSS, multiple reflections) for version 5.0.3.0.0.
We are now going to add additional parameter type checks for 1000 pages: Each page can take multiple parameters (object_id, filters, column name for sorting, ...). Normally, parameters are checked for a given type by a "procedure head" like structure for each Web page called ad_page_contract, and SQL injection is avoided by passing variable values to the PostgreSQL database via a separate channel (not via the SQL string) as colon variables. However, there are some exceptions where we had to bypass ad_page_contract, and these ~50 cases are causing trouble now.
So we are now going to add checks (integer, alphanum, nohtml, ...) for each of these parameters. We would need to test systematically that:
- a) offensive parameter values are rejected and
- b) that the parameter values actually used by the application are accepted.
Example: We might want to say that the sort_column parameter in a page should only consist of alphanumeric characters. But a customer extension of the app may include a column name with a space in it, leading to a false positive security alert (space character not being an alphanumeric character).
I understand that ZAP should be designed for such a use-case, isn't it?
My idea for testing this would be to:
- Manually navigate to each of these pages in proxy mode,
- tell ZAP to start spider all links on each page for one or two levels and finally
- tell ZAP to start fuzzing on these URLs.
How can this be implemented in ZAP? I've got a basic understanding of ZAP and did some security testing of ]project-open[. I've read about a ZAP extension for scanning a list of URLs, but in our case we want to execute some specific ZAP actions on each of these URLs...
Simon wrote:
> I'd start by using the ZAP desktop so that you can control it and see exactly what effect it has.
> You can launch a browser, explore you app and then active scan the URLs you've found.
This is what I did.
> The standard spider will find explore traditional apps very effectively but apps that make a
> lot of use of javascript will probably require the ajax spider.
Nope, the "standard spider" fails in ]po[ because of the number of parameters in each page and the number of possible values for each parameters, leading to a combinatoric explosion. And correct, all PM applications heavily use JavaScript today (Redmine, Jira, OrangeScrum, ...).
Instead, we would need to start with the "1st level seed URLs" from manual browsing and spider breadth-first for just one or two levels in order to get "2nd level URLs" which should contain all these 1000 existing pages with reasonable parameters.
> You can also use the 'attack mode' which attacks everything that is in scope (which you define)
> that you proxy through ZAP. That just means the ZAP effectively just follows what you do and
> attacks anything new. If you don't explore part of your app then ZAP wont attack it.
That's all fine, there is no problem to attack anything in ]po[. However, the combinatoric explosion of parameter values (see above) renders this attack mode intractable.
> If you want to implement your own tests then I'd have a look at creating scripted active scan rules.
> We can help you with those but I'd just start with exploring your app and running the default rules for now.
I've done the "start with exploring" part, and I've found some XSS reflections within a few minutes. That's all fine.
Now we would have to start with the "systematic" and "exhaustive" part.
I just wonder if our use-case is rare or rather frequent. I thought that many other Web applications were tested like this, but I didn't find anything on the Web. I know there are these automatic testing tools like Selenium etc., but these focus more on GUI stuff rather than back-end security. There are literally thousands of Web applications in the market with a similar structure, and they are usually crawling with security and permission errors.
So maybe there is a more general use-case behind our requirements, where ZAP could make a big difference to the overall security of Web applications...
And congratulations to your work, by the way! ZAP is a show-case open-source project!
Cheers
Frank