OWASP, or the Open Web Application Security Project, is a global non-profit organization that focuses on web application security. One of their main principles is that all of their resources be free and easy to access on their website, so anyone can improve their web application security. The resources they provide include documentation, tools, videos, and forums. Their most famous project is probably the OWASP Top 10.
The OWASP Top 10 is a report that lists the most important security issues for web application security, updated regularly. The report is created by a group of security experts from around the world. OWASP calls the Top 10 a ‘awareness document’ and they suggest that all companies use the report in their processes to reduce and/or avoid security risks.
Here are the security risks in the OWASP Top 10 2017 report:
Injection attacks can be stopped by validating and/or sanitizing user-submitted data. (Validation means refusing suspicious-looking data, while sanitization means removing the suspicious-looking parts of the data.) Also, a database admin can set limits to reduce the amount of information an injection attack can reveal.
Some ways to prevent authentication weaknesses are requiring two-factor authentication (2FA) and limiting or delaying repeated login attempts using rate limiting.
Data exposure risk can be reduced by encrypting all sensitive data and also disabling the caching* of any sensitive information. Also, web application developers should make sure that they are not storing any sensitive data that they don’t need.
*Caching is the practice of temporarily storing data for re-use. For example, web browsers will often cache webpages so that if a user goes back to those pages within a fixed time span, the browser does not have to get the pages from the web.
The best ways to stop XEE attacks are to have web applications accept a simpler type of data, such as JSON**, or at least to update XML parsers and disable the use of external entities in an XML application.
*XML or Extensible Markup Language is a markup language meant to be readable by both humans and machines. Because of its complexity and security flaws, it is now being replaced by other formats in many web applications.
**JavaScript Object Notation (JSON) is a type of easy, human-readable notation often used to send data over the internet. Although it was originally made for JavaScript, JSON is language-independent and can be understood by many different programming languages.
Access controls can be protected by making sure that a web application uses authorization tokens* and sets strict controls on them.
*Many services give authorization tokens when users log in. Every privileged request that a user makes will need the authorization token to be present. This is a secure way to make sure that the user is who they claim to be, without having to enter their login credentials all the time.
Security Misconfiguration Security misconfiguration is the most frequent vulnerability on the list, and is often caused by using default configurations or showing too much information in errors. For example, an application could show a user very detailed errors that may expose weaknesses in the application. This can be prevented by deleting any unused features in the code and making sure that error messages are more vague.
Cross-Site Scripting Cross-site scripting vulnerabilities happen when web applications let users add custom code into a url path or onto a website that will be seen by other users. This vulnerability can be used to run harmful JavaScript code on a victim’s browser. For example, an attacker could send an email to a victim that looks like it is from a trusted bank, with a link to that bank’s website. This link could have some harmful JavaScript code added to the end of the url. If the bank’s site is not well protected against cross-site scripting, then that harmful code will run in the victim’s web browser when they click on the link.
Ways to prevent cross-site scripting include escaping untrusted HTTP requests and validating and/or sanitizing user-generated content. Using modern web development frameworks like ReactJS and Ruby on Rails also gives some built-in cross-site scripting protection.
An insecure deserialization exploit happens when deserializing data from untrusted sources, and can lead to serious problems like DDoS attacks and remote code execution attacks. While steps can be taken to try and stop attackers, such as watching deserialization and doing type checks, the only sure way to protect against insecure deserialization attacks is to avoid the deserialization of data from untrusted sources.
Component developers often offer security fixes and updates to close known vulnerabilities, but web application developers don’t always have the fixed or most-recent versions of components running on their applications. To reduce the risk of running components with known vulnerabilities, developers should delete unused components from their projects, as well as making sure that they are getting components from a trusted source and keeping them up to date.
For a more technical and detailed look at the OWASP Top 10, see the official report.