OWASP Top 10 - Application Security (2017)
Introduction
The Open Web Application Security Project (OWASP) is a non-profit community helps organizations to develop secured applications. The OWASP Top 10 Web Application Security Risks was updated in 2017 to provide guidance to developers and security professionals on the most critical vulnerabilities that are commonly found in web applications, which are mostly found in web application.The list is usually refreshed in every 3-4 years.They come up with standards, freeware tools and conferences that help organizations as well as researchers.
The following are a brief overview about the OWASP Top 10 Web Application Security vulnerabilities:
- Injection
- Broken Authentication
- Sensitive Data Exposure
- XML External Entity
- Broken Access Control
- Security Misconfiguration
- Cross-Site Scripting
- Insecure Deserialization
- Using Components With Known Vulnerabilities
- Insufficient Logging and Monitoring
Injection
Injection attacks occur when the user is able to input untrusted data tricking the application to execute unintended commands without proper authorization. Injections flaws can be - SQL injection, PHP injection, LDAP injection, Code injection and OS injection.
With a successful attack, an attacker can gain:
- Unauthorized access to an application: An attacker can successfully bypass an application’s authentication mechanism to have illegitimate access to it.
- Information disclosure: An attack could lead to a complete data leakage from the database server.
- Loss of data availability: An attacker can delete records from the database server.
- Compromised data integrity: As SQL statements are also used to modify or add the record, an attacker can use SQL injection to modify or add data stored in a database. This would lead to compromised data integrity.
Mitigation:
- Validating data i.e rejecting suspicious-looking data.
- Sanitizing user-submitted data, refers to cleaning up the suspicious parts of the data.
- Prepared statements with parameterized queries.
- Stored procedures.
- Principle of least privilege. This is a standard security control that helps minimize the potential damage of a successful attack.For example, accounts that only require read access are only granted read access to the table they need to access.
- A database admin can set controls to minimize the amount of information an injection attack can expose.
Broken Authentication
Vulnerabilities in Broken authentication occurs when the application is incorrectly configured or mismanages session related information such that the users identity gets compromised. The information can be in the form of session cookies, passwords, secret keys etc.
For example, an attacker can take a list containing thousands of known username/password combinations obtained during a data breach and use a script to try all those combinations on a login system to see if there are any that work.
With a successful attack, an attacker can gain:
- Unauthorized access to an application: An attacker can successfully bypass an application’s authentication mechanism to have illegitimate access to it.
- Information disclosure: An attack could lead to a complete data leakage from the database server if admin authentication is breached.
- Compromised data integrity: CRUD operations may take place by an admin account under the control of an attacker.
Mitigation:
- Usage of multifactor authentication.
- Using a SSL Certificate (HTTPS) on your application.
- Implementing an idle session timeout.
- Using cookies generated using secure algorithms and implementing HTTPS only read.
- Rate-limiting repeated login attempts.
- Forcing the usage of strong passwords.
- Forced login/logout after a password change.
- Invalidate tokens and cookies after logout.
Sensitive Data Exposure
Attackers can sniff or modify the sensitive data in web applications and APIs if not properly protected. Attack can lead to leak of financial data, usernames and passwords, or health information that could enable attackers to access such information to commit fraud or steal identities. One popular method for stealing sensitive information is using a man-in-the-middle(MITM) attack.
With a successful attack, an attacker can gain:
- Information disclosure: An attack could lead to a complete data leakage from the database server or may lead to sensitive data stored somewhere in the server.
Mitigation:
- Use strong encryption keys.
- Encrypt all data in transit and at rest.
- Use secure protocols and algorithms.
- Disable caching of responses with sensitive data.
- Using a SSL Certificate (HTTPS) on your application.
XML External Entity
This is an attack against a web application that parses XML input. Poorly configured XML processors evaluate external entity references within XML documents. Attackers can use external entities for attacks including remote code execution, and to disclose internal files and SMB file shares.
With a successful attack, an attacker can gain:
- Execute remote code: An attack could lead to a complete or partial takeover of the server.
Mitigation:
3. Accept a less complex type of data such as JSON.
4. Disable the use of external entities in an XML application.
5. Avoiding serialization of sensitive data.
6. Using Web Application Firewalls to detect and block attacks.
7. Having code reviews often.
8. Whitelisting code at server side to prevent malicious XML upload.
Broken Access Control
Improperly configured application allows attackers to access unauthorized resource or other users accounts, viewing sensitive documents, modifying data and access rights. Applications have different types of account depending on the users such as admins, operators, reporting groups and many more. Common problem is that the developers restrict the privileges just on the UI side and not on the server side. If exploited, each user can have admin rights.
Do not confuse Broken Access Control with Broken Authentication!
Broken Authentication refers to an attacker gaining access over the account of another person
Broken Access Control refers to an attacker doing changes to a system which they should not be allowed to do
With a successful attack, an attacker can gain:
- Information disclosure: An attack could lead to sensitive data leakage.
- Compromised data integrity: CRUD operations may take place by an unauthorized account under the control of an attacker.
Mitigation:
- Use secured authorization tokens.
- Restrict access of all resources based on various roles.
- Implement server side resource restriction.
Security Misconfiguration
This risk refers to improper implementation of controls such as misconfiguration of security headers, error messages containing sensitive information (information leakage), and not patching or upgrading systems, frameworks, and components.
This is the most common vulnerability on the list, and is often the result of using default configurations. Examples of these security misconfigurations are weak passwords, default passwords, default scripts stored on the servers, default directories, default error messages etc.
With a successful attack, an attacker can gain:
- Information disclosure: An attack could lead to a complete data leakage from the database server or may lead to sensitive data stored somewhere in the server.
- Complete Takeover: An attack could lead to the whole server being taken over by the attacker.
Mitigation:
- Review the security of the configurations.
- Install only the required features from a framework.
- Do ensure that defaults are changed.
- Ensuring that error messages are more general.
Cross-Site Scripting
Cross-site scripting (XSS) vulnerabilities occur when web applications allow attacker to insert malicious code or untrusted script into a url path or onto the web application. XSS is of 3 type i.e Reflected, Stored and DOM based XSS. These types refer to the way the attack is stored and executed.
With a successful attack, an attacker can gain:
- Information disclosure: An attack could lead to a complete data leakage from the database server.
- Account takeover: An attack could lead to an account being taken over by the attacker.
- Website defacement: An attack could deface the website.
- Unintended actions: An attack could lead to an attacker forcing the user(s) to make unintended actions.
Mitigation:
- Enabling Content-Security-policy(CSP).
- Escaping untrusted characters.
- Validating data i.e rejecting suspicious-looking data.
- Sanitizing user-submitted data, refers to cleaning up the suspicious parts of the data.
Insecure Deserialization
Serialization means taking objects from the application code and converting them into a format that can be used for another purpose, such as storing the data to disk or streaming it. Deserialization is just the opposite: converting serialized data back into objects the application can use.
An insecure deserialization exploit is the result of deserializing data from untrusted sources.
With a successful attack, an attacker can gain:
- DDoS attack: An attack could lead to the server being unavailable to users.
- Execute remote code: An attack could lead to a complete or partial takeover of the server.
Mitigation:
- Encryption of serialized data.
- Deserializers to run with least privileges.
Using Components With Known Vulnerabilities
Web developers use components such as libraries and frameworks in their web applications and these component are piece of software that helps developers to avoid redundant work. So attacker look for vulnerability in these components and this can lead to hundreds of thousands of components vulnerable to attacks. Examples are use of vulnerable PHP version, Unpatched windows, out-dated kernel version and many more. Attackers can exploit an insecure component to take over the server or steal sensitive data.
With a successful attack, an attacker can gain:
- Information disclosure: An attack could lead to a complete data leakage from the database server or may lead to sensitive data stored somewhere in the server.
- Complete Takeover: An attack could lead to the whole server being taken over by the attacker.
Mitigation:
- Frequently patch the process.
- Remove unused components from their application.
- Ensuring components are up to date.
- Ensure components are received from a trusted source.
Insufficient Logging and Monitoring
To ensure the malicious intent of the attackers gets noticed, it is essential to log all the activity and monitor it for any suspicious behavior.For example, Junk traffic, too many login attempts from a particular source etc.The average discovery time for a breach is around 200 days after it has happened. Insufficient logging and ineffective integration with security incident response systems allow attackers to pivot to other systems and maintain persistent threats.
Mitigation:
- 24x7 monitoring of application traffic.
- Log analysis.
- Implement incident response plans.
Conclusion
The above vulnerabilities are one of the most common and are to be kept in mind as a priority while developing or testing web applications
0 Comments:
Post a Comment