The OWASP Top 10 is the best-known list of security risks in web applications. It is maintained by OWASP, an open nonprofit community, and it sums up the ten categories of flaws that appear most often and cause the most impact. It is not a standard or a certification. It reflects industry consensus and is a starting point for anyone who develops, tests or commissions software security assessments.
Each of the ten categories in the 2021 edition appears here in defensive terms, with what the risk means and how to mitigate it. The idea is to have a map for prioritizing, not a magic checklist. Going through every item in the Top 10 reduces risk, but it does not replace manual testing of the application, which finds logic flaws no generic list anticipates.
What the OWASP Top 10 is and what it is not
The Top 10 is a list of risk categories. It does not point to specific vulnerabilities: each item groups several related flaws under one theme. The list is revised periodically based on real data from analyzed applications, so it works as a snapshot of where risk tends to concentrate. It also gives development, security and management teams a common language.
What the Top 10 does not offer is a guarantee of complete coverage. An application can clear all ten themes and still have a serious business logic flaw that only shows up when someone analyzes the context (a discount that can be applied twice, for example). That is why the list works best as a basis for awareness and as part of a larger application security program, with code review, automated testing and penetration testing.
Categories one to five
- Broken access control: users can see data or perform actions beyond what they should. It is the most common risk on the list. The defense is to check authorization on the server, deny by default and test access across different user roles.
- Cryptographic failures: sensitive data is exposed because encryption is missing or was used the wrong way. The fix involves encrypting in transit and at rest, using current algorithms and managing keys and secrets carefully.
- Injection: unvalidated input changes the meaning of a query or command, as in SQL injection. To prevent it, use parameterized queries, validate input and prefer safe libraries.
- Insecure design: the flaw originates in the architecture, before implementation. The remedy here is threat modeling, secure design patterns and security requirements from the start of the project.
- Security misconfiguration: exposed services, overly broad permissions and insecure defaults left as they came. Mitigation comes from hardening baselines, configuration review and removing what is not used.
Categories six to ten
- Vulnerable and outdated components: libraries and dependencies with known flaws. To reduce this risk, keep an inventory of dependencies, use software composition analysis and update continuously.
- Identification and authentication failures: poorly protected sessions and credentials. The defenses are a second factor, a sensible password policy, brute-force protection and secure session management.
- Software and data integrity failures: updates and data accepted without anyone verifying where they came from. Signing, integrity checks and care with the software supply chain reduce this risk.
- Security logging and monitoring failures: the attack goes by without leaving a trace or triggering an alert. The answer is relevant, centralized logs and detection use cases.
- Server-side request forgery (SSRF): the server is tricked into accessing internal destinations it should not reach. Mitigation combines destination validation, allowlists and network segmentation.
The order of the categories combines frequency, ease of exploitation and impact. Broken access control leads because it appears in many applications and grants improper access to data and functions. That helps with prioritization: on a first pass, access control, cryptography and injection are usually the areas that deserve the most attention.
Prevention in practice, by risk class
The categories become more concrete when they turn into coding decisions. The following examples are defensive: they show the secure pattern without describing the attack. The idea is for the right choice to become a habit, so the flaw never gets written in the first place.
Injection: parameterized queries
Injection happens when user data gets mixed into the command. The defense is to keep the two apart with parameterized queries, where input is always treated as data and never interpreted as part of the instruction. In code, it looks like this:
# Avoid: building the query by concatenating user input# Prefer: bound parameters, always treated as datacursor.execute( "SELECT id, name FROM users WHERE email = %s", (submitted_email,),)Access control: deny by default
Broken access control usually comes from checking permissions in the wrong place or assuming that hiding a button in the interface is enough. The defense is to verify authorization on the server, on every request: deny by default and allow only what the rule permits. In the example, the document is returned only if it belongs to the person who requested it:
# Does the resource belong to the requester? Always check on the server.def open_document(user, document_id): doc = repository.find(document_id) if doc is None or doc.owner_id != user.id: raise AccessDenied() # deny by default return docSecurity headers and configuration
Part of the misconfiguration problem can be solved with response headers that tell the browser to protect itself. They reduce the surface for attacks such as content injection and misuse of the site inside third-party frames. Note that they are an extra layer: the fix in the code is still necessary. For example:
Content-Security-Policy: default-src 'self'X-Content-Type-Options: nosniffStrict-Transport-Security: max-age=63072000; includeSubDomainsReferrer-Policy: no-referrerHow to use the Top 10 in practice
The Top 10 pays off more when it becomes part of the development cycle than when it only shows up in an isolated audit at the end. It can guide security requirements, code reviews and the configuration of testing tools. When teams know the categories, many flaws are never created, because the secure decision becomes part of the application's design.
- Use the categories as security requirements during development
- Configure SAST, SCA and DAST tools in line with the Top 10
- Prioritize access control, cryptography and injection on a first pass
- Add threat modeling to address insecure design
- Use penetration testing to validate what tools and lists cannot reach
What lies beyond the Top 10
The Top 10 is the entry point. OWASP itself maintains deeper projects for the moment when awareness needs to become a verifiable requirement, and knowing them keeps you from stopping at a list of ten themes.
- ASVS (Application Security Verification Standard): a standard of application security requirements, useful for defining the expected level of rigor and guiding tests
- Cheat Sheets: concise guides on how to implement each defense correctly
- Testing guides: a methodology for assessing applications in a structured way
- API Security Top 10: a list dedicated to risks specific to APIs
The Top 10 tells you where risk tends to be; the ASVS tells you what to require and how to verify it. More mature teams use the list for awareness and the ASVS to turn security into acceptance criteria, which fits well with automated verification in the pipeline.
Practical checklist
- Check authorization on the server for every sensitive action
- Encrypt in transit and at rest with managed keys
- Use parameterized queries and validate input
- Include security requirements in the application design
- Apply a hardening baseline and review configuration
- Inventory dependencies and update vulnerable components
- Protect authentication with a second factor and session management
- Verify the integrity of updates and the software supply chain
- Generate relevant logs and detection use cases
- Validate request destinations to prevent SSRF
- Send security headers in responses to the browser
- Define verifiable security requirements, for example with the ASVS
Best practices
- Use the Top 10 as a risk map, knowing it does not guarantee complete coverage
- Bring the categories into the development cycle from the start
- Prioritize access control, the most common risk on the list
- Combine SAST, SCA and DAST with human review
- Use threat modeling to address insecure design
- Turn the categories into verifiable requirements that go beyond warnings
- Use penetration testing to validate the logic flaws the list does not anticipate
Common mistakes
- Treating the Top 10 as a checklist that guarantees security
- It creates a false sense of coverage while logic flaws remain open.
- Relying only on automated tools
- Authorization and business logic flaws go by without anyone testing them.
- Leaving security for the end of development
- Fixes become expensive and design flaws become hard to reverse.
- Ignoring dependencies and outdated components
- Old libraries leave known vulnerabilities exposed.
- Stopping at the Top 10 and never maturing into requirements
- Security stays at the awareness level and never becomes testable acceptance criteria.
Authorship and review
Cesar Gargiulo
CEO and founder of GUARDIASEC. Technical and editorial lead for the content published in this library.
Published on . Found a technical error? Write to [email protected] and we will correct it and keep a record of the change.