Why this matters
The OWASP Top 10 is not a law or a secret checklist; it is a shared language. When developers, testers, and managers all refer to the same ten categories, they can discuss risk without talking past each other. The list is assembled from real-world data by a broad community, and it gets refreshed as the web changes. Learning it gives you a mental inventory of the ways applications most often get hurt, which is exactly what you need in order to build and evaluate defenses.
The reason to study these risks defensively is simple: you cannot protect against a problem you cannot name. Broken access control, injection, and misconfiguration sound abstract until you see them as everyday mistakes, such as forgetting to check whether a user may view a record, building a query from raw input, or leaving a debug feature enabled in production. Once you recognize the shapes, you can spot them in code reviews, in design discussions, and in the behavior of services you use. The goal here is recognition and defense, not reproduction.
A note on scope matters before we begin. Every mention of a risk in this lesson is framed so you understand it well enough to defend against it. Any hands-on verification you do must stay on your own machine, a local lab, or a system you own or are explicitly authorized to test. Understanding how a flaw works is legitimate and useful; exercising it against systems that are not yours is not. Keep that boundary firm, and this knowledge becomes a tool for building safer software rather than a source of trouble.
The big picture
Think of a web application as a building with several layers of security. There is the front door where users identify themselves, internal walls that separate rooms, a filing system for data, and a maintenance crew that keeps everything patched and watched. The OWASP categories are really just the ten most common ways those layers fail: a door left open, a wall with a hole, a filing clerk tricked into fetching the wrong file, or a maintenance crew that never checks for broken parts.
Several categories cluster naturally. Broken access control and authentication failures are about who is allowed in. Cryptographic failures are about protecting secrets once inside. Injection, insecure design, and security misconfiguration are about flaws in how the application is built and set up. Vulnerable components and integrity failures are about trusting code and data from elsewhere. Logging failures and server-side request forgery round out the picture with blind spots and a server tricked into making unintended requests.
The most useful habit is to ask three questions for every category: what is it, how do we defend, and how do we verify safely. Defense usually means a combination of good design, careful coding, and configuration discipline rather than one magic tool. Verification means checking your own work through code review, tests in a local lab, and reading documentation, always within systems you control. Keep repeating those three questions and the list turns from memorized trivia into a working method.
Core ideas
Broken access control
Access control decides what an authenticated user is allowed to do. It fails when the application assumes that being logged in is enough and forgets to check whether this particular user may view or change this particular record. The result is that one user can reach another user's data by asking for the right identifier. This is consistently one of the most common and most damaging web risks, because it exposes private information without needing any clever technical trick.
Defend it by enforcing permissions on the server for every request, not just in the interface. Default to denying access, then grant narrowly based on the owner of the resource and the user's role. Centralize the checks so they cannot be forgotten, and write tests that confirm one account cannot read another's data. Verify safely by using two accounts you control in your own local test environment and confirming that each sees only its own records.
For each request:
identify the signed-in user
load the requested record
check: does this user own or may they view it?
if not: return 403 and log the denial
if yes: return only the permitted fields
Watch out. Mistake: hiding a button in the interface instead of checking permission on the server. Fix: enforce authorization on every request regardless of what the UI shows.
Cryptographic failures
This category covers the many ways protection fails in practice: sensitive data sent without encryption, passwords stored with weak or plain hashing, keys exposed in code, or random values that can be predicted. The algorithm itself is rarely the problem; the problem is using the right tool in the wrong way. A site can advertise encryption while still storing recovery codes in plain text or generating tokens from a simple counter.
Defend it by classifying data and applying appropriate protection: encrypt sensitive information in transit and at rest, use Argon2id or bcrypt for passwords, generate secrets with a secure random source, and keep keys out of repositories. Retire weak protocols and ciphers. Verify safely by reviewing how your own test app stores secrets and by inspecting its headers and configuration in a local environment, never by probing services you do not own.
Watch out. Mistake: treating the presence of HTTPS as proof that all data is protected everywhere. Fix: audit storage, tokens, and backups separately from the transport layer.
Injection
Injection happens when untrusted input is treated as part of a command rather than as data. The classic case is a database query assembled by stitching user text into a string, so that input meant to be a name is interpreted as instructions. The same idea applies to other interpreters, such as operating-system commands or template engines. The danger is that the application and the attacker disagree about where data ends and code begins.
Defend it by keeping code and data separate. Use parameterized queries and prepared statements so input is always bound as a value, never concatenated into a command. Validate input against an allow-list where possible, apply the least-privileged database account, and use an object-relational mapper carefully rather than assuming it makes injection disappear. Verify safely by writing local tests that submit unusual characters to your own app and confirming they are handled as plain data, not executed.
unsafe: query = "SELECT * FROM users WHERE name = '" + input + "'"
safe: query = "SELECT * FROM users WHERE name = ?"
database.execute(query, [input])
Input is bound as a value, so it cannot become a command
Watch out. Mistake: trying to sanitize input by stripping suspicious characters. Fix: use parameterized queries, which separate code from data by design.
Insecure design
Insecure design means the blueprint itself has a flaw that no amount of clean coding can fix. Examples include password reset flows that rely on information an attacker can guess, workflows with no rate limits, or business logic that lets a discount be applied repeatedly. Unlike a simple bug, this is a missing or weak control that should have been part of the plan from the start.
Defend it by thinking about abuse cases during design, not only happy paths. Use threat modeling to ask what could go wrong if a user behaves oddly, add rate limits and step-up checks where trust changes, and document security requirements alongside features. Verify safely by walking through your own design on paper and asking where assumptions could be violated, then adding tests in your local lab for those scenarios.
Watch out. Mistake: bolting security on after launch and expecting it to fix a flawed workflow. Fix: include abuse cases and trust assumptions in design reviews from the beginning.
Security misconfiguration
Misconfiguration is the broad category of settings left unsafe: default accounts still active, verbose error messages shown to users, directory listings enabled, unnecessary services running, or security headers missing. Cloud storage buckets and admin panels are common examples. These issues are attractive because they often need no sophisticated technique; they are simply doors that were never closed after installation or deployment.
Defend it with a repeatable hardened baseline, automated configuration checks, and a process for applying updates. Turn off anything not needed, remove default credentials, hide detailed errors from users while logging them privately, and set security headers consistently across environments. Verify safely by reviewing configuration files in your own projects and using local checklists, staying strictly within systems you own or are authorized to examine.
Watch out. Mistake: applying secure settings only in production while development and staging stay lax. Fix: keep environments consistent so a tested configuration is the one that actually ships.
Vulnerable components
Modern applications are assembled from libraries, frameworks, and dependencies, and those components age. A vulnerable component is an outdated or unpatched piece with a known weakness that attackers can recognize quickly because the same code is used everywhere. The risk is amplified by nested dependencies you may not even know you have, which is why a thorough inventory matters as much as patching itself.
Defend it by maintaining a software inventory, tracking advisories, and applying updates promptly through a tested process. Remove dependencies you no longer use, pin versions so changes are deliberate, and use automated tooling to flag known vulnerable packages. Verify safely by reviewing your own project's dependency list and updating it in a local branch, then running your tests to confirm nothing breaks.
Watch out. Mistake: installing a dependency and never revisiting it. Fix: schedule regular dependency reviews and treat update alerts as actionable work.
Identification failures
This category covers weaknesses in proving who a user is: weak password policies, credential reuse, sessions that never expire, identifiers exposed in URLs, and missing multi-factor authentication. When identity is easy to fake or steal, every other control that depends on identity becomes unreliable. It is closely related to access control, but the focus here is on the strength of the proof rather than the permission decision that follows.
Defend it by supporting strong unique passwords, offering multi-factor authentication, protecting session cookies with secure flags, and rotating or invalidating sessions after sensitive changes. Add careful rate limiting to login and recovery flows, and avoid exposing sequential identifiers. Verify safely by checking your own test app's session settings and confirming that sessions expire and that protected actions require recent authentication.
Session cookie: HttpOnly, Secure, SameSite
Login attempts: rate limited
Recovery: time-limited single-use tokens
Sensitive change: require recent re-authentication
MFA: offered by default
Watch out. Mistake: relying only on a password when a stronger second factor is available. Fix: offer multi-factor authentication and protect the recovery path as carefully as login.
Integrity, logging, SSRF
Three categories deserve a shared look. Software and data integrity failures mean trusting code or data from somewhere without verifying it, such as accepting an unsigned update or loading a dependency from an untrusted source. Logging and monitoring failures mean not recording enough to detect or investigate a problem, so unusual behavior passes unnoticed. Server-side request forgery, or SSRF, happens when a server is tricked into making a request to an unintended location using attacker-influenced input.
Defend integrity by verifying signatures, using trusted sources, and protecting build pipelines. Defend logging by recording meaningful security events with useful context while never writing secrets, and by making sure someone actually reviews the signals. Defend against SSRF by allow-listing destination hosts, blocking private network ranges, and avoiding the return of raw remote responses to users. Verify all three safely in your own lab: check an update's signature, review a log file for accidental secrets, and test that your local app refuses unexpected destinations.
Verify: software signatures before install
Log: auth events, denials, changes; never passwords
Alert: repeated failures and unusual patterns
SSRF guard: allow-list hosts, block private ranges
Return: only filtered, expected data to users
Watch out. Mistake: logging everything including tokens and personal data. Fix: log events and identifiers, not secrets, and review what your logs actually contain.
Verifying Defenses Safely
Knowing the ten categories is only half the job; the other half is checking your own work without causing harm. The good news is that most verification is ordinary engineering: reading code, reviewing configuration, writing tests, and inspecting logs. None of it requires touching anyone else's system, and keeping your practice local is both ethical and legally safe.
The mindset is to be your own careful reviewer. For each category, ask what evidence would convince you the defense works. Evidence might be a test that fails when a permission check is removed, a dependency report showing no known vulnerable versions, or a log entry that records a denial without leaking a secret. Concrete evidence beats confidence every time.
Review access rules
Read the authorization checks in your own code and confirm they run on the server for each request. Add a test with two local accounts and assert that neither can see the other's data. This is the highest-value check you can perform.
Inspect data handling
Trace where sensitive values are stored, logged, and transmitted. Confirm passwords are hashed, secrets are kept out of source, and logs omit credentials. A quick search of your own repository for suspicious patterns often reveals accidental exposure.
Check dependencies
List the packages your project uses and look for update notices. Remove unused ones and apply patches in a local branch with tests. Treat this as routine hygiene rather than a one-time cleanup.
Confirm input boundaries
Review places where user input reaches a query, command, or outbound request. Confirm parameterized queries and allow-lists are in place. Local tests with odd characters help prove input is treated as data, not instructions.
Audit configuration
Compare each environment against a hardened baseline. Look for default accounts, verbose errors, and missing headers. Consistency between development and production ensures what you tested is what you ship.
Read your logs
Open a real log from your own app and look for useful security events as well as accidental secrets. A log that records denials and changes without exposing passwords is a sign of a healthy design.
Keep it authorized
Every check above happens on your own machine, your own accounts, or a lab you control. If you ever want to go further, get explicit written permission first. Defensive skill grows fastest in an environment where you are free to experiment responsibly.
Common mistakes here
| Mistake | Fix |
|---|---|
| Memorizing category names without understanding the underlying failure. | For each one, explain in your own words what goes wrong and what prevents it. |
| Testing defenses against systems you do not own. | Build a local lab or use only systems with explicit written authorization. |
| Assuming a single tool addresses a whole category. | Combine design choices, coding practices, configuration, and testing. |
| Treating the list as a complete definition of security. | Use it as a starting framework and add context specific to your application. |
| Skipping verification because the code looks correct. | Write a test or review evidence that the defense actually holds. |
| Logging sensitive data in the name of observability. | Record events and metadata while deliberately excluding secrets. |
The example, line by line
Here is a defensive request trace showing several of the controls working together on an ordinary data view.
| Code | What it does |
|---|---|
11 A request arrives for /api/orders/1234 | The request path is ordinary, so defenses must be automatic rather than dependent on vigilance. |
22 The app first checks that a session exists | Checking for a session establishes whether there is any identity to evaluate at all. |
33 It loads the signed-in user from the session | The server resolves identity from a trusted session, not from a value in the URL. |
44 It verifies this user may view that order | Authentication alone is insufficient; permission for this specific record must be confirmed. |
55 The check uses the record owner, not a guess | Comparing against the actual owner prevents a user from reaching someone else's record. |
66 A missing or failed check returns 403 | Returning a clear denial, rather than an error full of detail, keeps information contained. |
77 The query uses parameters, not string building | Parameterized queries ensure input stays data and cannot alter the command being run. |
88 The response includes only allowed fields | Limiting fields avoids leaking data the user is not supposed to see even in a valid response. |
99 Success and denial are both written to logs | Logging both outcomes supports detection and investigation without exposing secrets. |
1010 Logs omit passwords and full card numbers | Careful log content prevents a useful audit trail from becoming a new liability. |
1111 Rate limits slow repeated login attempts | Rate limits reduce the value of repeated guessing against the identity controls. |
1212 The page renders only after all checks pass | Rendering last means no protected content is produced until every check has succeeded. |
1 A request arrives for /api/orders/1234
2 The app first checks that a session exists
3 It loads the signed-in user from the session
4 It verifies this user may view that order
5 The check uses the record owner, not a guess
6 A missing or failed check returns 403
7 The query uses parameters, not string building
8 The response includes only allowed fields
9 Success and denial are both written to logs
10 Logs omit passwords and full card numbers
11 Rate limits slow repeated login attempts
12 The page renders only after all checks pass
Worked variations
For developers
If you write code, treat the list as a design companion. Reference it during reviews, add tests tied to the categories most relevant to your app, and keep a short checklist in your workflow. The aim is to catch the common mistakes early, when they are cheap to fix, rather than after deployment.
Design: note abuse cases and trust assumptions
Code: parameterized queries, server-side checks
Config: hardened baseline in every environment
Test: two-account access checks in a local lab
Review: dependencies, logs, and secret handling
For users
Even if you never write code, the list explains the headlines you read. A breach involving exposed records is often an access control or misconfiguration story. A compromised update is an integrity story. Knowing the category helps you judge whether a service takes security seriously and what questions to ask before trusting it with your data.
For teams
Organizations use the list to prioritize work and communicate risk. The healthiest approach is to turn each relevant category into an ongoing practice: a review item, a test, or a monitored signal. Treating it as an annual paperwork exercise misses the point; it works best as a living reminder of the failures that matter most.
Common mistakes
| Mistake | Fix |
|---|---|
| Assuming the newest category replaces the older ones. | Treat all categories as a durable checklist and update your practices continuously. |
| Focusing only on the categories that sound technically exciting. | Give access control and misconfiguration the attention they deserve; they cause real harm. |
| Believing a framework eliminates these risks automatically. | Understand which protections the framework provides and which remain your responsibility. |
| Practicing on public systems to see how flaws feel. | Use a local lab or systems you own, and seek explicit authorization otherwise. |
| Skipping logs because nothing seems to go wrong. | Record and review meaningful events so you can detect problems when they do occur. |
| Reading the list once and considering the job done. | Revisit it as your application and its dependencies change. |
Practice
- Pick any three categories and write one sentence each describing what goes wrong and the defense that prevents it, in your own words.
- In a local test app you control, create two accounts and verify that each can see only its own records. Remove a permission check temporarily to see the test fail, then restore it.
- Review a project of yours for sensitive data in logs. Search for patterns like tokens or passwords and confirm none are being recorded.
- List every dependency in a small project and check whether any have available updates. Apply one in a local branch and run the tests.
- Draft a short verification checklist for one category, listing the evidence that would convince you the defense works, using only your own systems.