Instructions to use Project-Bastion/cve-triage with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Project-Bastion/cve-triage with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="Project-Bastion/cve-triage")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("Project-Bastion/cve-triage") model = AutoModelForSequenceClassification.from_pretrained("Project-Bastion/cve-triage", device_map="auto") - Transformers.js
How to use Project-Bastion/cve-triage with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('text-classification', 'Project-Bastion/cve-triage'); - Notebooks
- Google Colab
- Kaggle
cve-triage (experimental v0.1)
One model, one pass over a CVE description, several triage suggestions: the likely CWE (top-5 of 150 frequent classes), the eight CVSS 3.1 base components (AV, AC, PR, UI, S, C, I, A) and a direct severity band (Low / Medium / High / Critical). It is a time-saver for analysts who face a pile of new CVEs, not a replacement for CVSS scoring or a CWE review: on new CVEs the exact-CWE accuracy is about 67% and the severity-band accuracy about 66%.
Try it in your browser: a static page that runs the model locally (transformers.js, ONNX, about 600 MB download). The text you paste never leaves your device.
Usage
import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification
repo = "Project-Bastion/cve-triage"
tok = AutoTokenizer.from_pretrained(repo); model = AutoModelForSequenceClassification.from_pretrained(repo).eval()
desc = ("A stack-based buffer overflow in the HTTP request parser of ExampleServer before 2.4.1 allows remote "
"unauthenticated attackers to execute arbitrary code via a long Host header.")
enc = tok(desc, truncation=True, max_length=160, return_tensors="pt")
with torch.no_grad(): logits = model(**enc).logits[0]
labels = [model.config.id2label[i] for i in range(len(logits))] # "CWE-79", ..., "OTHER", "AV:N", ..., "SEVERITY:HIGH"
groups = {}
for i, l in enumerate(labels): groups.setdefault(l.split(":")[0] if ":" in l else "CWE", []).append(i)
def best(g, k=1):
p = torch.softmax(logits[groups[g]], -1); top = p.topk(k)
return [(labels[groups[g][j]], round(float(v), 3)) for v, j in zip(top.values, top.indices)]
print("CWE top-5:", best("CWE", 5))
print("CVSS components:", {g: best(g)[0][0].split(":")[1] for g in ("AV", "AC", "PR", "UI", "S", "C", "I", "A")})
print("Severity:", best("SEVERITY")[0])
Output layout: the logits are 9 separate softmax heads (CWE classes + OTHER, then AV, AC, PR, UI, S, C, I, A, then SEVERITY); the snippet slices them by the label names in config.json. Input is the English CVE description only, truncated to 160 tokens.
Evaluation (sealed test)
Data: CVE List V5 snapshot of 2026-11-20 (410,056 published CVEs with an English description). 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 as a gap; exact-duplicate descriptions of training records removed from val/test). Targets are the first CWE and the CVSS 3.1 vector found in the CNA or CISA-ADP container, whichever records have them (CWE: 49,912 test records; CVSS 3.1: 45,778). All choices (3 base models, 2 learning rates, training-set size and date range, epochs) used validation only; the test split was scored once, on the final model.
| System (test) | CWE top-1 | CWE top-5 | CVSS component acc. (mean of 8) | Exact full vector | Severity band acc. | Base-score MAE |
|---|---|---|---|---|---|---|
| cve-triage (this model) | 0.666 | 0.891 | 0.848 | 0.376 | 0.664 (direct head) | 0.995 (computed from predicted vector) |
| TF-IDF + linear SVM (same data) | 0.667 | – | 0.841 | 0.355 | 0.608 | 1.14 |
| CIRCL severity model, revision of 2026-03-30 (predates the training cutoff, so it cannot have seen the test CVEs) | – | – | – | – | 0.630 | – |
CIRCL cwe-parent model, revision of 2026-01-13, on the 15% of test records whose CWE is among its classes |
0.582 (exact id) | – | – | – | – | – |
| Majority class | 0.083 | – | 0.643 | 0.050 | 0.406 | 2.88 |
Honest reading: on exact CWE this model only ties a TF-IDF linear baseline (0.666 vs 0.667); its edge is the top-5 list (0.891), slightly better CVSS components, and a severity estimate about 3 points above the fair CIRCL baseline and 5.6 above TF-IDF. Why the CIRCL revision matters: CIRCL retrains its severity model about weekly. Its latest revision (2026-11-19) scores 0.786 on this test set, but it has almost certainly been trained on these very CVEs, so that number is not a fair comparison and is not used. Seed check: a second training run with the same recipe scored, on validation, CWE top-1 0.695 / top-5 0.895 / CVSS component accuracy 0.845 / severity 0.675, against 0.689 / 0.897 / 0.843 / 0.672 for the shipped run, so the run-to-run spread is under one point (the test split was scored only for the shipped model). Severity labels here are the bands of the CVSS 3.1 base score from the vector in the record; CNAs differ in how they score, so a large share of the remaining error is label noise.
Training
cisco-ai/SecureBERT2.0-base (Apache-2.0, ModernBERT architecture), multi-head cross-entropy (one softmax per head, masked when a record lacks that label), lr 5e-5, up to 4 epochs on all training CVEs (best validation epoch kept: epoch 2 of 4), max length 160, bf16, one A10G.
Code: GitHub Project-Bastion/models, scripts/cve/.
ONNX / browser
onnx/model.onnx (fp32, 599 MB). Checked on 200 validation descriptions: onnxruntime vs PyTorch differ by <3e-5 in logits; the in-browser decode (run in Node with transformers.js) gives identical token ids, CWE top-1 and top-5 lists, CVSS vectors and severity on all 200.
(Note for anyone re-implementing this in transformers.js: when truncating, it keeps a text token instead of the closing [SEP]; the demo restores it.) I did not test int8 on this model itself, but dynamic int8 quantization broke a sibling model with the same base (it kept only 91-94% of decisions), so no int8 file is published.
Known limits
- English descriptions only; trained on CVEs up to March 2026. The 2026 volume surge (many bulk-reported CVEs) shifts the distribution, so expect drift.
- Exact-CWE accuracy ties a TF-IDF baseline; CWE labels are noisy and vague classes (for example CWE-20, CWE-200) are common. Rare CWEs outside the top-150 map to
OTHER. - CVSS/severity labels come from whichever CNA or ADP scored the record; they are inconsistent across vendors. Do not use the output as an official score.
- No exploitability, environment or CVSS 4.0 information.
License and credits
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. The CIRCL models used as baselines are CIRCL/vulnerability-severity-classification-roberta-base (CC-BY-4.0) and CIRCL/cwe-parent-vulnerability-classification-roberta-base (MIT).
- Downloads last month
- 48
Model tree for Project-Bastion/cve-triage
Base model
answerdotai/ModernBERT-baseEvaluation results
- CWE top-1 (n=49912) on CVE List V5self-reported0.666
- CWE top-5 (n=49912) on CVE List V5self-reported0.891
- CVSS 3.1 component accuracy on CVE List V5self-reported0.848
- severity band accuracy on CVE List V5self-reported0.664