Start free →
Cybersecurity · Lesson 14
0 XP
Lesson 14 of 2010 minIntermediate

The OWASP Top 10.

OWASP is a global non-profit that publishes the most common and dangerous web application risks. Every web developer and security tester is expected to know this list. Today you'll understand each one with a simple example.

Your teacher says

You don't need to memorise the numbers. You need to understand the ideas. In an interview, explaining one risk clearly beats listing ten names.

The list (OWASP Top 10, 2021 edition)

#RiskIn one line
A01Broken Access ControlUsers can do or see things they shouldn't (like the IDOR from last lesson)
A02Cryptographic FailuresSensitive data not encrypted, or weak encryption
A03InjectionUser input is treated as a command (SQL injection, command injection)
A04Insecure DesignThe feature itself is unsafe, even if coded "correctly"
A05Security MisconfigurationDefault passwords, open admin panels, detailed error messages
A06Vulnerable and Outdated ComponentsUsing old libraries with known holes
A07Identification and Authentication FailuresWeak logins: no lockout, weak passwords, bad sessions
A08Software and Data Integrity FailuresTrusting updates or code that wasn't verified
A09Security Logging and Monitoring FailuresAttacks happen but nobody notices (Lesson 11!)
A10Server-Side Request Forgery (SSRF)Tricking the server into fetching internal resources

Deep dive 1: SQL injection

Databases are queried using a language called SQL. A login might check:

SELECT * FROM users WHERE roll = 'INPUT1' AND password = 'INPUT2';

If the code just glues user input into that sentence, an attacker can type special characters that change the meaning of the command, for example making the condition always true and logging in without a password.

The fix: never build SQL by gluing strings. Use parameterised queries (prepared statements), where input is always treated as data, never as part of the command.

Remember the analogy

It's like a waiter who reads out your order word-for-word to the kitchen, including "...and also give me the cash box". A good waiter (parameterised query) only passes the dish name, nothing more.

Deep dive 2: Cross-Site Scripting (XSS)

If a website shows user input on a page without cleaning it, an attacker can put JavaScript into, say, a comment. When other people view the page, that script runs in their browser, and can steal their session cookie (Lesson 13).

The fix: encode output (show <script> as text, never run it), validate input, use the HttpOnly cookie flag and a Content Security Policy.

Deep dive 3: Broken access control

The number one risk. Examples:

The fix: the server checks permissions on every request, for every object, and denies by default.

Quick check+10 XP

A comment box on a college blog shows comments exactly as typed, including HTML tags. Which risk is this most likely?

Unencoded user content shown to other users is the classic XSS setup.

Quick check+10 XP

A website still uses a 6-year-old version of a popular library with known vulnerabilities. Which category?

Old components with known holes are A06, and attackers scan for them automatically.

How companies find these problems

Final check+20 XP

What is the correct fix for SQL injection?

Parameterised queries separate commands from data. The other "fixes" don't work.

Your task (30 min, free)

Create a free account on PortSwigger Web Security Academy (portswigger.net/web-security). Read the first SQL injection topic and try the first "Apprentice" lab. It's a legal, safe place built for learning. If it feels hard, that's normal: come back after the Linux and HTTP lessons and try again.

Lesson 14 complete!

You know the OWASP Top 10 categories and can explain SQL injection, XSS and broken access control with examples. Next: cloud security basics.

Next: Cloud security basics →