arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2512.08291cs.CRcs.SE
收藏

揭示并防御漏洞预测模型中的成员泄露

Exposing and Defending Membership Leakage in Vulnerability Prediction Models

City University of Hong Kong(香港城市大学);Hong Kong Metropolitan University(香港都会大学)

Yihan Liao, Jacky Keung, Xiaoxue Ma, Jingyu Zhang, Yicheng Sun

AI总结:

本研究揭示漏洞预测模型易受成员泄露攻击,并提出轻量级防御策略NMID,有效降低攻击效果同时保持模型预测能力。

摘要:

神经模型在漏洞预测(VP)中通过学习大规模代码仓库取得了出色的性能。然而,其对成员推断攻击(MIAs)的易感性,其中攻击者试图推断特定代码样本是否在训练过程中使用,提出了严重的隐私问题。尽管MIAs在NLP和视觉领域已被广泛研究,但其对安全关键的代码分析任务的影响仍鲜有探索。在本工作中,我们对MIAs在VP模型上的影响进行了首次全面分析,评估了各种架构(LSTM、BiGRU和CodeBERT)和特征组合(嵌入、logits、损失和置信度)的攻击成功率。我们的威胁模型符合黑盒和灰盒设置,其中预测输出是可观察的,允许攻击者通过分析训练样本和非训练样本之间的输出差异来推断成员身份。实证发现揭示logits和损失是最有信息量且易受泄露的输出。受这些观察的启发,我们提出了一种基于噪声的成员推断防御(NMID),这是一种轻量级的防御模块,通过输出掩码和高斯噪声注入来破坏对抗推断。广泛的实验表明,NMID显著降低了MIAs的有效性,将攻击AUC从接近1.0降低到低于0.65,同时保持VP模型的预测效用。我们的研究突显了代码分析中的关键隐私风险,并为安全AI驱动的软件系统提供了可行的防御策略。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑