Why web apps break
Attack surface, the OWASP Top 10:2025, and the rules of a legal lab
By the end of this lesson you can
- Describe the parts of a typical web application and point to its attack surface.
- Name the ten OWASP Top 10:2025 categories in order, with their IDs.
- Explain why most web flaws come from trusting input or from a missing check.
- Tell a CWE weakness ID apart from a Top 10 risk category.
- State the legal limits of practicing web attacks and how this course keeps you inside them.
Web applications break for surprisingly ordinary reasons. Nobody sets out to write an insecure order form. A developer under time pressure trusts a value that came from the browser, forgets one permission check on one page, or leaves a debug setting switched on. This course is about catching those ordinary mistakes early, and fixing them in code.
We start with the big picture: what a web application is made of, where an attacker can reach it, and the list that the whole industry uses to talk about the most important risks.
01Lakeside Bakes goes online
Throughout this course we follow a fictional example: Lakeside Bakes, a small bakery. Alice, the owner, wants customers to order cakes online. Sam, the bakery's only developer, works part-time and built the order portal at orders.example.com. Neither of them is a security expert. That is normal, and it is exactly who this course is for.
The portal has five parts, which you will find in almost every web application, large or small:
- The browser. The customer's own software. It shows the pages, runs the JavaScript, stores cookies, and sends requests. It belongs to the user, not to Lakeside, so the bakery controls nothing that happens in it.
- The web server. Sam's Node.js application built with the Express framework. It receives every request, decides what to do, and sends back a response.
- The database. A small SQL database with customers, products, and orders. Only the web server should talk to it.
- The payment provider. An outside company that takes card payments, so Lakeside never stores card numbers itself.
- The image service. An outside service that resizes the cake photos customers upload for custom decorations.
Notice where the arrows meet: almost everything passes through Sam's web server. That makes the server the place where checks belong. It is also why the server is the part attackers care about most.
02The attack surface
The attack surface of an application is every place where someone from outside can send it data or interact with it. For a web application the list is longer than most people expect:
- The URL. The path and the query string, for example
/orders?id=1042. Anyone can type a different number. - Form fields. Names, addresses, the text to pipe onto a cake, quantities, discount codes, including hidden fields the user never sees.
- Headers and cookies. Every request carries headers and cookies, and every one of them can be changed with a single command.
- APIs. Modern pages call the server in the background with JSON data. These endpoints are inputs too, even if no page links to them directly.
- File uploads. A cake photo is a file of the user's choosing, with a name and a type the user also chooses.
- Third-party messages. Replies from the payment provider or the image service arrive at the server and must be checked as carefully as anything else.
Here is the key idea of the whole course: everything on that list is controlled by the person sending it. The browser is a convenient tool, but the server cannot tell whether a request came from a real browser, a script, or someone typing by hand. A drop-down menu that only offers "1 to 5 cakes" does not stop anyone from sending "-3."
When you look at real web vulnerabilities, two root causes come up again and again:
- Trusting input. Data from outside is treated as if it were safe: pasted into a database query, a shell command, or a web page without the right handling. This leads to injection and cross-site scripting.
- Missing checks. The server does what was asked without asking "is this user allowed to do this, to this record?" This leads to broken access control, the most important category on the list in the next section.
"Our site is too small to be attacked." Most attacks on websites are not aimed at anyone in particular. Automated tools scan large parts of the internet all day, looking for known weaknesses, default passwords, and forgotten admin pages, and they try whatever they find. A small bakery's portal is reached by the same scanners as a large shop. Size does not protect you. Fewer weaknesses do.
03The OWASP Top 10:2025 at a glance
OWASP, the Open Worldwide Application Security Project, is a nonprofit foundation that publishes free guides and tools for building secure software. Its best-known document is the OWASP Top 10, an awareness list of the ten most important risk categories for web applications. The current edition is the 2025 one. Each category has an ID made of a number and the year, such as A01:2025.
The 2025 edition was built from data on about 2.8 million applications, with 589 CWE weakness types analyzed (you will meet CWEs in the next section). OWASP says it tries to name the root cause of a problem rather than its symptom. Here is the list, in order, with the lessons where this course covers each one:
| Category | In one line | Lessons |
|---|---|---|
| A01:2025 Broken Access Control | Users can see or do things they should not, such as another customer's order. Now also includes SSRF and CSRF. | 11, 12, 13 |
| A02:2025 Security Misconfiguration | Unsafe defaults, debug output, verbose errors, missing security headers. | 14, 15 |
| A03:2025 Software Supply Chain Failures | Problems in the libraries, tools, and build pipeline your app depends on. | 16 |
| A04:2025 Cryptographic Failures | Data not protected properly in transit or at rest, weak or home-made crypto. | 17 |
| A05:2025 Injection | Input is run as code: SQL injection, command injection, cross-site scripting. | 6 to 9 |
| A06:2025 Insecure Design | A needed control was never planned, so no amount of careful coding adds it. | 19 |
| A07:2025 Authentication Failures | Weak logins, password guessing, poor session handling. | 5, 10 |
| A08:2025 Software or Data Integrity Failures | Code or data is trusted without checking that it has not been changed. | 16 |
| A09:2025 Security Logging and Alerting Failures | Attacks happen and nobody records them or is told. | 18 |
| A10:2025 Mishandling of Exceptional Conditions | Errors and unusual situations handled badly, for example an app that fails open. | 14 |
What changed since 2021
If you learned the 2021 list, a few things moved. Two categories are new: A03 Software Supply Chain Failures grew out of the old "Vulnerable and Outdated Components" and now covers the whole chain, and A10 Mishandling of Exceptional Conditions is entirely new. Security Misconfiguration climbed from 5th to 2nd. Cryptographic Failures went from 2nd to 4th, Injection from 3rd to 5th, and Insecure Design from 4th to 6th. Broken Access Control stayed first. "Identification and Authentication Failures" is now simply "Authentication Failures," and the logging category now says "Alerting" in its name.
One change trips up many people: server-side request forgery (SSRF) is no longer its own category. It was A10 in 2021. In 2025 it sits inside A01 Broken Access Control, listed there as CWE-918. Cross-site request forgery (CSRF, CWE-352) is also listed under A01. And cross-site scripting is not a separate entry: it sits inside A05 Injection.
Always write the year with the ID. "A03" alone is ambiguous: in 2021 it meant Injection, in 2025 it means Software Supply Chain Failures. "A03:2025" is clear to everyone.
04Other lists: CWE and the CWE Top 25
The Top 10 groups problems into broad categories. Underneath it sits a much finer catalog: CWE, the Common Weakness Enumeration. Each CWE entry describes one specific type of software weakness and has a number. A few you will see often in this course:
CWE-79: cross-site scripting (XSS).CWE-89: SQL injection.CWE-78: OS command injection.CWE-352: cross-site request forgery (CSRF).CWE-918: server-side request forgery (SSRF).
The relationship is simple: a Top 10 category is a bucket, and CWEs are the items inside it. A05:2025 Injection, for example, contains 37 CWEs, among them CWE-79, CWE-89, and CWE-78. A01:2025 Broken Access Control contains 40. When a tool or a report says "CWE-89", you can place it in A05 immediately.
MITRE, which runs CWE, also publishes the CWE Top 25 Most Dangerous Software Weaknesses. The 2025 list, released in December 2025 and based on 39,080 CVE records, puts cross-site scripting (CWE-79) first and SQL injection (CWE-89) second, with CSRF (CWE-352) third and Missing Authorization (CWE-862) fourth. It covers all software, not only web applications, which is why memory bugs such as out-of-bounds writes also appear in it.
The two lists answer different questions. The OWASP Top 10 helps you decide which risk areas to learn and check. The CWE Top 25 ranks individual weakness types. Both point at the same lesson: the old, well-understood bugs are still the ones that cause the most trouble.
05Practicing legally, and how this course works
To defend web applications you need to see how they break. That raises an obvious question: where may you practice? The answer in this course is strict and simple.
Testing a website you do not own without written permission is illegal in most countries, even if you "only look," change nothing, and mean well. Sending a single quote into someone else's login form to see whether it breaks counts as testing. In this course you attack only two deliberately vulnerable apps running in containers on your own computer, at localhost. For anything else you need the owner's written permission and an agreed scope. Lessons 21 to 24 show what that looks like.
From lesson 2 on you will run two training targets locally: OWASP Juice Shop, a modern shop full of deliberate flaws, and DVWA, the Damn Vulnerable Web Application, which shows each flaw at several difficulty levels. Both are made to be broken, and both are dangerous if anyone else can reach them, so they stay bound to your own machine.
Every vulnerability lesson follows the same rhythm:
- How it works: the idea, with a diagram.
- How it breaks: a small, harmless demonstration on your local target.
- How to fix it: Sam's first version of the code, then Sam's fixed version, with the matching OWASP Cheat Sheet.
- How to test for it: a check from the OWASP testing guide, so you can prove the fix works.
Three habits prevent a large share of the problems in this course. Validate at the server: treat every value from outside as untrusted, whatever the browser was supposed to allow. Encode at output: when data goes into a query, a command, or a page, use the safe API for that context so data stays data. Deny by default: every request is refused unless a check explicitly allows this user to do this action on this record.
Practical exercise: map the Top 10 to Lakeside
You only need a browser and a notes file. You read public pages and the diagram above. You do not test any website. Check off each step as you finish it. Your check marks are saved in this browser.
Key takeaways
- The attack surface is every input from outside: URLs, form fields, headers, cookies, APIs, uploads, and third-party messages.
- Most web flaws come from trusting input or from a missing server-side check.
- The OWASP Top 10:2025 runs from A01 Broken Access Control to A10 Mishandling of Exceptional Conditions. Always write the year with the ID.
- SSRF is no longer a separate category: in 2025 it sits inside A01, and XSS sits inside A05 Injection.
- A CWE is one specific weakness type, and a Top 10 category is a bucket that holds many CWEs.
- Practice only on your own local targets. Anything else needs the owner's written permission.