利用LLM在软件问题报告中检测秘密泄露:全面评估
Secret Leak Detection in Software Issue Reports using LLMs: A Comprehensive Evaluation
AI总结:
本文通过大规模分析和实用检测流程,评估了GitHub问题中泄露秘密的检测方法,结合正则表达式和LLM进行分类,提升检测精度与召回率。
摘要:
在数字时代,意外暴露API密钥、令牌和凭证等敏感信息已成为日益严重的安全威胁。尽管大多数先前工作集中在源代码中的秘密检测,但软件问题报告中的泄露仍鲜有研究。本文通过大规模分析和实用检测流程填补这一空白,构建了包含54,148个实例的基准数据集,其中包括5,881个手动验证的真实秘密。使用该数据集,评估了基于熵的基线、关键词启发式方法、经典机器学习、深度学习和LLM方法。正则表达式和熵方法在召回率高但精度差,而较小的模型如RoBERTa和CodeBERT显著提升性能(F1=92.70%)。专有模型如GPT-4o在少样本设置中表现中等(F1=80.13%),而微调的开源大LLM如Qwen和LLaMA达到94.49%的F1。最后,我们在178个真实世界GitHub仓库上验证了我们的方法,达到81.6%的F1分数,展示了该方法在实际场景中的强大泛化能力。
英文摘要:
In the digital era, accidental exposure of sensitive information such as API keys, tokens, and credentials is a growing security threat. While most prior work focuses on detecting secrets in source code, leakage in software issue reports remains largely unexplored. This study fills that gap through a large-scale analysis and a practical detection pipeline for exposed secrets in GitHub issues. Our pipeline combines regular expression-based extraction with large language model (LLM)-based contextual classification to detect real secrets and reduce false positives. We build a benchmark of 54,148 instances from public GitHub issues, including 5,881 manually verified true secrets. Using this dataset, we evaluate entropy-based baselines and keyword heuristics used by prior secret detection tools, classical machine learning, deep learning, and LLM-based methods. Regex and entropy based approaches achieve high recall but poor precision, while smaller models such as RoBERTa and CodeBERT greatly improve performance (F1 = 92.70%). Proprietary models like GPT-4o perform moderately in few-shot settings (F1 = 80.13%), and fine-tuned open-source larger LLMs such as Qwen and LLaMA reach up to 94.49% F1. Finally, we also validate our approach on 178 real-world GitHub repositories, achieving an F1-score of 81.6% which demonstrates our approach's strong ability to generalize to in-the-wild scenarios.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。