Exposing and Defending Membership Leakage in Vulnerability Prediction Models
On the map: LLM safety and security → Membership inference attacks
Abstract (arXiv)
Neural models for vulnerability prediction (VP) have achieved impressive performance by learning from large-scale code repositories. However, their susceptibility to Membership Inference Attacks (MIAs), where adversaries aim to infer whether a particular code sample was used during training, poses serious privacy concerns. While MIA has been widely investigated in NLP and vision domains, its effects on security-critical code analysis tasks remain underexplored. In this work, we conduct the first comprehensive analysis of MIA on VP models, evaluating the attack success across various architectures (LSTM, BiGRU, and CodeBERT) and feature combinations, including embeddings, logits, loss, and confidence. Our threat model aligns with black-box and gray-box settings where prediction outputs are observable, allowing adversaries to infer membership by analyzing output discrepancies between training and non-training samples. The empirical findings reveal that logits and loss are the most informative and vulnerable outputs for membership leakage. Motivated by these observations, we propose a Noise-based Membership Inference Defense (NMID), which is a lightweight defense module that applies output masking and Gaussian noise injection to disrupt adversarial inference. Extensive experiments demonstrate that NMID significantly reduces MIA effectiveness, lowering the attack AUC from nearly 1.0 to below 0.65, while preserving the predictive utility of VP models. Our study highlights critical privacy risks in code analysis and offers actionable defense strategies for securing AI-powered software systems.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Placed in Membership inference attacks, one of 12 directions in LLM safety and security. Builds on 26 of its 42 references that are in the map. First posted on arXiv 9 Dec 2025.
Builds on
26 of 42 references.
Closest ancestors · 10
Same direction, newest first
- 2025Towards Label-Only Membership Inference Attack against Pre-trained Large Language Models26 Feb
- 2025Rethinking Membership Inference Attacks Against Transfer Learning20 Jan
- 2024Does Your Neural Code Completion Model Use My Code? A Membership Inference Approach22 Apr
- 2024SoK: Reducing the Vulnerability of Fine-tuned Language Models to Membership Inference Attacks13 Mar
- 2024Do Membership Inference Attacks Work on Large Language Models?12 Feb
- 2023Gaussian Membership Inference Privacy12 Jun
- 2023Membership Inference Attacks against Language Models via Neighbourhood Comparison29 May
- 2022Bayesian Estimation of Differential Privacy10 Jun
- 2021Mitigating Membership Inference Attacks by Self-Distillation Through a Novel Ensemble Architecture15 Oct
- 2021Membership Inference Attacks on Machine Learning: A Survey14 Mar
Other references · 16
- 2014Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translationcited by 4,057
- 2016Deep Learning with Differential Privacycited by 2,728
- 2016Membership Inference Attacks against Machine Learning Modelscited by 2,281
- 2020Extracting Training Data from Large Language Modelscited by 2,189
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
- 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 609
- 2019Does Learning Require Memorization? A Short Tale about a Long Tailcited by 460
- 2019Devign: Effective Vulnerability Identification by Learning Comprehensive Program Semantics via Graph Neural Networkscited by 272
- 2019MemGuard: Defending against Black-Box Membership Inference Attacks via Adversarial Examplescited by 197
- 2020Membership Leakage in Label-Only Exposurescited by 168
- 2023DiverseVul: A New Vulnerable Source Code Dataset for Deep Learning Based Vulnerability Detectioncited by 102
- 2022Truth Serum: Poisoning Machine Learning Models to Reveal Their Secretscited by 101
4 more
- 2018SySeVR: A Framework for Using Deep Learning to Detect Software Vulnerabilitiescited by 92
- 2024Membership Inference Attacks and Defenses in Federated Learning: A Surveycited by 31
- 2023Gotcha! This Model Uses My Code! Evaluating Membership Leakage Risks in Code Modelscited by 15
- 2024A Survey of Source Code Representations for Machine Learning-Based Cybersecurity Taskscited by 5
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2025Effective Code Membership Inference for Code Completion Models via Adversarial Prompts
- 2024Impact of Dataset Properties on Membership Inference Vulnerability of Deep Transfer Learning
- 2026A Full-Pipeline Framework for Evaluating Membership Inference Attacks in Machine Learning
- 2023MIST: Defending Against Membership Inference Attacks Through Membership-Invariant Subspace Training
- 2026Empirical Evaluation of Membership Inference Attacks on NLP Text Classifiers: A Baseline Study on SST-2
- 2025Estimating Model-Level Membership Inference Vulnerability Without Reference Models
- 2026CheckMIABench: Firm Foundations For Membership Inference Attacks on Language Models
- 2025Evaluating the Defense Potential of Machine Unlearning against Membership Inference Attacks