Text Classification
Transformers
ONNX
Safetensors
Transformers.js
English
modernbert
cve
vulnerability
cvss
severity
security
vulnerability-management
triage
nvd
Eval Results (legacy)
text-embeddings-inference
Instructions to use Project-Bastion/cve-severity-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Project-Bastion/cve-severity-classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="Project-Bastion/cve-severity-classifier")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("Project-Bastion/cve-severity-classifier") model = AutoModelForSequenceClassification.from_pretrained("Project-Bastion/cve-severity-classifier", device_map="auto") - Transformers.js
How to use Project-Bastion/cve-severity-classifier with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('text-classification', 'Project-Bastion/cve-severity-classifier'); - Notebooks
- Google Colab
- Kaggle
Update model card
Browse files
README.md
CHANGED
|
@@ -9,21 +9,31 @@ model-index:
|
|
| 9 |
- name: cve-severity-classifier
|
| 10 |
results:
|
| 11 |
- task: {type: text-classification, name: CVSS 3.1 severity band from CVE description}
|
| 12 |
-
dataset: {type: cve-list-v5-
|
| 13 |
metrics:
|
| 14 |
- {type: accuracy, value: 0.664, name: severity band accuracy}
|
| 15 |
inference: false
|
| 16 |
---
|
| 17 |
|
| 18 |
-
# cve-severity-classifier
|
| 19 |
|
| 20 |
-
|
| 21 |
-
It is a standard `text-classification` model (plug it into a `transformers` pipeline), meant as a **triage hint before a real CVSS score exists**. It is only about 66% accurate on new CVEs, so never use it as an official score.
|
| 22 |
-
|
| 23 |
-
**This model is derived from [Project-Bastion/cve-triage](https://huggingface.co/Project-Bastion/cve-triage)**: it is the exact four-row slice of that model's severity head, packaged on its own so it works as an ordinary 4-class classifier. There was no new training and there are no new claims; the numbers below are cve-triage's sealed-test numbers for this head. On 200 validation descriptions the logits of the slice differ from the original head by at most 3e-6.
|
| 24 |
|
| 25 |
**[Try it in your browser](https://huggingface.co/spaces/Project-Bastion/cve-severity-classifier-demo)**: a static page that runs the model locally (transformers.js, ONNX; 152 MB int8 by default, 599 MB fp32 optional). The text you paste never leaves your device.
|
| 26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
## Usage
|
| 28 |
|
| 29 |
```python
|
|
@@ -34,36 +44,17 @@ desc = ("A stack-based buffer overflow in the HTTP request parser of ExampleServ
|
|
| 34 |
print(clf(desc, truncation=True, max_length=160)) # [[{'label': 'CRITICAL', 'score': ...}, {'label': 'HIGH', ...}, ...]]
|
| 35 |
```
|
| 36 |
|
| 37 |
-
Input
|
| 38 |
-
|
| 39 |
-
## Evaluation (sealed test)
|
| 40 |
-
|
| 41 |
-
Data: CVE List V5 snapshot of 2026-11-20. Split **by publication date**: train = published up to 2026-03-31, validation = April-May 2026, **test = published from 2026-08-01** (June-July left out; exact-duplicate descriptions of training records removed). Target = the band of the CVSS 3.1 base score computed from the vector in the CNA or CISA-ADP record. Test records with a CVSS 3.1 vector: 45,772. The test split was scored once, on the final multi-head model (the weights of this model are a slice of it).
|
| 42 |
-
|
| 43 |
-
| System (test, n = 45,772) | Severity band accuracy |
|
| 44 |
-
|---|---|
|
| 45 |
-
| **cve-severity-classifier (this model)** | **0.664** |
|
| 46 |
-
| TF-IDF + linear SVM (same data) | 0.608 |
|
| 47 |
-
| CIRCL `vulnerability-severity-classification-roberta-base`, revision of 2026-03-30 (predates the training cutoff, so it cannot have seen the test CVEs) | 0.630 |
|
| 48 |
-
| Majority class | 0.406 |
|
| 49 |
-
|
| 50 |
-
**Why a particular CIRCL revision:** CIRCL retrains its model about weekly; its latest revision (2026-11-19) scores 0.786 here, but it has almost certainly been trained on these very CVEs, so that number is not a fair comparison and is not used.
|
| 51 |
-
A second training run of the parent model scored 0.675 against 0.672 on validation, so the run-to-run spread is under one point. Label noise is large: CNAs score differently, so part of the remaining error is disagreement between scorers.
|
| 52 |
|
| 53 |
-
##
|
| 54 |
|
| 55 |
-
`onnx/model.onnx` (fp32,
|
| 56 |
-
fp32 gives the same top class on 200 of 200 (probability difference 0); int8 on 99.0% (max probability difference 0.037). Standard dynamic or static int8 quantization breaks this architecture, which is why the recipe quantizes weights only.
|
| 57 |
-
(transformers.js keeps a text token instead of the closing `[SEP]` when it truncates; the demo restores it.)
|
| 58 |
|
| 59 |
-
##
|
| 60 |
|
| 61 |
-
*
|
| 62 |
-
*
|
| 63 |
-
* English descriptions only; no exploitability, environment or CVSS 4.0 information; not an official score.
|
| 64 |
-
* The model is a 150M-parameter encoder for a 4-class task; if size matters, the TF-IDF baseline (0.608) is far smaller.
|
| 65 |
|
| 66 |
## License and credits
|
| 67 |
|
| 68 |
-
Apache-2.0. Data: the CVE List (cvelistV5) used under the CVE Program Terms of Use. CVE® is a registered trademark of The MITRE Corporation; CVE content copyright © The MITRE Corporation.
|
| 69 |
-
Base model `cisco-ai/SecureBERT2.0-base` (Apache-2.0). CIRCL's model (CC-BY-4.0) was used only as a baseline.
|
|
|
|
| 9 |
- name: cve-severity-classifier
|
| 10 |
results:
|
| 11 |
- task: {type: text-classification, name: CVSS 3.1 severity band from CVE description}
|
| 12 |
+
dataset: {type: cve-list-v5-from-2026-08, name: CVE List V5, CVEs published from 2026-08-01 (n=45772)}
|
| 13 |
metrics:
|
| 14 |
- {type: accuracy, value: 0.664, name: severity band accuracy}
|
| 15 |
inference: false
|
| 16 |
---
|
| 17 |
|
| 18 |
+
# cve-severity-classifier
|
| 19 |
|
| 20 |
+
Predict the **CVSS 3.1 severity band** of a CVE from its text description: `LOW` (< 4.0), `MEDIUM` (4.0-6.9), `HIGH` (7.0-8.9), `CRITICAL` (>= 9.0). It is a standard `text-classification` model, so it drops into a `transformers` pipeline, and it gives a severity hint before a CVSS score exists. It beats CIRCL's severity model (revision 2026-03-30) by 3.4 points of accuracy.
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
**[Try it in your browser](https://huggingface.co/spaces/Project-Bastion/cve-severity-classifier-demo)**: a static page that runs the model locally (transformers.js, ONNX; 152 MB int8 by default, 599 MB fp32 optional). The text you paste never leaves your device.
|
| 23 |
|
| 24 |
+
## Results
|
| 25 |
+
|
| 26 |
+
CVE List V5, CVEs published from 2026-08-01 with a CVSS 3.1 vector (n = 45,772). One number per cell: the score on that benchmark.
|
| 27 |
+
|
| 28 |
+
| System | Severity band accuracy |
|
| 29 |
+
|---|---|
|
| 30 |
+
| **cve-severity-classifier** | **0.664** |
|
| 31 |
+
| CIRCL/vulnerability-severity-classification-roberta-base (revision 2026-03-30) | 0.630 |
|
| 32 |
+
| TF-IDF + linear SVM | 0.608 |
|
| 33 |
+
| Majority class | 0.406 |
|
| 34 |
+
|
| 35 |
+
The target is the band of the CVSS 3.1 base score computed from the vector recorded for each CVE.
|
| 36 |
+
|
| 37 |
## Usage
|
| 38 |
|
| 39 |
```python
|
|
|
|
| 44 |
print(clf(desc, truncation=True, max_length=160)) # [[{'label': 'CRITICAL', 'score': ...}, {'label': 'HIGH', ...}, ...]]
|
| 45 |
```
|
| 46 |
|
| 47 |
+
Input: the English CVE description, up to 160 tokens. These are the weights of the severity head of [Project-Bastion/cve-triage](https://huggingface.co/Project-Bastion/cve-triage), which also predicts CWE and CVSS components.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
|
| 49 |
+
## Files
|
| 50 |
|
| 51 |
+
`onnx/model.onnx` (fp32, 599 MB) and `onnx/model_quantized.onnx` (weight-only int8, 151 MB, the demo default) for transformers.js / onnxruntime. int8 keeps the top class for 99.0% of descriptions; use fp32 for exact agreement with PyTorch.
|
|
|
|
|
|
|
| 52 |
|
| 53 |
+
## Limits
|
| 54 |
|
| 55 |
+
* A severity hint, not an official score: scoring differs between CVE numbering authorities.
|
| 56 |
+
* English descriptions only; no exploitability, environment or CVSS 4.0 information.
|
|
|
|
|
|
|
| 57 |
|
| 58 |
## License and credits
|
| 59 |
|
| 60 |
+
Apache-2.0. Base model: cisco-ai/SecureBERT2.0-base (Apache-2.0). Data: the CVE List (cvelistV5) used under the CVE Program Terms of Use. CVE® is a registered trademark of The MITRE Corporation; CVE content copyright © The MITRE Corporation. CIRCL's model (CC-BY-4.0) is the baseline.
|
|
|