Vulnerability priorities from Wazuh: EPSS and CISA KEV next to CVSS
How to rank CVEs from the wazuh-states-vulnerabilities index: indexer export, EPSS from the FIRST API, CISA KEV, a curl and jq script, and metric limits.
The vulnerability list from the Vulnerability Detection module is long, and CVSS severity alone does not say which of them anyone actually exploits. Two public sources add that signal: EPSS from FIRST (probability) and the KEV catalog from CISA (confirmed exploitation). Both can be joined with Wazuh data in one script.
What the three metrics measure
For every detected vulnerability, Wazuh stores vulnerability.severity and vulnerability.score.base. This is a rating of the flaw itself, with no information on whether anyone exploits it. EPSS and KEV answer that question from two different sides.
| Source | What it returns | Nature |
|---|---|---|
CVSS (field vulnerability.score.base) | flaw rating | description of the vulnerability’s characteristics |
| EPSS | epss from 0 to 1 and percentile | forecast for the next 30 days |
| CISA KEV | catalog entry, dateAdded, dueDate | confirmed past exploitation |
FIRST defines EPSS as a model that estimates the probability that a vulnerability will be exploited in practice within the next 30 days. The score is computed for every published CVE and updated daily. A score of 0.05 means a 5% estimated probability of observed exploitation activity in that window.
The percentile is a ranking against all scored vulnerabilities. The EPSS distribution is heavily skewed toward zero, so FIRST states that a probability of 0.10 currently sits around the 95th percentile. The mean EPSS is about 2.8%, the median about 0.7%. With such a distribution, thresholds like 50% would cover very few CVEs.
The KEV catalog works differently. An entry appears when the CVE has an assigned ID, there is reliable evidence of active exploitation, and the remediation action is clear. Scanning, research and a proof of concept alone do not count as exploitation. CISA recommends treating KEV as an input to your own prioritization process.
Fields on the Wazuh side
Vulnerability data lives in indices matching wazuh-states-vulnerabilities*. The Wazuh documentation shows a term query on the vulnerability.id field, and the example document contains the fields from the table below.
| Field | Example value from the documentation |
|---|---|
vulnerability.id | CVE identifier |
vulnerability.severity | High |
vulnerability.score.base | 8.8 |
vulnerability.score.version | CVSS version |
package.name | package name |
package.version | package version |
agent.id, agent.name | agent identification |
The document ID is made of the agent ID, a hash and the CVE identifier, so one CVE appears in the index once for every agent and package pair where it was detected. This matters for aggregation: the doc_count of a bucket is the number of state documents, not the number of unique hosts.
How detection works is covered in the post Vulnerability Detection in Wazuh. If state indices disappear, check the retention policy and whether its name pattern covers wazuh-states-*.
Step 1: unique CVEs from the indexer
The Wazuh documentation shows an indexer call through curl with the -u option and credentials from the environment variables WAZUH_INDEXER_USER and WAZUH_INDEXER_PASS, plus a terms aggregation with results read through jq. The variant below adds a max aggregation on the CVSS field. The address indexer.example.com is an example.
# Illustration: synthetic host name, credentials from the environment.
# -k skips certificate verification: lab shortcut only, in production use --cacert with the indexer CA.
IDX="https://indexer.example.com:9200"
curl -s -k -u "$WAZUH_INDEXER_USER:$WAZUH_INDEXER_PASS" \
-H "Content-Type: application/json" \
-X POST "$IDX/wazuh-states-vulnerabilities*/_search" -d '{
"size": 0,
"aggs": {
"cves": {
"terms": { "field": "vulnerability.id", "size": 1000 },
"aggs": { "cvss": { "max": { "field": "vulnerability.score.base" } } }
}
}
}' > cves.json
# One line per CVE: id, number of state documents, highest CVSS base score.
jq -r '.aggregations.cves.buckets[] | [.key, .doc_count, .cvss.value] | @tsv' \
cves.json > cves.tsv
The default size of a terms aggregation is 10, so an explicit size is required. With more unique CVEs, use a composite aggregation and pass after_key as after to the next page.
Step 2: EPSS in batches
The endpoint https://api.first.org/data/v1/epss accepts a cve parameter with multiple comma-separated values. The maximum size of this parameter is 2000 characters including commas. FIRST describes the API as a tool for looking up single CVEs or small batches, not for bulk download. The public limit is 1000 requests per minute, and anything over that ends with a 429 response.
The response has an envelope with the fields status, total, offset, limit and a data array, where each element contains cve, epss, percentile and date. The numeric values are written as strings, for example "0.972240000". In the example response limit is 100, and the global parameter accepts values from 0 to 10000. The script sets limit=100 explicitly, so a batch should not exceed 100 identifiers.
# 80 ids per request keeps the cve parameter below 2000 characters.
cut -f1 cves.tsv | xargs -n 80 | tr ' ' ',' | while read -r batch; do
curl -s "https://api.first.org/data/v1/epss?cve=${batch}&limit=100"
sleep 1 # sequential requests, well below the documented rate limit
done | jq -r '.data[] | [.cve, .epss, .percentile] | @tsv' > epss.tsv
For a very large set, FIRST points to a daily CSV file at https://epss.empiricalsecurity.com/epss_scores-current.csv.gz. It contains the fields cve, epss and percentile. The address redirects, so curl needs the -L option. Since model version 2, the file starts with a comment row prefixed with #, which you must skip on import.
Step 3: the KEV catalog
The JSON feed is available at https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json. The root object contains catalogVersion, dateReleased, count and a vulnerabilities array. The JSON schema describes the entry fields.
| Field | Meaning according to the schema |
|---|---|
cveID | identifier in the format CVE-YYYY-NNNN |
vendorProject, product | vendor and product |
vulnerabilityName | vulnerability name |
dateAdded | date added to the catalog |
dueDate | deadline for the required action |
requiredAction | required action |
knownRansomwareCampaignUse | Known or Unknown |
forensicTriage | Yes or No per BOD 26-04 |
cwes | list of CWE codes |
The dueDate field comes from requirements for US federal agencies. CISA recommends that all organizations take KEV into account, but the deadline is a date from the catalog, not your deadline.
curl -sL https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json \
| jq -r '.vulnerabilities[] | [.cveID, .dueDate, .knownRansomwareCampaignUse] | @tsv' \
> kev.tsv
Step 4: the sorted list
Join the three files and sort: KEV first, then EPSS percentile descending, then CVSS descending. A missing EPSS gets 0, which is a decision of the script, not a fact about the CVE.
awk -F'\t' -v OFS='\t' '
FILENAME=="kev.tsv" { kev[$1]=$2; next }
FILENAME=="epss.tsv" { ep[$1]=$2; pc[$1]=$3; next }
{ print $1, ($1 in kev ? "KEV" : "-"), ($1 in kev ? kev[$1] : "-"),
($1 in ep ? ep[$1] : 0), ($1 in pc ? pc[$1] : 0), $3, $2 }
' kev.tsv epss.tsv cves.tsv \
| LC_ALL=C sort -t "$(printf '\t')" -k2,2r -k5,5gr -k6,6gr > priorities.tsv
The output columns are, in order: CVE, KEV marker, dueDate, EPSS, percentile, CVSS, number of state documents. LC_ALL=C is needed because sort -g reads numbers according to the locale, and in the Polish locale the comma is the decimal separator, so the value 0.97 would be read as 0. A test on synthetic data (four fictional identifiers from the CVE-2099 range) gave this order: the KEV entry on top, then the item with percentile 0.97, then 0.60, and the CVE with no EPSS score last despite CVSS 9.1.
Missing EPSS data does not mean low risk, so review such items separately.
Recommended priority policy
This is a design recommendation, not a requirement of any vendor.
| Level | Condition | Action |
|---|---|---|
| P1 | CVE in KEV and present in the index | fix or mitigation first, regardless of EPSS |
| P2 | not in KEV, EPSS percentile at 0.90 or higher | remediation queue by CVSS and host exposure |
| P3 | the rest with CVSS High or Critical | scheduled package update |
| P4 | everything else | regular update cycle |
The rationale for P1 comes from FIRST: the rule of thumb says to treat a KEV entry as actively exploited regardless of EPSS. A low EPSS with a KEV entry is not a contradiction, because one is history and the other is a forecast.
The P2 threshold is a starting point. FIRST states that the equivalent of the CVSS Critical threshold is roughly the 90th percentile (an EPSS value of at least 0.04), and CVSS High and above corresponds to about 0.008. It also stresses that this is a starting point for programs migrating from a CVSS-based approach, and that setting the threshold is a local matter, refined over time.
Use the three checks that FIRST calls localizing the score: presence, reachability and consequences. A high score for a flaw you do not have means nothing. A flaw that is present but not reachable from the attacker’s network has lower urgency. Correlation with asset data is covered in the post CVE correlation with asset inventory.
Limits of the metrics
- EPSS does not measure the consequences of a successful attack or the impact on your environment. FIRST says outright that it is not a full risk assessment.
- Do not multiply EPSS by CVSS. FIRST lists this as a mistake: the product of a probability and an ordinal scale has no interpretable meaning.
- A low score does not mean safety. At 5% probability, among hundreds of similar flaws some will be exploited.
- The score changes daily, so an EPSS saved in a report is a snapshot from one day. Store the download date together with the value.
- Every model version change shifts the scores. FIRST lists versions 1 to 5, and the latest published is v2026.06.15. Comparisons over time across a version boundary measure a change of methodology.
- KEV contains only vulnerabilities with confirmed exploitation, an assigned CVE and a known fix. No entry does not mean no attacks.
- EPSS in aggregate: the expected number of exploited flaws is the sum of the probabilities, and the chance of at least one is 1 minus the product of (1 minus p). The formula assumes roughly independent events.
What the documentation does not specify
- The Wazuh documentation does not describe built-in enrichment with EPSS or KEV.
- The Wazuh documentation does not say whether
vulnerability.idhas a mapping that allows atermsaggregation. The documentation example uses only atermquery, so before using the script, check the mapping in your indexer. - The description of the
publicscope in the FIRST API lists thecreatedfield, while the example response containsdate. The script reads onlycve,epssandpercentile. - The documentation does not give the refresh frequency of the KEV JSON file.
Sources
- https://www.first.org/epss/faq
- https://www.first.org/epss/data
- https://www.first.org/epss/using-epss
- https://api.first.org/epss
- https://api.first.org/
- https://www.cisa.gov/known-exploited-vulnerabilities-catalog
- https://www.cisa.gov/known-exploited-vulnerabilities
- https://raw.githubusercontent.com/cisagov/kev-data/main/known_exploited_vulnerabilities_schema.json
- https://documentation.wazuh.com/current/user-manual/indexer-api/use-case.html
- https://documentation.wazuh.com/current/user-manual/capabilities/vulnerability-detection/how-it-works.html
- https://docs.opensearch.org/latest/aggregations/bucket/terms/
- https://docs.opensearch.org/latest/aggregations/bucket/composite/
- https://docs.opensearch.org/latest/aggregations/metric/maximum/