# Vulnerability vs exploit vs threat vs risk: what is the difference?

Canonical: https://hackergpt.org/learn/vulnerability-exploit-threat-risk/

**A vulnerability is a weakness that could be used to cause harm; an exploit is the code or steps that actually use it; a threat is anyone or anything that could use it against you; and risk is how likely that is to happen multiplied by how bad the result would be.**

Part of the roadmap: [Stage 1, Foundations](https://hackergpt.org/learn/roadmap/#foundations)

## Why it matters

Advisories, pentest reports and job interviews use these four words precisely, and mixing them up changes the meaning of a sentence. 'We have a critical vulnerability' and 'we have a critical risk' are different claims: the first is about the code, the second also takes in who can reach it and what it would cost.

The formal definitions come from US government standards collected in the NIST glossary. FIPS 200 defines a vulnerability as a weakness in a system, its procedures, controls or implementation 'that could be exploited or triggered by a threat source', and a threat as any circumstance or event with the potential to harm an organisation through a system. Risk, in NIST's wording from OMB Circular A-130, is typically a function of the adverse impact if the event occurs and the likelihood that it occurs. An exploit has no standard entry of its own; in practice it means the specific input, script or sequence of requests that turns a vulnerability into an effect.

The distinction also tells you what to fix. You remove a vulnerability with a code or configuration change. You cannot remove a threat, but you can reduce exposure, so fewer threats can reach the weakness. You lower risk by doing either, or by limiting the impact.

## Example: the four words on one CyberGym bug

CyberGym, the legal practice target, has a basket endpoint that returns a basket by its number without checking whose it is. Tested with two accounts you create yourself, A and B, the four words separate cleanly:

```
Vulnerability  GET /rest/basket/<id> loads any basket by id, no ownership check (IDOR, CWE-639)
Exploit        log in as B, request A's basket id, read A's items
Threat         any logged-in user, including one who signed up a minute ago
Risk           likelihood: high (one edited number, any account)
               impact: on a real shop, every customer's basket and order history
```

On your own app, write the same four lines for each finding before you decide what to do with it. The vulnerability line names the fix. The threat line tells you who can reach it today, which is often everyone on the internet. The risk line is what you use to decide what to fix first, together with a CVSS score if the finding has one.

## Common mistakes

- **Calling every finding a risk.** A risk needs a threat that can reach the weakness and an impact. A bug behind a VPN nobody can reach is still a vulnerability, with a lower risk.
- **Thinking 'no public exploit' means 'safe'.** Many web bugs need no published exploit: editing one number in a request is the exploit.
- **Using 'threat' for the bug itself.** The threat is the actor or event, such as a curious user or an automated scanner, not the flaw.
- **Reading a CVSS score as the risk.** CVSS rates severity. Your exposure and what the data is worth decide the risk to you.

## Related terms

- [CVE](https://hackergpt.org/learn/cve/)
- [CVSS](https://hackergpt.org/learn/cvss/)
- [CWE](https://hackergpt.org/learn/cwe/)
- [CISA KEV catalog](https://hackergpt.org/learn/cisa-kev/)

## Go deeper

- [IDOR vulnerability example: find it and fix it](https://hackergpt.org/blog/idor-vulnerability-example/)
- [Pentest report example: how to write up a finding](https://hackergpt.org/blog/pentest-report-example/)
- [How to learn hacking on a real target, legally](https://hackergpt.org/blog/how-to-learn-hacking/)
- [CyberGym: a legal target to practise on](https://hackergpt.org/features/cybergym/)

## Sources

- [NIST CSRC Glossary: vulnerability](https://csrc.nist.gov/glossary/term/vulnerability)
- [NIST CSRC Glossary: threat](https://csrc.nist.gov/glossary/term/threat)
- [NIST CSRC Glossary: risk](https://csrc.nist.gov/glossary/term/risk)
- [NIST SP 800-30 Rev. 1: Guide for Conducting Risk Assessments](https://csrc.nist.gov/pubs/sp/800/30/r1/final)

Test only sites you own or have written permission to test. To practise without one, use CyberGym, a legal, deliberately vulnerable target. [Practise on CyberGym](https://cybergym.hackergpt.app).
