OWASP_Top_10_Proactive_Controls_V3
OWASP_Top_10_Proactive_Controls_V3
About OWASP
The Open Web Application Security Project (OWASP) is a 501c3 non for
profit educational charity dedicated to enabling organizations to design,
develop, acquire, operate, and maintain secure software. All OWASP tools,
documents, forums, and chapters are free and open to anyone interested
in improving application security. We can be found at www.owasp.org.
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons Attribution- 2
ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons Attribution- 3
ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
FOREWORD
Insecure software is undermining our financial, healthcare, defense,
energy, and other critical infrastructure worldwide. As our digital, global
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.
CALL TO ACTION
Please don’t hesitate to contact the OWASP Proactive Control project with
your questions, comments, and ideas, either publicly to our email list or
privately to jim@owasp.org.
PROJECT LEADERS
Katy Anton Jim Bird Jim Manico
CONTRIBUTORS
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons Attribution- 4
ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
DOCUMENT STRUCTURE
This document is structured as a list of security controls. Each control is
described as follows:
Description
___________________________________________________________________________
_________________________________________
__________________________________
A detailed description of the
control including some best
practices to consider.
Implementation
___________________________________________________________________________
___________________________________________________________________________
__________________________
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons Attribution- 5
ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
_____________
_____________
Set of tools/projects to easily
introduce/integrate security controls into
your software.
INTRODUCTION
The OWASP Top Ten Proactive Controls 2018 is a list of security
techniques that should be considered for every software development
project. This document is written for developers to assist those new to
secure development.
One of the main goals of this document is to provide concrete practical
guidance that helps developers build secure software. These techniques
should be applied proactively at the early stages of software development
to ensure maximum effectiveness.
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons Attribution- 6
ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
This list was originally created by the current project leads with
contributions from several volunteers. The document was then shared
globally so even anonymous suggestions could be considered. Hundreds
of changes were accepted from this open community process.
Target Audience
This document is primarily written for developers. However, development
managers, product owners, Q/A professionals, program managers, and
anyone involved in building software can also benefit from this document.
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons Attribution- 7
ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons Attribution- 8
ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
Description
A security requirement is a statement of needed security functionality that
ensures one of many different security properties of software is being
satisfied. Security requirements are derived from industry standards,
applicable laws, and a history of past vulnerabilities. Security requirements
define new features or additions to existing features to solve a specific
security problem or eliminate a potential vulnerability.
Security requirements provide a foundation of vetted security functionality
for an application. Instead of creating a custom approach to security for
every application, standard security requirements allow developers to
reuse the definition of security controls and best practices. Those same
vetted security requirements provide solutions for security issues that
have occurred in the past. Requirements exist to prevent the repeat of
past security failures.
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons Attribution- 9
ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
user or attacker does to the system, versus describing what the system
offers to the user.
When the story is focused on the attacker and their actions, it is referred
to as a misuse case.
As an attacker, I can enter in a default username and password to
gain access.
This story contains the same message as the traditional requirement from
ASVS, with additional user or attacker details to help make
the requirement more testable.
Implementation
Successful use of security requirements involves four steps. The process
includes discovering / selecting, documenting, implementing, and then
confirming correct implementation of new security features and
functionality within an application.
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons Attribution- 10
ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
Vulnerabilities Prevented
Security requirements define the security functionality of an application.
Better security built in from the beginning of an applications life cycle
results in the prevention of many types of vulnerabilities.
References
OWASP Application Security Verification Standard (ASVS)
OWASP Mobile Application Security Verification Standard (MASVS)
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons Attribution- 11
ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons Attribution- 12
ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
Description
Secure coding libraries and software frameworks with embedded security
help software developers guard against security-related design and
implementation flaws. A developer writing an application from scratch
might not have sufficient knowledge, time, or budget to properly
implement or maintain security features. Leveraging security frameworks
helps accomplish security goals more efficiently and accurately.
Vulnerabilities Prevented
Secure frameworks and libraries can help to prevent a wide range of web
application vulnerabilities. It is critical to keep these frameworks and
libraries up to date as described in the using components with known
vulnerabilities Top Ten 2017 risk.
Tools
OWASP Dependency Check - identifies project dependencies and
checks for publicly disclosed vulnerabilities
Retire.JS scanner for JavaScript libraries
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons Attribution- 13
ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
Description
This section describes secure access to all data stores, including both
relational databases and NoSQL databases. Some areas to consider:
1. Secure queries
2. Secure configuration
3. Secure authentication
4. Secure communication
Secure Queries
SQL Injection occurs when untrusted user input is dynamically added to a
SQL query in an insecure manner, often via basic string concatenation.
SQL Injection is one of the most dangerous application security risks. SQL
Injection is easy to exploit and could lead to the entire database being
stolen, wiped, or modified. The application can even be used to run
dangerous commands against the operating system hosting your
database, thereby giving an attacker a foothold on your network.
In order to mitigate SQL injection, untrusted input should be prevented
from being interpreted as part of a SQL command. The best way to do this
is with the programming technique known as ‘Query Parameterization’.
This defense should be applied to SQL, OQL, as well as stored procedure
construction.
A good list of query parameterization examples in ASP, ColdFusion, C#,
Delphi, .NET, Go, Java, Perl, PHP, PL/SQL, PostgreSQL, Python, R, Ruby and
Scheme can be found at http://bobby-tables.com and the OWASP Cheat
Sheet on Query Parameterization.
Caution on Query Parameterization
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons Attribution- 14
ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
Secure Configuration
Unfortunately, database management systems do not always ship in a
“secure by default” configuration. Care must be taken to ensure that the
security controls available from the Database Management System
(DBMS) and hosting platform are enabled and properly configured. There
are standards, guides, and benchmarks available for most common DBMS.
Secure Authentication
All access to the database should be properly authenticated.
Authentication to the DBMS should be accomplished in a secure manner.
Authentication should take place only over a secure channel. Credentials
must be properly secured and available for use.
Secure Communication
Most DBMS support a variety of communications methods (services, APIs,
etc) - secure (authenticated, encrypted) and insecure (unauthenticated or
unencrypted). It is a good practice to only use the secure communications
options per the Protect Data Everywhere control.
Vulnerabilities Prevented
OWASP Top 10 2017- A1: Injection
OWASP Mobile Top 10 2014-M1 Weak Server Side Controls
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons Attribution- 15
ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
References
OWASP Cheat Sheet: Query Parameterization
Bobby Tables: A guide to preventing SQL injection
CIS Database Hardening Standards
Description
Encoding and escaping are defensive techniques meant to stop injection
attacks. Encoding (commonly called "Output Encoding") involves
translating special characters into some different but equivalent form that
is no longer dangerous in the target interpreter, for example translating
the “<” character into the < string when writing to an HTML page.
Escaping involves adding a special character before the character/string
to avoid it being misinterpreted, for example, adding a “\” character
before a “"” (double quote) character so that it is interpreted as text and
not as closing a string.
Output encoding is best applied just before the content is passed to the
target interpreter. If this defense is performed too early in the processing
of a request then the encoding or escaping may interfere with the use of
the content in other parts of the program. For example if you HTML escape
content before storing that data in the database and the UI automatically
escapes that data a second time then the content will not display properly
due to being double escaped.
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons Attribution- 16
ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons Attribution- 17
ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
Vulnerabilities Prevented
OWASP Top 10 2017 - A1: Injection
OWASP Top 10 2017 - A7: Cross Site Scripting (XSS)
OWASP Mobile_Top_10_2014-M7 Client Side Injection
References
XSS - General information
OWASP Cheat Sheet: XSS Prevention - Stopping XSS in your web
application
OWASP Cheat Sheet: DOM based XSS Prevention
OWASP Cheat Sheet: Injection Prevention
Tools
OWASP Java Encoder Project
AntiXSSEncoder
Zend\Escaper - examples of contextual encoding
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons Attribution- 18
ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons Attribution- 19
ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
Description
Input validation is a programming technique that ensures only properly
formatted data may enter a software system component.
Whitelisting vs Blacklisting
There are two general approaches to performing input syntax validation,
commonly known as blacklisting and whitelisting:
Blacklisting or blacklist validation attempts to check that given data
does not contain “known bad” content. For example, a web
application may block input that contains the exact text <SCRIPT>
in order to help prevent XSS. However, this defense could be evaded
with a lower case script tag or a script tag of mixed case.
Whitelisting or whitelist validation attempts to check that a given
data matches a set of “known good” rules. For example a whitelist
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons Attribution- 20
ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
Regular Expressions
Regular expressions offer a way to check whether data matches a specific
pattern. Let’s start with a basic example.
The following regular expression is used to define a whitelist rule to
validate usernames.
^[a-z0-9_]{3,16}$
This regular expression allows only lowercase letters, numbers and the
underscore character. The username is also restricted to a length of 3 and
16 characters.
Caution: Potential for Denial of Service
Care should be exercised when creating regular expressions. Poorly
designed expressions may result in potential denial of service conditions
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons Attribution- 21
ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
(aka ReDoS). Various tools can test to verify that regular expressions are
not vulnerable to ReDoS.
Caution: Complexity
Regular expressions are just one way to accomplish validation. Regular
expressions can be difficult to maintain or understand for some
developers. Other validation alternatives involve writing validation
methods programmatically which can be easier to maintain for some
developers.
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons Attribution- 22
ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons Attribution- 23
ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons Attribution- 24
ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
Vulnerabilities Prevented
Input validation reduces the attack surface of applications and can
sometimes make attacks more difficult against an application.
Input validation is a technique that provides security to certain forms
of data, specific to certain attacks and cannot be reliably applied as
a general security rule.
Input validation should not be used as the primary method of
preventing XSS, SQL Injection and other attacks.
References
OWASP Cheat Sheet: Input Validation
OWASP Cheat Sheet: iOS - Security Decisions via Untrusted Inputs
OWASP Testing Guide: Testing for Input Validation
Tools
OWASP Java HTML Sanitizer Project
Java JSR-303/JSR-349 Bean Validation
Java Hibernate Validator
JEP-290 Filter Incoming Serialization Data
Apache Commons Validator
PHP’s filter functions
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons Attribution- 25
ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
Description
Digital Identity is the unique representation of a user (or other subject) as
they engage in an online transaction. Authentication is the process of verifying
that an individual or entity is who they claim to be. Session management is a
process by which a server maintains the state of the users authentication
so that the user may continue to use the system without re-authenticating.
The NIST Special Publication 800-63B: Digital Identity Guidelines (Authentication and
Lifecycle Management provides solid guidance on implementing digital identity,
authentication and session management controls.
Below are some recommendations for secure implementation.
Authentication Levels
NIST 800-63b describes three levels of a authentication assurance called a
authentication assurance level (AAL). AAL level 1 is reserved for lower-risk
applications that do not contain PII or other private data. At AAL level 1
only single-factor authentication is required, typically through the use of a
password.
Level 1 : Passwords
Passwords are really really important. We need policy, we need to store
them securely, we need to sometimes allow users to reset them.
Password Requirements
Passwords should comply with the following requirements at the very
least:
be at least 8 characters in length if multi-factor authentication (MFA)
and other controls are also used. If MFA is not possible, this should
be increased to at least 10 characters
all printing ASCII characters as well as the space character should be
acceptable in memorized secrets
encourage the use of long passwords and passphrases
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons Attribution- 26
ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons Attribution- 27
ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
Please see the OWASP Password Storage Cheat Sheet for further details.
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons Attribution- 28
ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
Session Management
Once the initial successful user authentication has taken place, an
application may choose to track and maintain this authentication state for
a limited amount of time. This will allow the user to continue using the
application without having to keep re-authentication with each request.
Tracking of this user state is called Session Management.
Browser Cookies
Browser cookies are a common method for web application to store
session identifiers for web applications implementing standard session
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons Attribution- 29
ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
Tokens
Server-side sessions can be limiting for some forms of authentication.
"Stateless services" allow for client side management of session data for
performance purposes so they server has less of a burden to store and
verify user session. These "stateless" applications generate a short-lived
access token which can be used to authenticate a client request without
sending the user's credentials after the initial authentication.
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons Attribution- 30
ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
This approach is both stateless and portable in the way that client and
server technologies can be different yet still interact.
Caution
Digital identity, authentication and session management are very big
topics. We're scratching the surface of the topic of Digital Identity here.
Ensure that your most capable engineering talent is responsible for
maintaining the complexity involved with most Identity solutions.
Vulnerabilities Prevented
OWASP Top 10 2017 A2- Broken Authentication and Session
Management
OWASP Mobile Top 10 2014-M5- Poor Authorization and
Authentication
References
OWASP Cheat Sheet: Authentication
OWASP Cheat Sheet: Password Storage
OWASP Cheat Sheet: Forgot Password
OWASP Cheat Sheet: Choosing and Using Security Questions
OWASP Cheat Sheet: Session Management
OWASP Cheat Sheet: IOS Developer
OWASP Testing Guide: Testing for Authentication
NIST Special Publication 800-63 Revision 3 - Digital Identity
Guidelines
Tools
Daniel Miessler: Most commonly found passwords
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons Attribution- 31
ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
Description
Access Control (or Authorization) is the process of granting or denying
specific requests from a user, program, or process. Access control also
involves the act of granting and revoking those privileges.
It should be noted that authorization (verifying access to specific features
or resources) is not equivalent to authentication (verifying identity).
Access Control functionality often spans many areas of software
depending on the complexity of the access control system. For example,
managing access control metadata or building caching for scalability
purposes are often additional components in an access control system
that need to be built or managed.
There are several different types of access control design that should be
considered.
● Discretionary Access Control (DAC) is a means of restricting access
to objects (e.g., files, data entities) based on the identity and need-
to-know of subjects (e.g., users, processes) and/or groups to which
the object belongs.
● Mandatory Access Control (MAC) is a means of restricting access to
system resources based on the sensitivity (as represented by a
label) of the information contained in the system resource and the
formal authorization (i.e., clearance) of users to access information
of such sensitivity.
● Role Based Access Control (RBAC) is a model for controlling access
to resources where permitted actions on resources are identified
with roles rather than with individual subject identities.
● Attribute Based Access Control (ABAC) will grant or deny user
requests based on arbitrary attributes of the user and arbitrary
attributes of the object, and environment conditions that may be
globally recognized and more relevant to the policies at hand.
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons 32
Attribution-ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons 33
Attribution-ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
3) Deny by Default
Deny by default is the principle that if a request is not specifically allowed,
it is denied. There are many ways that this rule will manifest in application
code. Some examples of these are:
1. Application code may throw an error or exception while processing
access control requests. In these cases access control should always
be denied.
2. When an administrator creates a new user or a user registers for a
new account, that account should have minimal or no access by
default until that access is configured.
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons 34
Attribution-ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
if (user.hasAccess("DELETE_ACCOUNT")) {
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons 35
Attribution-ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
deleteAccount();
Vulnerabilities Prevented
● OWASP Top 10 2017-A5-Broken Access Control
● OWASP Mobile Top 10 2014-M5 Poor Authorization and
Authentication
References
● OWASP Cheat Sheet: Access Control
● OWASP Cheat Sheet: iOS Developer - Poor Authorization and
Authentication
● OWASP Testing Guide: Testing for Authorization
Tools
● OWASP ZAP with the optional Access Control Testing add-on
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons 36
Attribution-ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
Description
Sensitive data such as passwords, credit card numbers, health records,
personal information and business secrets require extra protection,
particularly if that data falls under privacy laws (EU's General Data
Protection Regulation GDPR), financial data protection rules such as PCI
Data Security Standard (PCI DSS) or other regulations.
Attackers can steal data from web and webservice applications in a
number of ways. For example, if sensitive information in sent over the
internet without communications security, then an attacker on a shared
wireless connection could see and steal another user’s data. Also, an
attacker could use SQL Injection to steal passwords and other credentials
from an applications database and expose that information to the public.
Data Classification
It's critical to classify data in your system and determine which level of
sensitivity each piece of data belongs to. Each data category can then be
mapped to protection rules necessary for each level of sensitivity. For
example, public marketing information that is not sensitive may be
categorized as public data which is ok to place on the public website.
Credit card numbers may be classified as private user data which may
need to be encrypted while stored or in transit.
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons 37
Attribution-ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons 38
Attribution-ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
Key Lifecycle
Secret keys are used in applications number of sensitive functions. For
example, secret keys can be used to to sign JWTs, protect credit cards,
provide various forms of authentication as well as facilitation other
sensitive security features. In managing keys, a number of rules should be
followed including:
● Ensure that any secret key is protected from unauthorized access
● Store keys in a proper secrets vault as described below
● Use independent keys when multiple keys are required
● Build support for changing algorithms and keys when needed
● Build application features to handle a key rotation
Vulnerabilities Prevented
● OWASP Top 10 2017 - A3: Sensitive Data Exposure
● OWASP Mobile Top 10 2014-M2 Insecure Data Storage
References
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons 39
Attribution-ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
Tools
● SSLyze - SSL configuration scanning library and CLI tool
● SSLLabs - Free service for scanning and checking TLS/SSL
configuration
● OWASP O-Saft TLS Tool - TLS connection testing tool
● GitRob - Command line tool to find sensitive information in publicly
available files on GitHub
● TruffleHog - Searches for secrets accidentally committed
● KeyWhiz - Secrets manager
● Hashicorp Vault - Secrets manager
● Amazon KMS - Manage keys on Amazon AWS
Description
Logging is a concept that most developers already use for debugging and
diagnostic purposes. Security logging is an equally basic concept: to log
security information during the runtime operation of an application.
Monitoring is the live review of application and security logs using various
forms of automation. The same tools and patterns can be used for
operations, debugging and security purposes.
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons 40
Attribution-ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons 41
Attribution-ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons 42
Attribution-ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
References
OWASP AppSensor Detection Points - Detection points used to
identify a malicious user probing for vulnerabilities or weaknesses in
application.
OWASP Log injection
OWASP Log forging
OWASP Cheat Sheet: Logging How to properly implement logging in
an application
OWASP Development Guide: Logging
OWASP Code Review Guide: Reviewing Code for Logging Issues
Tools
OWASP Security Logging Project
Apache Logging Services
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons 43
Attribution-ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
Description
Exception handling is a programming concept that allows an application to
respond to different error states (like network down, or database
connection failed, etc) in various ways. Handling exceptions and errors
correctly is critical to making your code reliable and secure.
Error and exception handling occurs in all areas of an application including
critical business logic as well as security features and framework code.
Error handling is also important from an intrusion detection perspective.
Certain attacks against your application may trigger errors which can help
detect attacks in progress.
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons 44
Attribution-ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
Positive Advice
Manage exceptions in a centralized manner to avoid duplicated
try/catch blocks in the code. Ensure that all unexpected behavior is
correctly handled inside the application.
Ensure that error messages displayed to users do not leak critical
data, but are still verbose enough to enable the proper user
response.
Ensure that exceptions are logged in a way that gives enough
information for support, QA, forensics or incident response teams to
understand the problem.
Carefully test and verify error handling code.
References
OWASP Code Review Guide: Error Handling
OWASP Testing Guide: Testing for Error Handling
OWASP Improper Error Handling
CWE 209: Information Exposure Through an Error Message
CWE 391: Unchecked Error Condition
Tools
Error Prone - A static analysis tool from Google to catch common
mistakes in error handling for Java developers
One of the most famous automated tools for finding errors at
runtime is Netflix's Chaos Monkey, which intentionally disables
system instances to ensure that the overall service will recover
correctly.
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons 45
Attribution-ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
Final word
This document should be seen as a starting point rather than a
comprehensive set of techniques and practices. We want to again
emphasize that this document is intended to provide initial awareness
around building secure software.
Good next steps to help build an application security program include:
1) To understand some of the risks in web application security please
review the OWASP Top Ten and the OWASP Mobile Top Ten.
2) Per Proactive Control #1, a secure development program should
include a comprehensive list of security requirements based on a
standard such as the OWASP (Web) ASVS and the OWASP (Mobile)
MASVS.
3) To understand the core building blocks of a secure software
program from a more macro point of view please review the OWASP
OpenSAMM project.
If you have any questions for the project leadership team please sign up
for our mailing list at
https://lists.owasp.org/mailman/listinfo/owasp_proactive_controls.
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons 46
Attribution-ShareAlike 3.0 license.
OWASP Top Ten Proactive Controls Project
v 3.0 © 2002-2018 OWASP Foundation This document is licensed under the Creative Commons 47
Attribution-ShareAlike 3.0 license.