Discovering Security Vulnerabilities With Selenium
In this article, we'll go over how to use Selenium to detect what OWASP labels as important security vulnerabilities in web applications.
Join the DZone community and get the full member experience.Join For Free
Hackers are constantly discovering security vulnerabilities—in everything from web applications to Internet of Things (IoT) devices. It seems that we wake up to newly reported security breaches with each new day.
Why are companies being attacked? In my experience, it’s because security is too often left out of the development life cycle, even when a company has a dedicated security team. And I speculate that many companies struggle to implement a security program because they don't have a dedicated team for direction, so they simply don't know where to start.
I certainly can’t claim to be an expert on security. But I do know quite a bit about software testing, and I think that testing tools should be one weapon in your arsenal when it comes to finding and fixing security vulnerabilities.
Below, I’ll explain where Selenium fits into finding security vulnerabilities. I’ll discuss how to do this within the framework of eliminating OWASP (The Open Web Application Security Project) vulnerabilities from web applications.
What Are the OWASP Top 10 Security Vulnerabilities?
OWASP lists the common vulnerabilities to which web applications fall victim. To eliminate security risks from your web application, it is important that the entire team become familiar with OWASP vulnerabilities.
I won’t go over each type of OWASP vulnerability here, but the list includes:
- A2-Broken Authentication and Session Management
- A3-Cross-Site Scripting (XSS)
- A4-Insecure Direct Object References
- A5-Security Misconfiguration
- A6-Sensitive Data Exposure
- A7-Missing Function Level Access Control
- A8-Cross-Site Request Forgery (CSRF)
- A9-Using Components with Known Vulnerabilities
- A10-Unvalidated Redirects and Forwards
To increase security awareness, it’s crucial to educate everyone involved in the software development process. To begin building in-depth knowledge about security vulnerabilities, the OWASP Top 10 is an excellent place to start. Developers can use this information to build a secure web application and decrease the risk that the application will be hacked. Then your security testing can analyze and assess that the web application is not vulnerable, and remains compliant with industry security standards.
Am I Vulnerable To Hackers?
Once you know what the potential security vulnerabilities in your app are, you can start using Selenium to identify the areas where they occur.
You do this by using existing Selenium tests and Zed Attack Proxy (ZAP). What is ZAP? ZAP is an intercepting proxy designed for a wide range of users from security beginners to experienced security experts and is a penetration testing solution for finding the vulnerabilities on a web application. By executing Selenium (regression) tests through ZAP, it allows us to intercept or modify HTTP/HTTPS and WebSocket traffic, with an assortment of other useful tools. At the end of execution, ZAP reports warnings, errors, and security vulnerabilities it detected and provides a clear picture of how vulnerable a web application is to hackers.
OWASP ZAP Tutorial Video
The details of setting up Selenium and ZAP have been documented elsewhere, so I won’t rehash them here. For a guide, refer to one of the following resources:
- Automated Security Testing Using OWASP ZAP
- Using OWASP ZAP, Selenium, and Jenkins to automate your security tests
- Security Test Automation Using Selenium and ZAP
My main point is simply this: Selenium can and should be a vital tool in your security process. Even though QA tools may not be the first thing that comes to mind when you think about how to find and resolve software security vulnerabilities, it’s important not to leave them out of the picture.
It is important to understand the web application you are security testing to evaluate where OWASP vulnerabilities need security guards. It takes a community to remove security risks. By performing risk assessments at the start, the security team guides prioritization and resolution of risks. To survive, we need to continue analyzing reported vulnerabilities exploited in the wild, because hackers will never stop their malicious attacks.
Published at DZone with permission of , DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.