In simple words
- Threat: something that could harm a system, such as an attacker stealing data.
- Vulnerability: a weakness an attacker could use.
- CIA triad: the three goals of security: confidentiality (secret), integrity (not changed) and availability (working).
- OWASP Top 10: a widely used list of the ten most serious web application risks.
- Injection: untrusted input being run as code or a query, such as SQL injection.
Big picture
Before you can defend something, you need to know how it gets attacked. The OWASP Top 10 is a list of the most common and serious web application risks, written by a community of security experts. It is the standard starting point for developers and testers.
Think of it as the "most common ways a burglar gets in": unlocked doors, weak locks, a spare key under the mat. Fixing those first stops most attacks.
Key words, in plain language
| Word | Plain meaning |
|---|---|
| Threat | Something that could cause harm (an attacker, a mistake) |
| Vulnerability | A weakness that a threat can use |
| Exploit | The method or code that uses a vulnerability |
| Risk | How likely harm is, times how bad it would be |
| Attack surface | Everything an attacker can reach: ports, APIs, forms, dependencies |
| CVE | A public ID for a known vulnerability, like CVE-2021-44228 |
| CVSS | A score from 0 to 10 for how severe a vulnerability is |
The CIA triad
Every security goal fits one of three ideas:
- Confidentiality: only the right people can see the data.
- Integrity: data is not changed in secret.
- Availability: the system works when people need it.
The OWASP Top 10 (2021 edition)
OWASP updates the list every few years. Check owasp.org for the current version. The 2021 list is still the most widely used.
| # | Risk | In plain words | Example |
|---|---|---|---|
| A01 | Broken access control | Users can do or see what they should not | Changing /orders/101 to /orders/102 shows someone else's order |
| A02 | Cryptographic failures | Sensitive data is not protected well | Passwords stored in plain text, or HTTP instead of HTTPS |
| A03 | Injection | Input is run as a command | ' OR 1=1 -- in a login form |
| A04 | Insecure design | The design itself is unsafe | No limit on password guesses |
| A05 | Security misconfiguration | Unsafe settings or defaults | Admin console open to the internet, debug mode on |
| A06 | Vulnerable and outdated components | Old libraries with known holes | An unpatched logging library |
| A07 | Identification and authentication failures | Weak login or sessions | No MFA, guessable session ids |
| A08 | Software and data integrity failures | Trusting unsigned code or data | Installing updates with no signature check |
| A09 | Logging and monitoring failures | Attacks go unseen | No alert on 500 failed logins |
| A10 | Server-side request forgery (SSRF) | The server is tricked into fetching internal URLs | Reaching the cloud metadata address |
Injection, step by step
This is the classic example. The code builds a query from user input:
query = "SELECT * FROM users WHERE name = '" + name + "'"If an attacker sends ' OR '1'='1, the query becomes:
SELECT * FROM users WHERE name = '' OR '1'='1'That returns every user. The fix is a parameterized query, where input is always treated as data and never as code:
cursor.execute("SELECT * FROM users WHERE name = %s", (name,))Broken access control, in a quick test
curl -s -H "Authorization: Bearer $ALICE_TOKEN" https://shop.example.com/api/orders/102{"id":102,"owner":"bob","total":84.50}Alice asked for Bob's order and got it. The server checked that Alice is logged in, but not that she owns order 102. The fix is to check ownership on the server for every request.
How these map to the pipeline
| Risk | Best early check |
|---|---|
| Injection, XSS | SAST (lesson 05), code review |
| Vulnerable components | SCA (lesson 06) |
| Misconfiguration | IaC scanning (08), policy as code (12) |
| Broken access control | Tests, DAST (14), API tests (15) |
| Logging failures | Runtime monitoring (16) |
| Integrity failures | Signing and supply chain (13) |
Common mistakes
- Thinking the list is a checklist you finish. It is a guide to the most common risks.
- Trusting the client. Never rely on checks done only in the browser.
- Hiding things as the only defense ("nobody knows this URL").
- Ignoring non-web risks. Cloud, containers and pipelines have their own lists.
Summary
- A threat uses a vulnerability to cause a risk.
- Protect confidentiality, integrity and availability.
- The OWASP Top 10 lists the most common web risks, led by broken access control and injection.
- Each risk has a best early check in the pipeline.
CHECK YOUR UNDERSTANDING
3 quick questions
1. Which OWASP Top 10 (2021) risk is first on the list?
2. What is the best fix for SQL injection?
3. Alice requests /orders/102, which belongs to Bob, and the server returns it. What is wrong?
You've finished the free preview of DevSecOps
Upgrade to Pro to unlock the remaining 20 lessons, every practice lab and a certificate when you finish.
See plans