This site is the archived OWASP Foundation Wiki and is no longer accepting Account Requests.
To view the new OWASP Foundation website, please visit https://owasp.org
OWASP Top Ten Cheat Sheet
Introduction
The following is a developer-centric defensive cheat sheet for the 2013 release of the OWASP Top Ten Project. It also presents a quick reference based on OWASP Testing Project to help how to identify the risks.
OWASP Top Ten Cheat Sheet
Presentation | Controller | Model | Testing (OWASP Testing Guide V4) | |
A1 Injection |
Render:
On Submit:
|
Canonicalize using correct character set
Positive input validation using correct character set (NR) Negative input validation. (LR) Sanitize input. Tip: updating a negative list (such as looking for "script", "sCrIpT", "ßCrîpt", etc) will require expensive and constant deployments and will always fail as attackers work out your list of "bad" words. Positive validation is simpler, faster and usually more secure and needs updating far less than any other validation mechanism. |
*Parameterized queries
Tip: All SQL Injection is due to dynamic SQL queries. Strongly consider prohibiting dynamic SQL queries within your organization |
|
A2 Weak authentication and session management | Render:
|
Design:
|
Validate role is sufficient to create, read, update, or delete data
Tip: Consider the use of a "governor" to regulate the maximum number of requests per second / minute / hour that this user may perform. For example, a typical banking user should not perform more than ten transactions a minute, and one hundred per second is dangerous and should be blocked. |
Test Role Definitions (OTG-IDENT-001) Test User Registration Process (OTG-IDENT-002) Test Account Provisioning Process (OTG-IDENT-003) Testing for Account Enumeration and Guessable User Account (OTG-IDENT-004) Testing for Weak or unenforced username policy (OTG-IDENT-005) Testing for Credentials Transported over an Encrypted Channel (OTG-AUTHN-001) Testing for default credentials (OTG-AUTHN-002) Testing for Weak lock out mechanism (OTG-AUTHN-003) Testing for bypassing authentication schema (OTG-AUTHN-004) Test remember password functionality (OTG-AUTHN-005) Testing for Browser cache weakness (OTG-AUTHN-006) Testing for Weak password policy (OTG-AUTHN-007) Testing for Weak security question/answer (OTG-AUTHN-008) Testing for weak password change or reset functionalities (OTG-AUTHN-009) Testing for Weaker authentication in alternative channel (OTG-AUTHN-010) Testing for bypassing authorization schema (OTG-AUTHZ-002) Testing for Privilege Escalation (OTG-AUTHZ-003) Testing for Bypassing Session Management Schema (OTG-SESS-001) Testing for Cookies attributes (OTG-SESS-002) Testing for Session Fixation (OTG-SESS-003) Testing for Exposed Session Variables (OTG-SESS-004) Testing for Cross Site Request Forgery (CSRF) (OTG-SESS-005) Testing for logout functionality (OTG-SESS-006) Test Session Timeout (OTG-SESS-007) Testing for Session puzzling (OTG-SESS-008) |
A3 XSS |
Render:
On Submit:
|
Canonicalize using correct character set
Positive input validation using correct character set (NR) Negative input validation (LR) Sanitize input Tip: Only process data that is 100% trustworthy. Everything else is hostile and should be rejected. |
Tip: Do not store data HTML encoded in the database. This prevents new uses for the data, such as web services, RSS feeds, FTP batches, data warehousing, cloud computing, and so on.
Tip: Use OWASP Scrubbr to clean tainted or hostile data from legacy data |
Testing for Reflected Cross Site Scripting (OTG-INPVAL-001) Testing for Stored Cross Site Scripting (OTG-INPVAL-002) Testing for DOM based Cross Site Scripting (OTG-CLIENT-001) Testing for JavaScript Execution (OTG-CLIENT-002) Testing for HTML Injection (OTG-CLIENT-003) Testing for Cross Site Flashing (OTG-CLIENT-008) |
A4 Insecure Direct Object References | If data is from internal trusted sources, no data is sent.
Or Render:
|
Obtain data from internal, trusted sources.
Or Obtain direct value from random access reference access map. |
Validate role is sufficient to create, read, update, or delete data. |
Testing Directory traversal/file include (OTG-AUTHZ-001) Testing for Insecure Direct Object References (OTG-AUTHZ-004) Testing for Local File Inclusion Testing for Remote File Inclusion |
A5 Security Misconfiguration | Ensure web servers and application servers are hardened.
PHP: Ensure allow_url_fopen and allow_url_include are both disabled in php.ini. Consider the use of Suhosin extension |
Ensure web servers and application servers are hardened
XML: Ensure common web attacks (remote XSLT transforms, hostile XPath queries, recursive DTDs, and so on) are protected by your XML stack. Do not hand craft XML documents or queries – use the XML layer. |
Ensure database servers are hardened |
Fingerprint Web Server (OTG-INFO-002) Fingerprint Web Application Framework (OTG-INFO-008) Fingerprint Web Application (OTG-INFO-009) Test Network/Infrastructure Configuration (OTG-CONFIG-001) Test Application Platform Configuration (OTG-CONFIG-002) Test File Extensions Handling for Sensitive Information (OTG-CONFIG-003) Review Old, Backup and Unreferenced Files for Sensitive Information (OTG-CONFIG-004) Enumerate Infrastructure and Application Admin Interfaces (OTG-CONFIG-005) Test HTTP Methods (OTG-CONFIG-006) Test RIA cross domain policy (OTG-CONFIG-008) Analysis of Error Codes (OTG-ERR-001) Analysis of Stack Traces (OTG-ERR-002) |
A6 Sensitive Data Exposure | Design:
Tip: Use TLS 1.2 always – even internally. Most snooping is done within corporate networks – and it is as easy and unethical as fishing with dynamite. Render:
|
Design:
Tip: Only certain personally identifiable information and sensitive values MUST be encrypted. Encrypt data that would be embarrassing or costly if it was leaked or stolen. Tip: It is best to encrypt data on the application server, rather than the database server. |
Design:
Tip: Do not use RDBMS database, row or table level encryption. The data can be retrieved in the clear by anyone with direct access to the server, or over the network using the application credentials. It might even traverse the network in the clear despite being "encrypted" on disk. |
Testing for Weak SSL/TLS Ciphers, Insufficient Transport Layer Protection (OTG-CRYPST-001) Testing for Padding Oracle (OTG-CRYPST-002) Testing for Sensitive information sent via unencrypted channels (OTG-CRYPST-003) Test HTTP Strict Transport Security (OTG-CONFIG-007) Testing for Credentials Transported over an Encrypted Channel (OTG-AUTHN-001) |
A7 Missing Function Level Access Control | Design:
Pre-render:
Render:
|
Tip: It's impossible to control access to secured resources that the web application server does not directly serve. Therefore, PDF reports or similar should be served by the web application server using binary octet streaming. Tip: Assume attackers will learn where "hidden" directories and "random" filenames are, so do not store these files in the web root, even if they are not directly linked. |
Validate role is sufficient to create, read, update, or delete data |
Testing Directory traversal/file include (OTG-AUTHZ-001) Testing for bypassing authorization schema (OTG-AUTHZ-002) Testing for bypassing authentication schema (OTG-AUTHN-004) |
A8 Cross Site Request Forgery | Pre-render:
Render:
|
Tip: CSRF is always possible if there is XSS, so make sure XSS is eliminated within your application. |
Validate role is sufficient to create, read, update, or delete data |
Testing for Cross Site Request Forgery (CSRF) (OTG-SESS-005) |
A9 Using Components with Known Vulnerabilities |
|
|
|
|
A10 Unvalidated Redirects and Forwards |
or Render:
|
or
|
|
Authors and Primary Editors
Andrew van der Stock vanderaj[at]owasp.org
Ismael Rocha Gonçalves ismaelrg[at]gmail.com
Jorge Correa [email protected]