---
title: "Data & Methods"
subtitle: "Sources, cohort definition and observation window"
---
```{r load}
#| include: false
source("R/00_setup.R")
source("R/01_data.R")
source("R/02_core.R")
```
This page documents the data behind [the main analysis](index.qmd): where each source comes from, how the survival cohort is built, how the edge-vendor flag was frozen, and how long the cohort has been observed. How to rerun everything is on [Reproducibility](reproducibility.qmd).
::: {.callout-note icon="false"}
## Why Survival Analysis?
The clock starts at NVD publication and stops at KEV listing. A CVE unlisted today contributes follow-up time but no event (right-censoring). Most CVEs are never listed, so models separate whether a CVE is ever listed from how soon (a cure fraction).
:::
## Data and cohort {#data-and-cohort}
All sources are public and pinned to dated snapshots in `data/`, so every render is identical. The Kaggle file's own `cisa_kev` flag is FALSE for every row and is not used.
| Source | File | Role |
|:----------------|:-------------------------------------|:------------------------------|
| Kaggle NVD file | cve_cisa_epss_enriched_dataset.csv | CVSS v3 metrics, publication dates, cutoff (`r snap`) |
| CISA KEV | kev_2026-10-02.json | Listing dates (the event) |
| FIRST EPSS archive | epss_at_publication_2026-10-03.csv.gz | EPSS score and percentile at publication |
| CNA-provided CVSS | cna_cvss_sample_2026-10-03.csv | Check on the NVD score (all listed CVEs plus 20,000 unlisted) |
| Exploit-DB, CVE.org | exploitdb_*.csv, cveorg_*.csv | Earlier-signal and alternative-clock checks |
| Corpus file | cve_corpus.csv | Vendor (first CPE) and weakness classes |
The cohort is CVEs published from 1 November 2021 (the BOD 22-01 start) with a 2021-or-later identifier and CVSS v3 data. The cutoff is the latest NVD publication date in the Kaggle file, and KEV listings after it are censored. Event dates come only from the dated KEV feed. Time runs from NVD publication, and a CVE listed on or before publication is kept at t = 0 and flagged, not shifted. The cohort holds `r fmt_n(hm$n_total)` CVEs, of which `r fmt_n(hm$n_events)` were listed by the cutoff. A further `r cvss_missing$n` CVEs lacked CVSS metrics and were dropped.
A product-class flag marks CVEs whose first CPE vendor is on a list of network and security appliance makers. The rule: vendors with at least three KEV listings from November 2021 through 2023 whose listed products are mostly firewalls, VPN or remote-access gateways, application delivery controllers, routers or switches. The list was frozen before any later data were examined, so the out-of-time test in [Does the Ranking Hold Up?](index.qmd#ranking) on the main page can check it fairly. Vendor comes from the first CPE entry and weakness classes from the CWE identifiers in the corpus file; both are approximations.
EPSS enters only as the score and percentile on the publication date (or the next day) from FIRST's archive, never the Kaggle point-in-time score, which postdates exploitation. Even so, it can reflect exploitation known at publication, so results are also shown for post-disclosure listings. EPSS model versions change over time, so the analysis uses the within-day percentile, and `r fmt_pct(epss_cover$with_epss / epss_cover$all, 1)` of cohort CVEs have a score.
The denominator matters for how to read every rate. It contains only CVEs that carry NVD CVSS v3 metrics, so CVEs scored under other schemes, or not scored, are absent, and the listed CVEs missing from the Kaggle file cannot be added back. Incidence figures are therefore floors for the full NVD population, and they describe CVEs published since late 2021, not the older backlog that scanners still report.
```{r reconciliation-table}
recon_tbl |>
gt() |>
tab_header(
title = md("**KEV Feed Reconciliation**"),
subtitle = paste0("KEV snapshot retrieved ", kev_retrieved, "; observation cutoff ", snap)
) |>
cols_label(Step = md("**Step**"), Count = md("**CVEs**")) |>
fmt_number(columns = Count, decimals = 0) |>
cols_align(align = "left", columns = Step) |>
gt_house()
```
**How to read the table.** Each row is one step in accounting for every entry in the CISA KEV catalog snapshot. Indented rows split the row above them. The first block follows the catalog entries into or out of the analysis; the later rows check the Kaggle file's own KEV flag and count CVEs dropped for missing severity data. The last column is a count of CVEs.
**What the table tells you.** Every catalog entry is accounted for. Of `r fmt_n(nrow(kev_recon))` entries, `r fmt_n(sum(kev_recon$in_cohort))` fall inside the analysis cohort and `r fmt_n(hm$n_events)` of those were listed by the cutoff; most of the rest were published before November 2021. Only `r sum(!kev_recon$in_kaggle)` entries are missing from the Kaggle file, and its own KEV flag is never set, so listing dates come only from CISA's feed.
KEV entries absent from the Kaggle file, and CVEs without CVSS v3 data, lie outside the denominator, so incidence is a floor.
```{r edge-list-table}
edge_check |>
rename(`KEV vendorProject` = vendor) |>
gt() |>
tab_header(
title = md("**Frozen edge and network-appliance vendor list**"),
subtitle = "KEV listings dated 2021-11-01 to 2023-12-31 for the vendors on the list (Pulse Secure is an alias of Ivanti)"
) |>
cols_align(align = "left", columns = 1) |>
gt_house()
```
**How to read the table.** Each row is a vendor on the frozen list of edge and network-appliance makers: firewalls, VPN gateways, routers and similar products that sit at the network boundary. The count is how many of that vendor's CVEs CISA listed between November 2021 and December 2023, the only period used to build the list. Pulse Secure appears separately because it is an older name for some Ivanti products.
**What the table tells you.** `r edge_check$vendor[1]` dominates, with `r edge_check[[2]][1]` listings, more than the next four vendors combined (`r sum(edge_check[[2]][2:5])`). Because the list was fixed using data up to 2023 only, the later test on CVEs published from 2024 is a fair check of whether the flag predicts listing. A list chosen after seeing the later data would have looked better than it really is.
The edge flag covers `r fmt_n(edge_summary$n_edge)` CVEs (`r fmt_pct(edge_summary$n_edge / edge_summary$n, 0.1)`) and `r fmt_pct(edge_summary$ev_edge / edge_summary$ev, 0.1)` of listings. It uses only the first CPE vendor, so it approximates product class.
## Survival cohort data and column guide {#cohort-data}
```{r display-reactTable}
#| echo: false
reactable(
head(select(survival_cohort, cve_id, pub_date, base_score, attack_vector, attack_complexity, privileges_required, user_interaction, kev_date, event, delta_days, kev_on_or_before_nvd, t_all, edge, epss_pub_pct), n = 50),
highlight = TRUE,
striped = TRUE,
defaultColDef = colDef(
headerStyle = list(
textAlign = "center",
lineHeight = "12px",
textTransform = "uppercase",
color = "black",
fontWeight = "400",
borderBottom = "2px solid grey50",
paddingBottom = "3px",
verticalAlign = "bottom"
)
),
class = ".react_table",
theme = reactableTheme(
borderColor = "#dfe2e5",
stripedColor = "#f6f8fa",
style = list(fontSize = "11px", fontFamily = "Roboto, Helvetica, Arial, sans-serif"),
searchInputStyle = list(width = "100%")
)
)
```
**How to read the table.** Each row is one CVE in the analysis; the table shows the first 50 of `r fmt_n(hm$n_total)`. Columns give the publication date, the CVSS severity score and its parts, the KEV listing date if any, whether the CVE was listed by the cutoff (event = 1), the days elapsed, the edge-vendor flag and the EPSS percentile at publication. The guide below explains every column, and clicking a header sorts the table.
**What the table tells you.** This is the raw material of the survival analysis: one row per CVE, a start date, and either a listing date or none. Most rows have no listing date, because only about `r round(hm$pct_event * 1000)` in 1,000 CVEs are listed. Those CVEs are kept and counted as "not yet listed" up to the cutoff rather than dropped. The rows are simply the first 50 in the file, not a representative sample.
::: {.callout-note collapse="true" icon="false"}
## Guide to Survival Cohort Data Columns (Click to Expand)
**cve_id:** The standardized Common Vulnerabilities and Exposures identifier.
**cve_year:** The four-digit year from the identifier, used to filter out legacy CVEs.
**pub_date:** The NVD publication date. This is the time origin.
**attack_vector, attack_complexity, privileges_required, user_interaction:** CVSS v3 categorical metrics. `NETWORK` means the flaw is reachable over a network. It does not mean the affected system is exposed to the internet.
**base_score:** The CVSS v3 base score (0 to 10).
**kev_date:** The date CISA added the CVE to the KEV catalog, from the pinned feed. It is `NA` for CVEs not in the feed.
**event:** 1 if the CVE was listed in KEV on or before the cutoff (`r snap`), otherwise 0 (right-censored). Listings after the cutoff are censored.
**delta_days:** Days from NVD publication to the KEV listing (events) or to the cutoff (censored CVEs). It can be zero or negative for listings on or before the NVD publication date.
**kev_on_or_before_nvd:** 1 if the CVE was listed in KEV on or before its NVD publication date. This is a statement about the NVD clock. It is not evidence of a true zero-day.
**edge:** 1 if the first CPE vendor is on the frozen list of edge and network-appliance vendors (defined in [Data and cohort](#data-and-cohort)).
**epss_pub_pct:** The EPSS percentile on the CVE's publication date (or the next day when it was not yet scored). `NA` when the CVE has no score in that window.
**t_all:** `delta_days` floored at zero, used for cohort-wide curves where pre-disclosure listings form a point mass at day 0.
:::
## Observation window {#observation-window}
Survival estimates are only informative where the cohort has been observed long enough. The table below describes that observation window, which is set by publication dates and the cutoff. Potential follow-up is summarized with the *reverse* Kaplan-Meier, which treats reaching the cutoff as the event of interest.
```{r followup-table}
fu_fit <- survfit(Surv(delta_days, 1L - event) ~ 1, data = survival_cohort)
fu_q <- quantile(fu_fit, probs = c(0.25, 0.5, 0.75))
fu_tbl <- tibble(
Block = "Potential follow-up (reverse Kaplan-Meier)",
Statistic = c("25th percentile", "Median", "75th percentile"),
Days = fu_q$quantile,
Lower = fu_q$lower,
Upper = fu_q$upper
)
cens_dur <- survival_cohort |> filter(event == 0L) |> pull(delta_days)
cens_tbl <- tibble(
Block = "Observed time, CVEs not yet listed",
Statistic = c("Minimum", "25th percentile", "Median", "Mean", "75th percentile", "Maximum"),
Days = c(min(cens_dur), quantile(cens_dur, 0.25), median(cens_dur), mean(cens_dur), quantile(cens_dur, 0.75), max(cens_dur)),
Lower = NA_real_,
Upper = NA_real_
)
followup_median <- fu_q$quantile[2]
bind_rows(fu_tbl, cens_tbl) |>
gt(groupname_col = "Block") |>
tab_header(
title = md("**Observation Window (Follow-up)**"),
subtitle = "Days from NVD publication to listing (events) or cutoff (censored)"
) |>
cols_label(
Statistic = md("**Statistic**"),
Days = md("**Days**"),
Lower = md("**95% CI low**"),
Upper = md("**95% CI high**")
) |>
fmt_number(columns = c(Days, Lower, Upper), decimals = 1) |>
sub_missing(columns = c(Lower, Upper), missing_text = "") |>
cols_align(align = "left", columns = Statistic) |>
gt_house()
```
**How to read the table.** The table has two blocks, both in days. The first gives potential follow-up: how long CVEs in the cohort could be watched for a listing, from publication to the cutoff, at the 25th, 50th and 75th percentiles with 95% intervals. The second gives the time actually observed so far for CVEs not yet listed, which depends mostly on how many CVEs were published at each point in time.
**What the table tells you.** A typical CVE could be watched for `r round(followup_median)` days (about `r round(followup_median / 30.4)` months), and three in four for at least `r round(fu_q$quantile[1])` days, so listing patterns over the first year are well measured. These figures describe how long the cohort has been observed, not how long CVEs go unlisted: most CVEs are never listed and are simply still being watched at the cutoff.
```{css, echo = FALSE}
/* CSS - Styles for the main-table container, title, and subtitle */
.react_table {
padding-top: 5px;
padding-bottom: 5px;
padding-left:5px;
padding-right: 5px;
max-height:600px;
}
.react-title {
font-size: 1.25rem;
font-weight: 600;
}
body { /* default css for document body: includes table if column fontSize not selected */
font-size: 14px;
font-weight: 400;
}
/* Normalize callout notes to match standard body text */
.callout,
.callout-body,
.callout p {
font-size: 0.83rem !important; /* or 15px */
line-height: 1.5 !important;
}
/* Ensure callout titles are proportional and not oversized */
.callout-header,
.callout-title {
font-size: 0.83rem !important;
font-weight: 600 !important;
}
/* css web colors red: #ff0000 blue: #0000ff green: #008000 white: #ffffff
gray: #808080 Black: #000000 yellow: #ffff00 navy: #000080
Gainsboro: #dcdcdc, MediumSeaGreen: #3cb371, Orange: #ffa500, Tomato: #ff6347,
LightGray: #d3d3d3 */
```