This study proposes a lightweight automated detection model for CWE-119 (Buffer Overflow) and CWE-787 (Out-of-Bounds Write) memory safety vulnerabilities, built upon CodeBERT and Focal Loss. Training adopts a hybrid strategy combining Juliet Test Suite and PrimeVul. On CASTLE-C250, the model achieves 76.67% Recall — a 4.4x improvement over the CodeBERT baseline — without graph-based structural augmentation. The complete pipeline runs on a consumer-grade Intel Arc A380 GPU using BF16 mixed precision.
Nolan Chen (Mon,) studied this question.