TL;DR
This paper introduces a novel, automated method to accurately measure the "lifetime" of vulnerabilities in Free and Open Source Software (FOSS). They found that vulnerabilities, on average, persist in code for about 4 years, with significant variation across projects, and that this lifetime is closely tied to the overall age of the codebase.
What Problem Does This Paper Address?
Understanding how long software vulnerabilities remain in code (their "lifetimes") is crucial for assessing software security and maturity. While the concept of a vulnerability lifecycle is well-established, accurately measuring the code lifetime – the period from introduction to fixing – has been a significant challenge. Previous approaches were either limited in scale due to manual effort or only provided lower bounds on lifetimes. This paper aims to bridge this gap by providing a scalable, automated method for precise vulnerability lifetime estimation.
Methods
The core of the paper is a new heuristic approach for estimating vulnerability lifetimes. Instead of trying to pinpoint the exact commit that introduced a vulnerability (which is extremely difficult), they leverage the git blame command. Their method, an evolution of the VCCFinder heuristic, analyzes the commits associated with a fixing commit to estimate the introduction date. This involves:
- Identifying "interesting" changes: They filter out changes to tests, comments, and non-code files.
- Blaming lines: They use
git blame -wto find the commit that last modified each relevant line of code in a fixing commit. This includes lines removed, and lines added around function definitions or containing specific keywords. - Weighted average: They calculate an estimated introduction date by taking a weighted average of the dates of these "blamed" commits. The weights are based on how frequently each commit was blamed. This approach aims to provide a more robust estimate than simply taking the earliest blamed commit.
They rigorously validate this heuristic against a ground truth dataset of manually mapped vulnerability introduction and fixing commits.
Datasets
The study utilizes two primary datasets:
- Ground Truth Dataset: A manually curated dataset of 1,171 mappings between CVEs and their Vulnerability Contributing Commits (VCCs). This dataset was compiled from high-quality sources like the Ubuntu CVE Tracker, the Vulnerability History Project, and the Linux Kernel CVEs project. This dataset is crucial for validating their automated heuristic.
- Large-Scale Dataset: A dataset of 5,914 CVEs across 11 popular FOSS projects (Linux kernel, Firefox, Chromium, Wireshark, PHP, FFmpeg, OpenSSL, Httpd, Tcpdump, Qemu, Postgres). For these CVEs, they were able to link at least one fixing commit. This dataset is used for the main empirical analysis of vulnerability lifetimes.
Key Insights and Ideas
- Vulnerabilities have long lives: The most striking finding is that vulnerabilities tend to linger in code for a substantial amount of time – averaging around 4 years across all projects.
- Project-specific lifetimes: There's significant variation in vulnerability lifetimes between projects, ranging from about 2 years for Chromium to 7 years for OpenSSL.
- Code age is a major factor: Vulnerability lifetimes are strongly correlated with the overall age of the codebase. Older code tends to harbor vulnerabilities for longer.
- Exponential distribution is a good fit: The distribution of vulnerability lifetimes, both overall and within individual projects, can be well-approximated by an exponential distribution.
- Fuzzing's impact is complex: Despite the rise of modern fuzzing tools, the study found no significant difference in the lifetime trends of memory-related vulnerabilities compared to others in the Linux kernel. This suggests that fuzzing's impact is not a simple "fix it and forget it" process, and older bugs continue to be discovered even in "well-fuzzed" code.
- Vulnerability types don't matter (much): Within a given project, the type of vulnerability (e.g., memory-related vs. input validation) doesn't appear to significantly affect its lifetime. Differences observed in previous studies are likely due to the varying prevalence of different vulnerability types across projects.
Key Results
- Average Lifetime: Approximately 1,501 days (around 4.1 years) across all analyzed CVEs.
- Project Variation: Lifetimes range from ~757 days (Chromium) to ~2,872 days (PHP).
- Trend: Vulnerability lifetimes show a general increasing trend over time, with an average increase of 42.78 days per year across all CVEs.
- Code Age Correlation: Vulnerable code lives less than non-vulnerable code, but the spread between them can increase over time for some projects.
- Heuristic Accuracy: Their weighted average heuristic achieved a mean error of 117 days against ground truth data, significantly outperforming a lower-bound approach.
Limitations and Future Work
- Dataset Completeness: The NVD, while large, may not contain all vulnerabilities, and some CVEs might not have identifiable fixing commits. The authors believe their dataset is large and diverse enough to mitigate this.
- NVD/Commit Message Errors: While efforts were made to clean data, minor errors in NVD entries or commit messages could lead to incorrect mappings.
- Generalization: The study focused on C/C++ projects. While the methodology is generalizable, empirical validation on other languages was not performed.
- Future Work:
- Investigating the impact of fuzzing and other automated tools more deeply.
- Exploring the relationship between vulnerability lifetimes and code age as a potential indicator of software maturity.
- Developing new comparative metrics for software security beyond simple lifetime comparisons.
- Understanding the implications of vulnerabilities not assigned CVEs.
- Further theoretical investigation into the metric's relationship with vulnerability discovery models and software reliability.
Summary updated