What is a vulnerability?
A vulnerability is a weakness that someone could use to cause harm: a coding flaw in an application, an operating system missing a patch, a default password, a storage bucket left public, a firewall rule that allows too much, or a process step nobody checks. A vulnerability does nothing on its own. It becomes dangerous when a threat, such as an attacker, malware or a careless insider, can reach it and has a way to take advantage of it.
Vulnerabilities exist at every layer: software and firmware, hardware, configuration, cloud settings, identities and accounts, and people and processes. Patching, hardening, secure coding and vulnerability management all exist to find and reduce them.
Vulnerability vs. threat vs. exploit vs. risk
| Term | Meaning | Example |
|---|---|---|
| Vulnerability | The weakness | An internet-facing VPN appliance missing a critical patch |
| Threat | Who or what could cause harm | A ransomware group scanning the internet for that flaw |
| Exploit | The code or technique that uses the weakness | A public script that opens a shell on the appliance |
| Risk | How likely the threat is to succeed, weighed by the damage | High: likely, and the appliance leads into the internal network |
Risk needs both a threat and a vulnerability, so removing either one lowers it. A flaw that no threat can reach, such as one in a service on an isolated network, carries little risk, and so does a determined threat with nothing to exploit. Patching removes the vulnerability; segmentation, MFA and monitoring lower the likelihood or the impact while a fix is pending.
Types of vulnerabilities
- Application: injection flaws, buffer overflows, race conditions, hardcoded secrets, unsafe error handling and malicious updates.
- Operating system and firmware: flaws in kernels, drivers and built-in services.
- Life cycle: systems that are unsupported, unpatched, obsolete or unmanaged, so they get no fixes or no oversight.
- Zero-day: a flaw attackers know about before any patch exists.
- Virtualization: VM escape and leftover data in reused resources.
- Cryptographic: weak algorithms, old protocol versions, poor key handling and weak random number generation.
- Configuration: default credentials, unneeded open ports and services, exposed admin interfaces and overly broad rules.
- Accounts and devices: stale credentials, rogue devices and shadow IT.
- Newer attack surfaces: identity providers, public code repositories, public object storage, mobile devices, wireless radios and large language models.
How vulnerabilities are named and scored
A publicly disclosed vulnerability receives a CVE identifier, such as CVE-2021-44228 for Log4Shell, the remote code execution flaw in the Apache Log4j logging library. A CVE names one specific flaw in specific products. CWE (Common Weakness Enumeration) names the category of mistake behind a flaw, such as CWE-89 for SQL injection. CVSS (Common Vulnerability Scoring System) rates technical severity from 0.0 to 10.0, and Log4Shell received the maximum base score of 10.0. NIST's National Vulnerability Database adds scores and affected-product data to CVE records, and CISA's Known Exploited Vulnerabilities catalog lists flaws seen exploited in real attacks.
Finding and fixing vulnerabilities
Vulnerability management is a continuing cycle of finding, prioritizing, fixing and verifying. Organizations find weaknesses with credentialed and non-credentialed scans, agents, code analysis, penetration tests, bug bounty programs and threat intelligence. They prioritize by combining the CVSS score with context: whether the system faces the internet, whether the flaw is being exploited, and how important the asset is. Then they patch, reconfigure or add compensating controls such as segmentation when no fix is possible, and rescan to confirm the fix worked. A vulnerability that is left in place is documented as an accepted risk with an owner and a review date.
Vulnerability on the CompTIA Security+ exam
Vulnerability types and attack surfaces are SY0-801 objective 2.4. Objective 2.1 covers how vulnerabilities are identified and rated, including CVE identifiers and CVSS scores, and objective 4.3 covers vulnerability management, from scanning to remediation and verification. Many questions describe a weakness and ask for its type: a server past end of support is unsupported, a system with an available but uninstalled patch is unpatched, a device nobody approved is a rogue device, and a flaw with no patch yet is a zero-day. Others test the vocabulary: the weakness is the vulnerability, the actor or event is the threat, the code is the exploit, and likelihood combined with impact is the risk. A common distractor swaps threat and vulnerability, so check whether an answer describes something about your own systems or something acting against them.