The OWASP Top 10 at a glance
45 min · Beginner
Need help? Ask a tutor on WhatsApp (opens in a new tab)A new endpoint passes review, and a month later someone finds it leaks other customers' orders. Teams avoid such surprises with a shared list of the ten most common risks and a short checklist.
OWASP and the Top 10 list
OWASP, the Open Worldwide Application Security Project, is a non-profit community that publishes free guides and tools for secure software. Its Top 10 ranks the ten most important risk categories for web applications.
The 2025 list, with the code each category carries in reports and code reviews.
Example 1 · The OWASP Top 10, 2025 edition
A01 Broken Access Control still number 1; now also covers SSRFA02 Security Misconfiguration up from 5th placeA03 Software Supply Chain Failures new; grew out of 2021's "Vulnerable and Outdated Components"A04 Cryptographic Failures down from 2ndA05 Injection down from 3rd; includes XSSA06 Insecure Design down from 4thA07 Authentication Failures renamed from "Identification and Authentication Failures"A08 Software or Data Integrity Failures still 8thA09 Security Logging and Alerting Failures renamed from "... Logging and Monitoring Failures"A10 Mishandling of Exceptional Conditions newA01-A03 who may do what, and what you run (settings and other people's code) A04-A06 protecting data, handling input, designing safely A07-A10 logins, trusting code and data, noticing attacks, failing safely
What this code does
- Each line is a category name with its code, such as A01. Reports and code reviews use these codes as short labels, for example "A05: query built by joining strings".
- The groups are only a memory aid used in this lesson, not part of the OWASP document. The next three sections explain the categories in these groups.
Each entry is a category, a family of related mistakes, not one single bug. A code reviewer writes "possible A01 here", a security tester groups findings by category, and interviewers often ask for an example of two or three of them.
The 2025 edition is the current one. Compared with 2021, it adds two categories (software supply chain failures and mishandling of exceptional conditions), folds server-side request forgery into broken access control, and renames two others.
A01–A03: access control, misconfiguration and the supply chain
Broken access control (A01) means a user can reach data or actions that should not be theirs: another customer's order, an admin endpoint, or a page hidden only by not showing a link.
Three mistakes from A01 to A03 in a real shop, and the defence for each.
Example 2 · A01–A03 in a real shop
A01 Asha opens /api/v1/orders/10, changes it to /api/v1/orders/14 and sees Ravi's order. A new "import product photo from a URL" feature fetches any URL an admin types, so a stolen admin account points it at an internal address and reads the reply (SSRF).A02 The live server runs with development settings: full stack traces in error pages, the database's default admin password, and every monitoring endpoint open to the internet.A03 A popular date library publishes version 3.2.1. The maintainer's account was stolen, and the new version quietly sends the server's environment variables, with the database password, to an outside server. Every app that updated runs it.A01 deny by default; check role and owner on every request; /me URLs for own data;
fetch only from an allow-list of hosts, never internal addresses
A02 separate production settings, no default passwords, only the health endpoint public,
plain error messages; review settings like code
A03 use few, well-known libraries; pin exact versions; scan for known holes;
read release notes before updating; download only from the official repositoryWhat this code does
- All three scenarios need no clever trick: an edited number, a setting nobody changed, an update that was trusted blindly. That is why these categories are so common.
- SSRF is now part of A01 because the root problem is the same: the server reaches something on the user's behalf that the user was never allowed to reach.
In 2025, A01 also covers server-side request forgery (SSRF): the server fetches a URL that a user supplied, and the user points it at an internal address that the server can reach but the user cannot.
Security misconfiguration (A02) is safe software set up unsafely: default passwords left unchanged, detailed error pages in production, debug or admin endpoints open to the internet, or a storage bucket that anyone can read. Software supply chain failures (A03) come from code you did not write: libraries, plugins, build tools and the places they are downloaded from. An old library with a known hole, or a release published by someone who stole a maintainer's account, runs inside your app with all of its permissions.
A04–A06: cryptography, injection and design
Injection (A05) happens when untrusted input becomes part of a command or query that runs. It covers SQL injection and cross-site scripting (XSS), and the fix is always to keep data and code apart.
A04 to A06 in a real shop: weak password storage, injection and a flawed design.
Example 3 · A04–A06 in a real shop
A04 A college fest site stores passwords with plain SHA-256 and no salt. The table leaks, and most passwords are found within hours. The login page also works over plain HTTP.A05 A product search builds its SQL by joining the typed text into the query string. A product review is shown on the page as raw HTML, so markup in it runs in readers' browsers (XSS).A06 "Forgot password" asks only for the email and date of birth, which many students show on social media. A coupon FEST50 can be applied again on every refresh of the cart.A04 HTTPS everywhere; BCrypt or Argon2 for passwords; encryption for data you must read
back; keys in configuration, never in code
A05 parameterised queries; allow-lists for sort fields; output encoding for any text
shown in a page; validate every input
A06 threat-model each feature before building it; reset links with random, short-lived
tokens; business rules such as "one coupon per order" enforced on the serverWhat this code does
- A04 and A05 are mistakes in the code, so the same feature written carefully is safe. A06 is a mistake in the idea: the date-of-birth reset is insecure even if every line of code is perfect.
- The Hashing vs encryption vs encoding lesson covered the A04 tools; the Common attacks lesson showed SQL injection and XSS step by step.
Cryptographic failures (A04) are missing or weak protection of sensitive data: passwords stored in plain text or with a fast hash, logins on plain HTTP, old algorithms such as MD5, or encryption keys written into the code. Injection is stopped with parameterised queries for databases and output encoding for pages.
Insecure design (A06) is a flaw in the plan itself, so even perfect code has it: a password reset that asks only for a date of birth, or a coupon that can be applied any number of times. It is found by thinking about threats before building, which is what a threat model does; this module's project writes one for ShopLite.
A07–A10: logins, integrity, logging and errors
Mishandling of exceptional conditions (A10) is new in 2025: the program does something unsafe when things go wrong. It may fail open (allow a request because a check threw an error), show a stack trace or leave half-finished changes.
Four more risks in a real shop: weak logins, unchecked tokens, silent attacks and unsafe failures.
Example 4 · A07–A10 in a real shop
A07 The login endpoint allows unlimited guesses, accepts "123456" as a new password, and gives tokens that never expire.A08 The API decodes the token and reads the role from it, but skips checking the signature, so an edited token with role ADMIN is accepted.A09 20,000 failed logins hit one account overnight. Nothing is logged, so nobody notices. Elsewhere, the request log prints every Authorization header.A10 "Can this user cancel the order?" calls another service. When it times out, the code allows the cancel "so customers are not blocked". Another error page shows the full stack trace with table names.A07 limit failed logins per account and IP; refuse common passwords; short-lived tokens;
logout that really ends access; a second factor for admins
A08 verify every token's signature and expiry on every request; trust only signed
updates and a checked build pipeline
A09 log logins, failures and refused requests (who, what, when) without secrets;
alert someone when failures spike
A10 fail closed (deny on error); one global error handler with plain messages;
transactions so a failure undoes partial changesWhat this code does
- A07 and A08 together decide whether the server knows who is calling. A token whose signature is not checked is just a note the user wrote, so the role inside it means nothing.
- A09 and A10 are about bad moments. Logging and alerting make sure someone sees an attack; failing closed makes sure an error never quietly turns into "allowed".
Authentication failures (A07) are weaknesses in proving who someone is: unlimited password guesses, very common passwords allowed, tokens that never expire, or a logout that does not really end anything. Software or data integrity failures (A08) mean trusting code or data without checking that it was not changed, such as accepting a token without verifying its signature.
Security logging and alerting failures (A09) mean an attack happens and nobody notices: failed logins and refused requests are not logged, or nobody is alerted. Logging passwords or tokens is the opposite mistake and belongs here too. Safe code fails closed (A10): when in doubt, deny, undo the partial work and return a plain error.
Predict the output
Which category is it?
Read each situation and pick the OWASP 2025 category.
Round 1 of 3
The API reads the role from a token without checking its signature.
From risks to defences
Every category has a standard defence, and a framework switches most of them on when you configure it correctly. The modules of this section build them into ShopLite one by one.
Example 5 · Each risk, its defence, and where ShopLite gets it
A01 Broken access control role rules on URLs and methods, owner checks, /me URLs -> Roles & Permissions, Common Security Mistakes (IDOR)A02 Misconfiguration secure defaults, public endpoints listed one by one, CORS allow-list -> How Spring Security Works, CORS & Browser ClientsA03 Supply chain versions managed by Spring Boot, dependency updates and scanning -> Common Security Mistakes (keeping dependencies up to date)A04 Cryptographic failures BCrypt password hashes, signing key from configuration, HTTPS -> Users & Password Storage, JWT AuthenticationA05 Injection parameterised queries, validation, allow-listed sort fields -> already in place since the JDBC and Spring Boot sectionsA06 Insecure design a threat model and an access table before any security code -> this module's project: ShopLite threat modelA07 Authentication failures BCrypt, short-lived tokens, login limits, one error for bad logins -> Users & Password Storage, JWT Authentication, Common Security MistakesA08 Integrity failures token signature and expiry checked on every request -> JWT AuthenticationA09 Logging and alerting security events logged, secrets never logged -> Common Security Mistakes (logging sensitive data)A10 Exceptional conditions deny by default, consistent 401/403 Problem Details -> Roles & Permissions (security error responses)A05 parameterised queries everywhere (JDBC, then JdbcClient and JPA) A05 sort fields from an allow-list, never the client's text in SQL A10 one global error handler: Problem Details, no stack traces, internal-error for surprises A02 database credentials from environment variables, never committed to Git
What this code does
- Read the table as a plan: by the end of this section every row is built and tested in ShopLite. Spring Security is the framework that provides most of these defences for Java.
- Some rows are already done, because earlier sections followed good habits. That is the point of the list: security is mostly ordinary good engineering done on every endpoint.
A list of defences helps only if someone checks it. Teams run a short security checklist on every new endpoint during code review; the last example is one you can use for any backend, in any language.
Example 6 · A security checklist for any backend endpoint
Before merging a new endpoint, answer every question:[ ] Who may call it: guest, customer or admin? Is that rule in code? A01[ ] Does it take an id? Is the owner checked, or is it a /me URL? A01[ ] Does the server fetch a URL a user gave? Is the host on an allow-list? A01[ ] Does the response hold only fields this caller may see? A01[ ] Do production settings differ from development (errors, debug, CORS)? A02[ ] Are new libraries current and from the official repository? A03[ ] Passwords hashed with BCrypt or Argon2? Secrets kept out of code? A04[ ] Is every input validated, and does every query use parameters? A05[ ] Could a valid user abuse the rule itself (repeat, skip a step)? A06[ ] Are login attempts limited and tokens short-lived? A07[ ] Are token signatures and expiry checked on every request? A08[ ] Are failed logins and refusals logged, without passwords or tokens? A09[ ] If a check throws, does the request fail closed with a plain error? A10Who may call it? anyone, no login yet A01, A07 open Owner checked? no: any id returns any order A01 open Fetches a user's URL? no fine Only allowed fields? any customer's items and total A01 open Validated and parameterised? yes: numeric id, JPA parameters fine Refusals logged? no security events yet A09 open If a check throws? global handler, plain 500 fine
What this code does
- Each question names the category it guards against, so a reviewer can write "A01: no owner check" in one line. Questions that do not apply, such as the URL fetch here, are answered "no" and skipped.
- Today's ShopLite passes the injection and error-handling questions but fails on access control and logging, because it has no logins yet. The threat model project turns these gaps into a written plan.
Next step
Check your understanding
12 quick questions