Section 1
Purpose and method
The OWASP Top 10 is OWASP's awareness document on the most critical security risks to web applications. Its 2025 edition, the installment, is the current one. Every category on it is, in the end, a programming problem, so we show each one as a program: for every category a short Python module with a realistic flaw, an attack function that exploits it, and a fixed version of the same code. The text explains the code; the code and its output are the evidence. We set out to answer three questions:
- Can each of the ten 2025 categories be shown as a flaw in code, with an attack that works against it and a fix that the same attack fails against, without breaking the feature?
- What do the ten have in common as programming problems: where they enter, what goes wrong, what is lost, and how they are found?
- What do the fixes still not do?
Section 4 answers the first question category by category, section 3 the second, and each category's "What the fix does not do" the third. Section 8 sums up.
How every demo is checked
A fix only counts if it stops the attack without breaking the feature. Every scenario is therefore run three times, and the tests require all three outcomes below. The third rule matters most: deleting the feature, or rejecting every input, also "stops" an attack.
test_demos.py, one for each rule. A fourth test checks that every category has a demo, and more check details such as lock-out timing, log format and the non-ASCII inputs fixed on 26 November. The page is only built when all tests pass. Section 5 shows a fix that the third rule rejects.How this page is made
Scope
- Everything runs in one Python process with the standard library only. There is nothing to install.
- The databases are real SQLite databases held in memory. The network in A01 and the package indexes in A03 are Python dictionaries, so no request leaves the machine and nothing is installed.
- The pickle payload in A08 only sets a marker variable, so that the test can see that it ran. All people and account numbers in the demos are fictitious, and no address in them is ever contacted.
Section 2
The OWASP Top 10:2025
Compared with the 2021 edition there are two new categories, Software Supply Chain Failures and Mishandling of Exceptional Conditions, and one consolidation: server-side request forgery (SSRF), a category of its own in 2021, is now part of Broken Access Control. Three categories were renamed.
| 2025 | Category | In 2021 | Chosen by | CWEs | Avg. incidence | Occurrences | CVEs |
|---|
How OWASP builds the list
OWASP's contributors sent test results for . The results name weaknesses by their CWE number; different CWEs occur in this edition's data. The team grouped CWEs into categories of at most 40 CWEs each and ranked categories by the data; the ten on the list hold fewer than half of the CWEs. Eight of the ten places come from that ranking; the other two, A03 and A09, were chosen by a community survey of practitioners, because some risks are hard to find with automated tests and so stay rare in test data. OWASP calls the list "data-informed, but not blindly data-driven".
The ranking uses a formula that OWASP publishes on its methodology page:
We applied that formula to the score tables of the ten categories and of the two near misses that have one. The bars below are our arithmetic, not OWASP's.
Show the computation for every category
| Category | Max incidence × 1000 | Max coverage × 100 | Exploit × 10 | Impact × 20 | Occurrences ÷ 10,000 | Score |
|---|
Where OWASP's own pages disagree
While checking every figure against OWASP's pages, we found places where the pages disagree, with each other or within one page: figures in the introduction that differ from the category page they describe, pages whose text, score table and list of CWEs do not agree, and names that differ. Where they differ, this report uses the category pages, because they carry the full score table and list each CWE.
| About | What | One place says | Another place says |
|---|
Three risks that came close
Section 3 · our classification
A mini taxonomy of the ten
OWASP ranks the categories it takes from its data by a risk score and adds two from a survey. To see what the ten share as programming problems, we classified our ten demos by four questions. Strictly, this is a faceted classification rather than a hierarchy: four independent questions, each with a closed list of answers. The rule: a category gets every answer that at least one of its scenarios shows, so it describes the demo, not everything OWASP files under the category. The classification is ours, made by the two of us from the code; OWASP does not publish one. Hover over an answer for its definition, or open the list below.
Definitions of the answers
What the classification shows
Where each demo sits in one application
Our ten fixes use six kinds of repair
Two design principles of Saltzer and Schroeder (1975) meet in the first row: complete mediation, checking every access on the server, and fail-safe defaults, refusing unless access is allowed. The fifth and the last rows carry fail-safe defaults over from access decisions to settings and to failures.
| Repair | In our code | Categories |
|---|
Next to STRIDE
Our question "what is lost" looks at the same thing as Microsoft's threat model STRIDE, from the other side: STRIDE names six kinds of threat, and each one threatens one security property. Five of the six line up with our answers. The sixth, elevation of privilege, threatens authorization, which our list leaves out on purpose: we record what the attack costs, so A01, where Mallory reads other people's invoices, counts as a loss of confidentiality.
| STRIDE threat | Property it threatens | Our value | Our categories with that value |
|---|
Section 4
The ten categories in code
Each category below follows the same order: what the flaw is, a sequence diagram of the attack against both versions, the vulnerable code, the attack, the fix, the program's real output, what the fix still does not do, and the weaknesses involved. Red marks where an attack succeeds, green where a fix stops it.
Results at a glance
| Category | Scenario | Attack, vulnerable | Attack, fixed | Normal use |
|---|
Section 5
The interactive lab
The same ten demos also became exercises. In the lab, a lesson explains the flaw, the learner runs the attack against the starting code, changes the code in an editor, and the page checks the change with the two rules from section 1 for the fixed version: the attack must fail, and normal use must still work. The Python runs inside the visitor's browser, so the website itself is only static files: there is no server that runs anyone's code.
learn/serve.py does and a real host must be set up to do. A run that takes longer than seconds is stopped by terminating the worker.Screenshots
What was tested
Half-fixes the check refuses
Each of these is a test in learn/test_runner.py: a plausible fix that stops part of the problem, and that the lab must not accept.
Section 6
Run it yourself
The demos need Python 3.10 or later and nothing else, and they run offline.
Files
Section 7
Limitations
- Each demo shows between and weaknesses, while each OWASP category maps between 5 and 40 CWEs. The demos show CWEs in all; of them are mapped by OWASP to the category they illustrate, and to another category. Each category's section says which.
- The demos are Python only. Weaknesses that need a browser to show, such as cross-site scripting (part of A05) and cross-site request forgery (part of A01), are not demonstrated.
- The network in A01 and the package indexes in A03 are simulated. The attacks show the logic of the flaw, not how it is exploited on a real network.
- Each fix is the smallest change that makes the attack fail. None is a complete defence; each category's section lists what its fix does not do.
- The OWASP figures were copied from the pages on .
report/check_sources.pycompares them with the pages again on request; it is the only part of the project that reads OWASP's pages. The risk scores in section 2 are our own arithmetic and do not match OWASP's stated scores exactly. - The classification in section 3 was made by the two authors together, without an independent second coding.
- The tests were written by the same people as the fixes, so they check what we thought of. The lab's half-fix tests and the normal-use checks reduce this; they do not remove it.
- The lab is a prototype. It has been tested in a Chromium-based browser and in Firefox, not in Safari, on phones or on a real hosting account.
Corrected on 26 November 2026
A review of the demos against this report's text found places where the code did less than the text said. Each was fixed; where tests were added with a fix, their number is given in brackets.
- A02, A08 and A09: the fixed code crashed on input with non-ASCII characters, because
hmac.compare_digestrefuses such text. It now compares bytes (three tests). In A08 one character in a cookie's tag was enough to cause a server error. - A09: an unknown user could log in with an empty password (one test), and the printed count of log lines with a typed password counted one guess instead of all of them.
- A04: the attacker's lookup table was always built with MD5, so the fix's result did not depend on the salt. The table is now built with the scheme under attack.
- A01: the attack never reached the fix's second check, of the address. A fourth request now re-points an allowed name (three tests).
- A10: the fix debited before it credited, so the transaction was not what stopped the attack. It now keeps the original order, and the rollback undoes the credit.
- A02: the fix wrote the request path into the log unescaped, the same log forging that A09 shows. A03: the fixed resolver now refuses an unknown index instead of falling back to the public one (one test). A06: each misuse case is now tested on its own (two tests).
- of the weaknesses listed are mapped by OWASP to another category; each category's section now says which. The lab's syntax check now also reports errors that Python finds only when compiling, such as
returnoutside a function (one test of the lab).
Section 8
Conclusion
Section 9
Sources, and what is ours
Category names, positions, score-table figures and the lists of mapped CWEs are OWASP's, read from the pages below on ; each category's full list is under "All CWEs that OWASP maps". OWASP publishes the Top 10 under the licence. The prevention lists are our summaries of OWASP's advice. The code, the tests, the lab, the figures, the explanations and the classification are our own work.