OWASP Top 10 training for developers
The most common and serious web application security risks, and how to avoid them in everyday code.
Who it's for: Software engineers and other IT professionals who build, review or run web applications.
Starts at your level
Each module begins with a few questions about your role and what you already know, so you skip what you know.
Examples from your job
Zuno explains each idea with examples from your work, with diagrams, tables and short quizzes where they help.
Checks you've understood
An outcome only counts as learned once you've answered a check on it correctly. Managers can see each person's progress.
What the course covers
11 modules. Each one lists what you'll be able to do by the end of it.
A01Broken access control
Making sure users can only see and do what they are allowed to, on every request.
- What access control is. Access control decides what an authenticated user may see and do. It is broken when users can act outside their intended permissions.
- Authentication vs authorisation. Authentication proves who you are. Authorisation decides what you are allowed to do. Being logged in does not mean being allowed.
- Checks belong on the server. Access checks must run on the server for every request. Hiding a button or checking in the browser is not security.
- Insecure direct object references. IDOR: a user changes an identifier in a request (such as /invoices/1043 to /invoices/1044) and gets someone else's data because ownership is never checked.
- Privilege escalation. Vertical privilege escalation is a normal user reaching admin functions; horizontal escalation is a user reaching another user's data at the same level.
- Scope data to the user. Look up records through the current user or tenant (for example WHERE id = ? AND owner_id = ?), rather than fetching by ID and checking later or not at all.
- Deny by default, check centrally. Deny access unless a rule allows it, and put authorisation rules in one place (middleware, policies or a library) rather than scattering checks through handlers.
- Don't trust roles from the client. Never take a user's role or permissions from something the client controls, such as a hidden field, a cookie value or an unverified token claim.
- Path traversal. Path traversal: input such as ../../etc/passwd in a file name lets a user read or write files outside the intended folder.
- Cross-site request forgery. CSRF: another site makes the victim's browser send a request to your site, and the browser attaches the victim's cookies, so the action runs as them.
- CORS is not access control. CORS relaxes the browser's same-origin policy. A misconfigured CORS policy, such as reflecting any Origin while allowing credentials, lets any website read your users' data through their browser.
- Server-side request forgery. SSRF: the server fetches a URL the user supplied, and an attacker points it at internal systems the server can reach but they cannot.
- Spot and fix. Spot a missing or wrong access check in a short code sample and propose a correct fix.
A02Security misconfiguration
Unsafe default settings, error messages that show too much, storage that anyone can open, and other settings that weaken security.
- What misconfiguration is. Security misconfiguration is an insecure setting anywhere in the stack: the app, its framework, the web server, containers or the cloud account.
- Default accounts and samples. Default accounts and passwords, sample apps and admin consoles left enabled are a common way in.
- Debug features in production. Debug modes and diagnostic endpoints must be off in production.
- Verbose error messages. Stack traces and detailed errors shown to users reveal internals that help attackers. Show a generic message and log the details.
- Reduce attack surface. Remove or disable what you do not need: unused features, pages, ports, services, HTTP methods and dependencies.
- Exposed files and listings. Web servers must not serve files such as .git folders, .env files, backups or directory listings.
- Security headers and cookie flags. Set the security headers and cookie flags that browsers rely on: HSTS, Content-Security-Policy, X-Content-Type-Options: nosniff, frame-ancestors, and Secure, HttpOnly and SameSite on cookies.
- Cloud misconfiguration. In the cloud, most breaches come from settings rather than code: public storage buckets, over-broad IAM permissions, open security groups and databases exposed without authentication.
- XML external entities. XML parsers that resolve external entities can be made to read local files or make requests (XXE). Turn off DTD and external entity processing.
- Secrets out of code and images. Secrets do not belong in source code, container images or committed config files. Use environment-specific secrets from a secret manager.
- Repeatable hardening. Make secure configuration repeatable: define it as code, keep environments consistent, and check it automatically.
- Spot and fix. Review a short configuration (an app setup, Dockerfile, server config or bucket policy) and list the security problems and fixes.
A03Software supply chain failures
How to safely use libraries, build tools and other code that other people wrote.
- What the supply chain is. Your software is built from code and tools you did not write: libraries and their dependencies, build tools, CI/CD services, base images and editor plugins. A weakness anywhere in that chain reaches your users.
- Transitive dependencies. Most of the code in a typical app comes from transitive dependencies, the dependencies of your dependencies, and you inherit their vulnerabilities.
- Known vulnerabilities. Components with known, published vulnerabilities (CVEs) are an easy target, because attackers scan for them soon after disclosure.
- Know what you run. Keep an inventory of your components: commit lockfiles, produce a software bill of materials (SBOM), and scan dependencies automatically.
- Patch on a schedule. Have a routine for updates: automated update pull requests, tests that make updating safe, and faster handling for vulnerabilities that are actually being exploited.
- Malicious packages. Attackers publish or take over packages to run their code on developers' machines and in builds: typosquatting, hijacked maintainer accounts and malicious install scripts.
- Dependency confusion. If an internal package name also exists on a public registry, a misconfigured build may install the attacker's public version instead.
- Choosing dependencies. Before adding a dependency, check it is maintained, widely used and worth its size, and prefer fewer dependencies overall.
- Securing the build pipeline. The CI/CD pipeline is part of the supply chain: protect its secrets, give its tokens least privilege, pin third-party actions to exact versions, and require review for changes.
- Signing and provenance. Signatures and provenance records let you check where an artifact came from and that it was not changed on the way.
- Spot and fix. Review a dependency manifest or CI workflow and point out the supply chain risks and fixes.
A04Cryptographic failures
Protecting sensitive data in transit and at rest, storing passwords properly, and using standard encryption libraries instead of writing your own.
- Know your sensitive data. Start by knowing which data is sensitive (passwords, personal data, health and payment data, tokens and keys) and what rules apply to it. Data you do not keep cannot leak.
- Encrypt in transit. Use TLS for all traffic, including internal service-to-service calls, enable HSTS, and never turn off certificate validation.
- Encrypt at rest. Encrypt sensitive data at rest, and keep the keys separate from the data.
- Hashing, encryption and encoding. Hashing is one-way, encryption is reversible with a key, and encoding (such as Base64) is not security at all.
- Storing passwords. Store passwords with a slow, salted password hashing function: Argon2id, scrypt or bcrypt (or PBKDF2 where required).
- Avoid weak algorithms. Do not use broken or outdated algorithms and modes: MD5 or SHA-1 for security, DES or 3DES, RC4, or AES in ECB mode. Prefer authenticated encryption such as AES-GCM or ChaCha20-Poly1305.
- Don't roll your own crypto. Use well-reviewed, high-level libraries and their defaults rather than combining primitives or inventing schemes yourself.
- Secure randomness. Use a cryptographically secure random number generator for tokens, keys and IDs that must be unguessable, never Math.random or similar.
- Unique IVs and nonces. IVs and nonces must never repeat for the same key; reusing a nonce with AES-GCM can expose data and allow forgery.
- Managing keys and secrets. Keep keys out of code and repositories, store them in a key or secret manager, limit who can use them, and plan for rotation.
- Spot and fix. Spot a cryptographic mistake in a short code sample and propose a correct fix.
A05Injection
SQL, command and other injection: when user input gets treated as part of a query or command.
- What injection is. Injection happens when untrusted data is sent to an interpreter (a database, a shell, a template engine) as part of a command or query, so the data changes what the command does.
- SQL injection. SQL injection: building a query by joining strings with user input lets an attacker change the query, for example to bypass a login or read other tables.
- Parameterised queries. Prevent SQL injection with parameterised queries (prepared statements), where the query and the data are sent separately.
- When parameters can't help. Table names, column names and sort directions cannot be parameters, so map user choices to an allowlist of known values.
- OS command injection. Command injection: passing input into a shell command lets attackers add their own commands with characters such as ; | and $( ).
- NoSQL injection. NoSQL databases can be injected too, for example by sending a JSON object such as {"$ne": null} where code expects a string.
- Other interpreters. Anything that interprets text can be injected: LDAP and XPath queries, server-side templates (SSTI), expression languages, and headers or logs via newline characters.
- Prompt injection. Applications built on large language models face prompt injection: text from users or fetched content can override the instructions you gave the model.
- Validation and least privilege. Allowlist input validation and least-privilege database accounts limit the damage, but they support safe query building rather than replace it.
- Spot and fix. Spot an injection bug in a short code sample and propose a correct fix.
XSSCross-site scripting (XSS)
How attackers get their own scripts to run in your users' browsers, and how to prevent it.
- What XSS is. XSS happens when untrusted data reaches a page in a way the browser treats as code rather than as text.
- What an attacker can do. Injected script runs with the vulnerable site's origin, so it can do anything the logged-in user can do on that site.
- Untrusted data. Any data the code did not write itself is untrusted, including data from your own database, headers, URLs and third-party APIs.
- Reflected XSS. Reflected XSS: the server copies part of the request (such as a search term) straight into the response.
- Stored XSS. Stored XSS: the payload is saved (for example in a comment or a profile name) and served to every user who views it.
- DOM-based XSS. DOM-based XSS: client-side JavaScript moves data from a source (such as location.hash) into a dangerous sink (such as innerHTML) without the server being involved.
- Output contexts. The safe way to output data depends on where it lands: HTML text, an HTML attribute, a URL, JavaScript or CSS.
- Output encoding. Prevent XSS with contextual output encoding, preferably by relying on a framework's automatic escaping.
- Framework escape hatches. Recognise the APIs that switch off automatic escaping, and treat every use as a review point.
- Sanitising rich HTML. When users must supply rich HTML, clean it with a well-maintained sanitiser using an allowlist, never with home-made filters.
- Limits of input validation. Input validation reduces risk but is not a defence against XSS on its own.
- Content Security Policy. A strict Content Security Policy limits the damage of XSS that slips through, as a second layer of defence.
- Cookie flags. HttpOnly cookies stop script from reading the session cookie, but do not stop XSS from acting as the user.
- Spot and fix. Spot an XSS bug in a short code sample and propose a correct fix.
A06Insecure design
Security flaws in how a feature was designed, as opposed to mistakes in the code, and how threat modelling and abuse cases help find them.
- Design flaws vs bugs. Insecure design means a needed security control was never planned. Perfect code cannot fix a flawed design, while a good design can still have implementation bugs.
- Threat modelling. Threat model a feature by asking four questions: what are we building, what can go wrong, what are we going to do about it, and did we do a good job?
- Trust boundaries. Find the trust boundaries in a design (where data or control passes between parties with different levels of trust) and check data at each one.
- Abuse cases. Write abuse cases alongside user stories: 'as an attacker, I want to…', and turn them into requirements and tests.
- Business logic flaws. Business logic flaws use features in ways the designers did not expect: negative quantities, skipping steps in a workflow, reusing one-time offers, or racing two requests at once.
- The server owns the workflow. Keep workflow state and prices on the server; never trust the client to say which step it is on or what something costs.
- Limits and anti-automation. Design in limits against automation and abuse: rate limits, quotas, and bot protection for valuable actions.
- Secure defaults and paved roads. Reuse secure, well-tested building blocks (secure defaults, shared libraries, reference architectures) so each team does not have to get security right from scratch.
- Spot and fix. Review a short feature design and identify the design flaws and the controls it needs.
A07Authentication failures
How to check that people are who they say they are, covering logins, passwords, MFA, sessions and account recovery.
- What authentication failures are. Authentication failures let an attacker log in as someone else or keep a session they should not have, through weak logins, weak recovery or weak session handling.
- Credential stuffing and brute force. Attackers try passwords leaked from other sites (credential stuffing) or guess common passwords across many accounts. Defend with MFA, rate limiting and checks against known-breached passwords.
- Modern password rules. Current guidance favours long passwords, blocking known-breached and common ones, and dropping forced complexity rules and regular forced changes.
- Multi-factor authentication. MFA blocks most account takeovers, and phishing-resistant methods (passkeys, security keys) are strongest, ahead of app codes, which are ahead of SMS.
- Session management. Handle sessions safely: long random session IDs, a new ID at login, real expiry and logout on the server, and secure cookie flags.
- Token pitfalls. Bearer tokens such as JWTs must have their signature verified with an expected algorithm, be short-lived, and have a plan for revocation.
- Account recovery. Password reset is a login path too: use single-use, short-lived, random tokens, and notify the user when their password or email changes.
- Account enumeration. Login, sign-up and reset pages should not reveal whether an account exists, through different messages or noticeably different response times.
- Use proven identity tools. Prefer a proven identity provider or framework over building authentication yourself.
- Spot and fix. Spot an authentication flaw in a short code sample or flow and propose a correct fix.
A08Software or data integrity failures
Trusting code or data without checking it has not been tampered with: deserialisation, updates, third-party scripts.
- What integrity failures are. Integrity failures happen when code or data is trusted without checking it came from where you think and has not been changed.
- Insecure deserialisation. Deserialising untrusted data with formats that can create arbitrary objects (Java serialisation, Python pickle, PHP unserialize, unsafe YAML loading) can let attackers run code.
- Data that round-trips through the client. Data you send to the client and later read back (hidden fields, cookies, view state) can be changed. Keep it on the server, or sign it and verify the signature.
- Mass assignment. Binding a request body directly onto a model lets attackers set fields they should not, such as isAdmin or accountBalance.
- Third-party scripts. Scripts loaded from other domains run with full access to your page. Use Subresource Integrity hashes, self-host where possible, and limit sources with CSP.
- Signed updates and artifacts. Verify signatures or checksums of updates, packages, container images and other artifacts before you install or run them.
- Pipeline integrity. Protect the path from commit to production: protected branches, required reviews, and builds that only deploy reviewed code.
- Spot and fix. Spot an integrity flaw in a short code sample and propose a correct fix.
A09Security logging and alerting failures
Recording the right events, keeping secrets out of logs, and making sure someone notices an attack.
- Why it matters. Without good logging and alerting, attacks go unnoticed, often for months, and there is no record to investigate or recover from.
- What to log. Log security-relevant events (logins and failures, access control failures, validation failures, admin actions, changes to permissions and high-value transactions) with who, what, when and where.
- What not to log. Never log passwords, session tokens, API keys, full card numbers or other secrets, and be careful with personal data.
- Logs are output too. Logs can be attacked: user input with newlines can forge log entries, and logging libraries themselves can be vulnerable.
- Alerting and response. Logs only help if suspicious patterns trigger alerts that reach someone who will act, with thresholds tuned so real alerts are not lost in noise.
- Protecting logs. Send logs to a central place, protect them from tampering and deletion, keep them long enough to investigate, and keep clocks in sync.
- Incident response. Have an incident response plan that says who does what when an alert fires, and practise it.
- Spot and fix. Review a short piece of logging code and identify what is missing, what should not be logged, and how to fix it.
A10Mishandling of exceptional conditions
What your code does when things go wrong: failing safely, handling errors, and handling unexpected input.
- What this category is. This category covers how software behaves under errors, unexpected input and resource exhaustion. Poor handling can crash systems, leak information or skip security checks.
- Fail closed. When a security check cannot complete, because of an error or timeout, deny the action rather than allow it.
- Unchecked errors and return values. Ignoring errors and return values leaves the program in a state nobody planned for.
- Partial operations. An operation that fails half-way must not leave things inconsistent: use transactions and roll back, and release locks, files and connections.
- Error messages that leak. Errors shown to users must not include stack traces, queries, file paths or internal details; log those on the server instead.
- Resource exhaustion. Unexpected input can exhaust resources: huge request bodies, deeply nested data, regular expressions with catastrophic backtracking (ReDoS) and unbounded loops. Set limits and timeouts.
- Central error handling. Handle unexpected errors in one central place that logs the details, returns a safe generic response, and never swallows exceptions silently.
- Spot and fix. Spot an error-handling flaw in a short code sample and propose a correct fix.
The course follows the law and official guidance as we understand them, mainly for the UK and the EU. Laws change and we can make mistakes, so check important points against official sources and your organisation's own policies. The course is training, not legal advice.
Other courses
- Security awarenessThe everyday habits that stop phishing, scams, malware and data leaks, for everyone at work.
- GDPR and data protectionHow to handle personal data lawfully and safely under the GDPR, and what to do when people ask about their data or something goes wrong.
- Using AI at workHow to use AI tools productively and safely: what to share, how to check the results, the scams to watch for and the rules that apply.
- Preventing harassmentRecognising harassment and discrimination at work, stepping in as a bystander, and how to report and respond to concerns.
- Equality, diversity and inclusionWhat equality law protects, how bias affects decisions about people, how to make reasonable adjustments, and the everyday habits that help everyone take part.
- Preventing fraud and briberyHow to recognise fraud and bribery, what the UK duties to prevent them ask of organisations, how to handle gifts and conflicts of interest, and how to report concerns.
- AI governance and the EU AI ActWhat the EU AI Act asks of organisations that use AI, how to tell banned and high-risk uses apart, and how to buy and oversee AI systems responsibly.
- Performance conversationsHow to set clear expectations, give useful feedback, hold difficult conversations, manage underperformance fairly and run good reviews, with practice conversations.
- Safe screen work (DSE)How to set up a workstation, take breaks and look after your eyes when working at a screen, at the office, at home or on the move, and what the DSE rules require.