VulMamba: multi-dimensional state space modeling for software vulnerability detection via self-supervised contrastive learning
摘要
With the expansion of software systems, automated software vulnerability detection has become a critical task for ensuring cybersecurity. Existing deep learning methods often struggle to simultaneously acquire textual semantics and complex structural dependencies, resulting in incomplete code representations. Moreover, the quadratic computational complexity of Transformers limits their effectiveness in analyzing long-range dependencies in complex functions. To address these challenges, this paper proposes VulMamba, a vulnerability detection framework based on Bidirectional State Space Models (SSM) and self-supervised contrastive learning. We design an embed-first-then-split mapping scheme to represent source code as a multi-channel feature tensor, integrating semantics, control flow (CFG), and data dependencies (DDG). Leveraging Vision Mamba as a hierarchical SSM encoder, the framework effectively captures latent vulnerability patterns through a global receptive field with linear complexity. To mitigate the impact of class imbalance and data scarcity, we employ a self-supervised contrastive learning paradigm using Dropout-based stochastic augmentation. Experimental results show that VulMamba improves both Accuracy and F1-score by over 5% on SARD, achieves 66.10% accuracy on FFmpeg+QEMU, and surpasses existing vision-based methods by nearly 28% in F1-score on Reveal.