Web-Based Attacks and the OWASP Top 10, Explained
If you are reading this, you have probably heard "OWASP Top 10" in every web security course or job description and you want to know what it actually contains, how the ten items relate to real attacks, and what to learn first.
By the end you will be able to explain why web applications are attacked, say what the OWASP Top 10 is (and what it is not), name all ten categories in the 2025 edition with an example and the main defence for each, see how they changed from 2021, and know which posts in this series go deeper on the attacks you will meet most. It follows Computer and Networking Basics, which explains HTTP, cookies and how a browser talks to a server.
1. Why web applications are attacked
A web application is a program that anyone on the internet can talk to. That is the point of it, and also the problem.
Every time you use a site, your browser sends a request (a URL, parameters, headers, cookies, sometimes a body or a file) and the server sends back a response. The server cannot see the person or the browser. It only sees the request. And a request can be built by any program, not only a browser: a security tester, a script or an attacker can send exactly the bytes they like.
That leads to the one rule behind almost every web vulnerability:
Everything that arrives from the client is untrusted. The server must check it, every time.
Web vulnerabilities appear when a developer assumes something the attacker does not have to obey. Examples of such assumptions:
| The assumption | What an attacker does instead |
|---|---|
| "Users will only enter a name in this box" | Enter text that the database treats as a command |
| "Users will only click the buttons we show" | Request a page or action that has no button |
| "The ID in the URL is always the user's own" | Change the number to someone else's |
| "This setting is only changed from our form" | Send the request from another site, using the victim's logged-in browser |
| "Our server only fetches URLs that users give it for good reasons" | Give it an internal address |
The attacker's input can arrive anywhere: the URL path, the query string, form fields, JSON in the body, cookies, request headers, uploaded files, even the file names.
2. What OWASP and the Top 10 are
OWASP is the Open Web Application Security Project, a nonprofit foundation that, in its own words, improves software security through open-source projects, global communities and education. Everything it publishes is free.
The OWASP Top 10 is its best-known document: a list of the ten most critical categories of web application security risk. The current edition is the OWASP Top 10:2025. According to OWASP, it is built from real vulnerability data (about 175,000 CVE records mapped to weakness types, up from about 125,000 for the 2021 edition) combined with a survey of the security community.
Three things to understand about it:
- It is an awareness document. It tells developers and organizations which kinds of problems matter most. It is not a complete checklist: an application can avoid all ten and still be vulnerable.
- The items are categories, not single bugs. "Injection" covers many attacks; "Broken Access Control" covers many mistakes. Each category groups a family of weaknesses (listed as CWEs, the standard numbered catalogue of weakness types).
- It is not a standard you can "comply" with. For a real checklist, OWASP offers the Application Security Verification Standard (ASVS), a standard of security requirements that can be used to test an application and as a list of requirements for developers. The Top 10 is where you start; ASVS is where you go next.
3. The OWASP Top 10:2025
| ID | Category | In one line |
|---|---|---|
| A01:2025 | Broken Access Control | Users can do or see things they should not be allowed to. Includes server-side request forgery |
| A02:2025 | Security Misconfiguration | A system, application or cloud service is set up insecurely |
| A03:2025 | Software Supply Chain Failures | A breakdown or compromise in how software is built, distributed or updated, often through third-party dependencies |
| A04:2025 | Cryptographic Failures | No cryptography where it is needed, weak cryptography, or leaked keys |
| A05:2025 | Injection | Untrusted input is sent to an interpreter, which runs it as commands |
| A06:2025 | Insecure Design | Flaws in the design itself, not just in how it was coded |
| A07:2025 | Authentication Failures | The system accepts someone who is not who they claim to be |
| A08:2025 | Software or Data Integrity Failures | Untrusted code or data is treated as trusted |
| A09:2025 | Security Logging and Alerting Failures | Attacks are not recorded, noticed or acted on |
| A10:2025 | Mishandling of Exceptional Conditions | The program fails badly when something unusual happens |
The order reflects OWASP's ranking of the categories in this edition. The sections below go through each one.
4. The ten categories, one by one
A01: Broken Access Control
What it is. Access control decides who may do what. It is broken when the application does not enforce those rules on the server, so users can act outside their permissions. OWASP's description of the result: unauthorized disclosure, modification or destruction of data, or a business function performed outside the user's limits.
Examples (from OWASP). Changing an account number in a URL such as …/accountInfo?acct=notmyacct to see someone else's account; requesting an admin page directly because the app only hid the link; getting around a restriction that only existed in the browser by calling the backend directly with a tool like curl.
Defence. Deny by default for anything that is not public, build the checks once and reuse them everywhere, and check that the record belongs to the user on every request.
Note for 2025. Server-side request forgery (SSRF), a separate item in 2021, is now inside this category. OWASP's list of weakness types mapped to A01:2025 also includes path traversal, cross-site request forgery and open redirect.
Deep dives: Broken Access Control, Server-Side Request Forgery, and the escalation view in Privilege Escalation.
A02: Security Misconfiguration
What it is. A system, application or cloud service is set up incorrectly from a security point of view. Typical forms: default accounts and passwords left on, directory listings turned on, unnecessary services running, detailed error messages shown to visitors, storage buckets open to the world.
Defence (OWASP). A repeatable hardening process so every environment is locked down the same way; a minimal platform with no unneeded features, components, documentation or samples; and an automated process to verify the settings in every environment.
A03: Software Supply Chain Failures
What it is. New in 2025 as a wider version of the old "vulnerable and outdated components" item. It covers breakdowns or compromises anywhere in how software is built, distributed or updated, often through third-party dependencies: a vulnerable library, a malicious package, a poisoned build system, a hijacked update. See Typosquatting for one way a malicious package reaches a project.
Defence (OWASP). Keep an inventory of the components you use and their dependencies; watch sources such as the CVE list, the National Vulnerability Database and the Open Source Vulnerabilities database for problems in them; and harden the systems that build and distribute your code, including multi-factor authentication on your code repository and not committing secrets.
A04: Cryptographic Failures
What it is. The lack of cryptography where it is needed, cryptography that is too weak, leaked keys, and related mistakes. Examples: passwords stored in plain text or with a fast, unsalted hash; data sent over plain HTTP; hard-coded keys in the source code.
Defence (OWASP). Classify your data and know which is sensitive; encrypt data in transit with TLS 1.2 or later, using forward-secrecy ciphers (see Handshakes); and store passwords with strong, adaptive, salted hashing such as Argon2, scrypt or PBKDF2.
A05: Injection
What it is. OWASP's definition: an injection flaw lets untrusted input be sent to an interpreter, which then executes parts of it as commands. The interpreter might be a SQL database, an operating system shell, an LDAP directory, an expression-language engine or the browser's HTML and JavaScript engine. OWASP's category includes SQL, NoSQL, OS command, ORM, LDAP and expression-language injection, and also cross-site scripting (XSS).
Defence. Use a safe API that keeps data and commands separate (for example parameterized queries), validate input on the server with an allowlist, and encode output for the place where it is used. OWASP notes that escaping special characters is error-prone and not robust, so it is the fallback, not the first choice.
Deep dives: SQL Injection and Cross-Site Scripting.
A06: Insecure Design
What it is. Flaws in the design and architecture, as opposed to coding slips. OWASP's distinction: a secure design can still have coding defects, but an insecure design cannot be fixed by a perfect implementation, because the security controls were never created. Its examples include account recovery by security questions (more than one person can know the answers), a cinema booking flow that let attackers reserve hundreds of seats at once, and a shop with no protection against bots buying up stock.
Defence (OWASP). Use a secure development lifecycle with security professionals involved, use threat modelling for critical areas such as authentication, access control, business logic and key flows, and build security requirements into user stories.
A07: Authentication Failures
What it is. The attacker gets the system to treat an invalid or incorrect user as legitimate. Allowing credential stuffing and brute force, accepting default or weak passwords, weak password-recovery flows (such as knowledge-based answers), session IDs exposed in the URL or reused after login, and sessions that are not invalidated at logout all belong here. See Brute Force vs Password Spraying.
Defence (OWASP). Multi-factor authentication where possible; checking new passwords against a list of the worst common passwords; and a server-side, built-in session manager that creates a new random, high-entropy session ID after login.
Renamed in 2025 from "Identification and Authentication Failures".
A08: Software or Data Integrity Failures
What it is. The application trusts code or data that it should have verified: updates downloaded without checking a signature, a build pipeline anyone can alter, or serialized objects accepted from users without any integrity check (insecure deserialization, which can sometimes lead to remote code execution).
Defence (OWASP). Use digital signatures or similar mechanisms to verify that software and data come from the expected source and were not altered; protect the build and deployment pipeline with proper separation and access control; do not accept unsigned or unencrypted serialized data from untrusted clients without an integrity check.
A09: Security Logging and Alerting Failures
What it is. Without logging and monitoring, attacks cannot be detected, and without alerting, a quick response is very hard. This category does not cause the first break-in, but it decides whether anyone notices it.
Defence (OWASP). Log logins, access control failures and input validation failures with enough context to identify suspicious accounts; encode log data correctly so logs cannot be used to attack the logging system; and set up monitoring and alerting with playbooks so suspicious activity is acted on quickly. See also False Positives and False Negatives for why alert quality matters.
Renamed in 2025 from "Security Logging and Monitoring Failures", stressing alerting.
A10: Mishandling of Exceptional Conditions
What it is. New in 2025. The program does not prevent, detect or respond properly to unusual situations, which leads to crashes, unexpected behaviour and vulnerabilities. Examples: an error that reveals internal details, a check that is skipped when an exception is thrown (the code "fails open"), or a transaction that stops half way and leaves data inconsistent.
Defence (OWASP). Handle errors where they happen and recover meaningfully; if a transaction fails part-way, roll the whole thing back and fail closed; and add rate limiting, quotas and throttling so unusual load cannot knock the system over.
5. What changed since 2021
| 2021 | 2025 | Change |
|---|---|---|
| A01 Broken Access Control | A01 Broken Access Control | Stays first; SSRF is rolled into it |
| A02 Cryptographic Failures | A04 Cryptographic Failures | Moves down |
| A03 Injection | A05 Injection | Moves down |
| A04 Insecure Design | A06 Insecure Design | Moves down |
| A05 Security Misconfiguration | A02 Security Misconfiguration | Moves up to second |
| A06 Vulnerable and Outdated Components | A03 Software Supply Chain Failures | Broadened to the whole supply chain |
| A07 Identification and Authentication Failures | A07 Authentication Failures | Renamed |
| A08 Software and Data Integrity Failures | A08 Software or Data Integrity Failures | Same topic |
| A09 Security Logging and Monitoring Failures | A09 Security Logging and Alerting Failures | Renamed |
| A10 Server-Side Request Forgery | A10 Mishandling of Exceptional Conditions | SSRF merged into A01; a new category takes the slot |
The big theme: more attention to how software is built and delivered (supply chain) and to how software behaves when things go wrong (exceptional conditions), and less separate attention to individual attack names.
6. Attacks you will meet that are not a Top 10 item by name
The Top 10 groups risks, so many famous attack names sit inside a category. OWASP publishes, for each category, the list of weakness types (CWEs) mapped to it. Using those lists for 2025:
| Attack | What it is | Where OWASP maps it |
|---|---|---|
| Cross-site scripting (XSS) | Attacker's script runs in a victim's browser on a trusted site | A05 Injection (CWE-79) |
| SQL injection | Input changes the meaning of a database command | A05 Injection (CWE-89) |
| Cross-site request forgery (CSRF) | Tricks a logged-in browser into sending an unwanted request | A01 Broken Access Control (CWE-352). See CSRF |
| Path traversal | Using sequences like ../ to read files outside the intended folder |
A01 Broken Access Control (CWE-22) |
| Open redirect | A site sends visitors to a URL an attacker chose. Often used to make phishing links look trustworthy | A01 Broken Access Control (CWE-601) |
| Server-side request forgery (SSRF) | Makes a server send requests the attacker chose | A01 Broken Access Control (CWE-918) |
| XML external entity (XXE) | An XML parser fetches files or addresses named inside the data | A02 Security Misconfiguration (CWE-611) |
| Clickjacking | A hidden frame makes the victim click something they cannot see | A06 Insecure Design (CWE-1021, improper restriction of rendered UI layers or frames) |
| Unrestricted file upload | Uploading a file of a dangerous type that the server then runs or serves unsafely | A06 Insecure Design (CWE-434) |
Treat this as a map, not a rule: the same real-world bug can be described in more than one way, and OWASP maps weakness types, not individual incidents.
7. Where to go next in this series
| Post | What it covers |
|---|---|
| SQL Injection | How user input becomes part of a database command, and the fix |
| Cross-Site Scripting | Reflected, stored and DOM-based XSS, and output encoding |
| Broken Access Control | IDOR, forced browsing and missing server-side checks |
| Cross-Site Request Forgery | Why browsers attach cookies automatically, and the defences |
| Server-Side Request Forgery | Making a server fetch what it should not, including cloud metadata |
8. How to practise, legally
Reading is not enough for this topic. Practise on systems made to be attacked:
| Resource | What it is |
|---|---|
| PortSwigger Web Security Academy | Free, structured lessons and hands-on labs for every topic in this series |
| OWASP Juice Shop | A deliberately insecure web shop you run yourself |
| OWASP WebGoat | A deliberately insecure application with guided lessons |
| OWASP Web Security Testing Guide | How testers examine an application step by step (see also Security Testing) |
Running Juice Shop or WebGoat on your own computer. Both projects document how to run them in Docker, which is available for Mac, Windows and Linux from docs.docker.com. Use the commands in each project's README, which publish the port on 127.0.0.1 only, so that only your own computer can reach the lab:
docker run --rm -p 127.0.0.1:3000:3000 bkimminich/juice-shop # then browse to http://localhost:3000
docker run -it -p 127.0.0.1:8080:8080 -p 127.0.0.1:9090:9090 webgoat/webgoat
Treat these as dangerous programs. WebGoat's README warns that "while running this program your machine will be extremely vulnerable to attack. You should disconnect from the Internet while using this program", and says its default configuration binds to localhost to minimize the exposure. Never put a deliberately vulnerable lab on a public server.
The rule: test only applications you own, labs built for the purpose, or systems where you have written permission. Testing someone else's site without permission can be a crime, even if you only "look around".
9. Common mistakes
| Myth | The facts |
|---|---|
| "If I fix the Top 10, my app is secure" | It is an awareness list, not a complete standard. Use ASVS for a real checklist |
| "The Top 10 is a list of ten bugs" | It is ten categories, each holding many weaknesses |
| "A firewall or WAF solves these" | A web application firewall can block some attacks, but it does not fix the flaw underneath |
| "Client-side checks are enough" | Anything checked only in the browser can be bypassed by sending the request directly |
| "Hiding the link hides the page" | If the server does not check access, anyone who finds the address can use it |
| "HTTPS makes the site safe" | HTTPS protects the connection. It does not stop injection, broken access control or any of the other flaws |
| "Scanners find everything" | Automated tools find many issues but miss business-logic and design flaws that need a human to think |
Closing
Web applications must accept requests from anyone, so every input is untrusted and every action needs a server-side check. The OWASP Top 10 groups the most common ways that goes wrong into ten categories. In the 2025 edition, broken access control is still first, injection includes cross-site scripting, and two new categories reflect modern risks: the software supply chain and the mishandling of exceptional conditions.
Keep these points:
- Never trust the client. Validate and authorize on the server, every time.
- The Top 10 is a starting point, made of categories, not a full checklist.
- A01 Broken Access Control is first and now includes SSRF.
- Injection (A05) includes SQL injection and XSS; the fix is to keep data separate from commands.
- Supply chain and exceptional conditions are the new additions in 2025.
- Practise only where you have permission.