CoolFace
Modelpublic

Sana9/securebert-vuln2cwe-flat

sourceHugging Facemitupdated 3mo agoView on Hugging Face
1likes13downloads
Model Card

SecureBERT — CVE-LMTune CWE Classifier (Flat)

<div align="center" style="display:inline-flex; gap:18px; align-items:center; flex-wrap:nowrap;"> <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/5b/LogoUniversit%C3%A9deLorraine.svg/1280px-LogoUniversit%C3%A9deLorraine.svg.png" alt="Universite de Lorraine" style="height:50px; width:auto;" /> <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/9/95/Inrlogorouge.svg/1280px-Inrlogorouge.svg.png" alt="INRIA" style="height:50px; width:auto;" /> <img src="https://upload.wikimedia.org/wikipedia/fr/6/6e/Logoloriaabrege_couleur.png" alt="LORIA" style="height:70px; width:auto;" /> <img src="https://www.pepr-cybersecurite.fr/wp-content/uploads/2023/09/pep-cybersecurite-550x250-1.png" alt="SuperViZ" style="height:70px; width:auto;" /> </div>

![GitHub](https://github.com/terranovafr/CVE-LMTune) ![Paper](https://hal.science/hal-05500820) ![PhD theses.fr](https://theses.fr/s371241) ![License: MIT](https://opensource.org/licenses/MIT) ![Zenodo Data](https://doi.org/10.5281/zenodo.16936476)

Part of the CVE-LMTune model suite, a collection of language models fine-tuned for multi-taxonomy vulnerability classification across widely used cybersecurity taxonomies, including CWE, CAPEC, and MITRE ATT&CK.

Paper

Franco Terranova, Sana Rekbi, Abdelkader Lahmadi, Isabelle Chrisment. Multi-Taxonomy Vulnerability Classification with Hierarchically Finetuned Language Models. The 23rd Conference on Detection of Intrusions and Malware & Vulnerability Assessment (DIMVA '26).

Overview

This model performs multi-label CWE classification from vulnerability descriptions. Given a CVE-style description, it predicts one or more CWE identifiers associated with the described vulnerability.

PropertyValue
TaxonomyCWE (Common Weakness Enumeration)
TaskMulti-label text classification
InputVulnerability description (e.g., CVE summary)
OutputOne or more CWE identifiers
Number of labels713
Number of samples259,549
Latest CVE update included17/06/2026
Splittrain (60%), val (20%), test (20%)

Evaluation Results

The model was evaluated on the held-out test set using standard multi-label classification metrics using sigmoid activation and a default threshold of 0.5.

Ranking Metrics | LRAP | MRR | Coverage Error | Label Ranking Loss | P@1 | P@3 | P@5 | R@1 | R@3 | R@5 | |------|-----|----------------|--------------------|-----|-----|-----|-----|-----|-----| | 0.8285 | 0.8695 | 14.71 | 0.0069 | 0.8172 | 0.7598 | 0.5417 | 0.2750 | 0.7295 | 0.8450 |

Threshold = 0.5 | Micro P | Micro R | Micro F1 | Macro F1 | Weighted F1 | Hamming Loss | Subset Accuracy | |--------|--------|----------|----------|------------|--------------|----------------| | 0.8765 | 0.7168 | 0.7886 | 0.0992 | 0.7646 | 0.0018 | 0.5625 |

Quick Start

python
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch

tokenizer = AutoTokenizer.from_pretrained("Sana9/securebert-vuln2cwe-flat", use_fast=False)
model = AutoModelForSequenceClassification.from_pretrained("Sana9/securebert-vuln2cwe-flat")

text = "Buffer overflow vulnerability in OpenSSL allows remote attackers to execute arbitrary code."

with torch.no_grad():
    probs = torch.sigmoid(
        model(**tokenizer(text, return_tensors="pt", truncation=True)).logits
    )[0]

predictions = {
    model.config.id2label[i]: p.item()
    for i, p in enumerate(probs)
    if p > 0.5
}

print(predictions)

Citation

bibtex
@inproceedings{terranova2026multitaxonomy,
  author    = {Franco Terranova and Sana Rekbi and Abdelkader Lahmadi and Isabelle Chrisment},
  title     = {Multi-Taxonomy Vulnerability Classification with Hierarchically Finetuned Language Models},
  booktitle = {Proceedings of the International Conference on Detection of Intrusions and Malware, and Vulnerability Assessment (DIMVA)},
  year      = {2026},
  month     = jul,
  address   = {Chania, Crete, Greece},
  note      = {HAL identifier: hal-05500820v2}
}

Related Resources

Disclaimers

  • This product is a result of the use of the NVD API but is not endorsed or certified by the NVD. The same for the CVE2CAPEC project and the Hugging Face API.
  • This project relies on data publicly available from the CWE, CAPEC, and MITRE ATT&CK projects.
  • This work has been partially supported by the French National Research Agency under the France 2030 label (Superviz ANR-22-PECY-0008). The views reflected herein do not necessarily reflect the opinion of the French government.