Introduction
In cybersecurity, the accurate classification of software vulnerabilities is paramount for effective risk management. Two primary standards facilitate this: Common Vulnerabilities and Exposures (CVEs), which document specific instances of vulnerabilities in software products, and Common Weakness Enumerations (CWEs), a hierarchical taxonomy describing the underlying types of software weaknesses. Mapping CVEs to their corresponding CWEs is essential for understanding the nature of a threat, yet manual mapping is labor-intensive and error-prone.
Automated classification faces significant challenges:
- Data Imbalance: A small number of CWEs are associated with thousands of CVEs, while the majority have very few examples.
- Hierarchical Structure: CWEs are organized in a complex tree structure where child nodes inherit characteristics from parents.
- Temporal Evolution: New vulnerabilities emerge over time, requiring models to generalize to unseen or evolving patterns.
Methodology: The V2W-BERT Framework
To address these challenges, the authors propose V2W-BERT (Vulnerability-to-Weakness BERT). Unlike traditional multiclass classifiers that treat labels as discrete indices, V2W-BERT reformulates the task as a link prediction problem.
Link Prediction and Siamese Architecture
V2W-BERT utilizes a Siamese architecture with two BERT encoders. Instead of predicting a label directly, the model takes a CVE description and a CWE definition as input and predicts the probability of a link between them. This approach allows the model to leverage the semantic information embedded in the CWE definitions themselves, facilitating better generalization to rare or even unseen classes.
Reconstruction Decoder (RD)
A key innovation is the integration of a Reconstruction Decoder (RD). While the primary objective is link prediction, the RD forces the model to reconstruct masked tokens in the input descriptions. This auxiliary task serves as a powerful regularizer, preventing the model from overfitting to specific training samples and ensuring it retains a broad linguistic understanding. This is particularly effective for "zero-shot" scenarios where the model must classify a CWE it has never encountered during training.
Experimental Evaluation
The framework was evaluated using a dataset of 137,101 CVE entries from the National Vulnerability Database (NVD) spanning 1999 to 2020. To simulate real-world conditions, the data was split temporally: 1999–2017 for training and 2018–2020 for testing.
Key Results
V2W-BERT achieved an overall accuracy of 97% on random splits and 94% on temporal splits. Notably, the model demonstrated superior performance on rare classes and in zero-shot settings.
The results indicate that:
- Rare Class Improvement: For CWEs with fewer than 50 training examples, V2W-BERT improved accuracy by approximately 10% compared to standard BERT baselines.
- Zero-Shot Capability: The model achieved up to 86% "relaxed" accuracy (identifying the correct path within a small candidate set) for CWEs entirely absent from the training data.
- Robustness: The framework consistently outperformed TF-IDF-based models and standard fine-tuned BERT classifiers across all test periods.
Conclusion and Future Work
V2W-BERT represents a significant advancement in automated vulnerability classification. By treating classification as link prediction and incorporating a Reconstruction Decoder, the framework effectively navigates the complexities of the CWE hierarchy and the challenges of data imbalance. Future work will focus on scaling the model to larger Transformer variants and exploring methods to automatically identify entirely new categories of weaknesses.
Summary updated