Lune

FSE2024顶会

Your Code Secret Belongs to Me: Neural Code Completion Tools Can Memorize Hard-Coded Credentials

Yizhan Huang, Yichen Li, Weibin Wu, Jianping Zhang, Michael R. Lyu

摘要

Neural Code Completion Tools (NCCTs) have reshaped the field of software engineering, which are built upon the language modeling technique and can accurately suggest contextually relevant code snippets. However, language models may emit the training data verbatim during inference with appropriate prompts. This memorization property raises privacy concerns of NCCTs about hard-coded credential leakage, leading to unauthorized access to applications, systems, or networks. Therefore, to answer whether NCCTs will emit the hard-coded credential, we propose an evaluation tool called Hard-coded Credential Revealer (HCR). HCR constructs test prompts based on GitHub code files with credentials to reveal the memorization phenomenon of NCCTs. Then, HCR designs four filters to filter out ill-formatted credentials. Finally, HCR directly checks the validity of a set of non-sensitive credentials. We apply HCR to evaluate three representative types of NCCTs: Commercial NCCTs, open-source models, and chatbots with code completion capability. Our experimental results show that NCCTs can not only return the precise piece of their training data but also inadvertently leak additional secret strings. Notably, two valid credentials were identified during our experiments. Therefore, HCR raises a severe privacy concern about the potential leakage of hard-coded credentials in the training data of commercial NCCTs. All artifacts and data are released for future research purposes in https://github.com/HCR-Repo/HCR.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 11 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Security Attacks on LLM-based Code Completion Tools 引用了 Extracting Training Data from Large Language Models
  • Membership Inference Attacks Against Machine Learning Models 引用了 Deep Learning with Differential Privacy
  • Decoding Secret Memorization in Code LLMs Through Token-Level Characterization 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • Decoding Secret Memorization in Code LLMs Through Token-Level Characterization 引用了 The Secret Sharer: Evaluating and Testing Unintended Memorization in Neural Networks
  • Decoding Secret Memorization in Code LLMs Through Token-Level Characterization 引用了 Extracting Training Data from Large Language Models
  • The Secret Sharer: Evaluating and Testing Unintended Memorization in Neural Networks 引用了 Membership Inference Attacks Against Machine Learning Models
  • The Secret Sharer: Evaluating and Testing Unintended Memorization in Neural Networks 引用了 Deep Learning with Differential Privacy
  • Contextualized Data-Wrangling Code Generation in Computational Notebooks 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • Extracting Training Data from Large Language Models 引用了 Membership Inference Attacks Against Machine Learning Models
  • Extracting Training Data from Large Language Models 引用了 The Secret Sharer: Evaluating and Testing Unintended Memorization in Neural Networks
  • Extracting Training Data from Large Language Models 引用了 Deep Learning with Differential Privacy
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper11

  1. Security Attacks on LLM-based Code Completion ToolsWen Cheng, Ke Sun, Xinyu Zhang, Wei WangAAAI 2025 · 21 次引用
  2. IRCoCo: Immediate Rewards-Guided Deep Reinforcement Learning for Code CompletionBolun Li, Zhihong Sun, Tao Huang, Hongyu Zhang 等FSE 2024 · 10 次引用
  3. Decoding Secret Memorization in Code LLMs Through Token-Level CharacterizationYuqing Nie, Chong Wang, Kailong Wang, Guoai Xu 等ICSE 2025 · 10 次引用
  4. LibreLog: Accurate and Efficient Unsupervised Log Parsing Using Open-Source Large Language ModelsZeyang Ma, Dong Jae Kim, Tse-Hsun Peter ChenICSE 2025 · 7 次引用
  5. Contextualized Data-Wrangling Code Generation in Computational NotebooksJunjie Huang, Daya Guo, Chenglong Wang, Jiazhen Gu 等ASE 2024 · 5 次引用

它引用的 Paper26

  1. Deep Learning with Differential PrivacyMartín Abadi, Andy Chu, Ian J. Goodfellow, H. Brendan McMahan 等CCS 2016 · 7,620 次引用
  2. Membership Inference Attacks Against Machine Learning ModelsReza Shokri, Marco Stronati, Congzheng Song, Vitaly ShmatikovS&P 2017 · 5,137 次引用
  3. Extracting Training Data from Large Language ModelsNicholas Carlini, Florian Tramèr, Eric Wallace, Matthew Jagielski 等USENIX Security 2021 · 2,866 次引用
  4. CodeBERT: A Pre-Trained Model for Programming and Natural LanguagesZhangyin Feng, Daya Guo, Duyu Tang, Nan Duan 等EMNLP Findings 2020 · 2,828 次引用
  5. The Secret Sharer: Evaluating and Testing Unintended Memorization in Neural NetworksNicholas Carlini, Chang Liu, Úlfar Erlingsson, Jernej Kos 等USENIX Security 2019 · 1,386 次引用

相关 Paper

  1. CodexLeaks: Privacy Leaks from Code Generation Language Models in GitHub CopilotLiang Niu, Muhammad Shujaat Mirza, Zayd Maradni, Christina PöpperUSENIX Security 2023
  2. CodeMark: Imperceptible Watermarking for Code Datasets against Neural Code Completion ModelsZhensu Sun, Xiaoning Du, Fu Song, Li LiFSE 2023 · 34 次引用
  3. Black-Box Adversarial Attacks on LLM-Based Code CompletionSlobodan Jenko, Niels Mündler, Jingxuan He, Mark Vero 等ICML 2025
  4. Unveiling Memorization in Code ModelsZhou Yang, Zhipeng Zhao, Chenyu Wang, Jieke Shi 等ICSE 2024 · 33 次引用
  5. Traces of Memorisation in Large Language Models for CodeAli Al-Kaswan, Maliheh Izadi, Arie van DeursenICSE 2024 · 23 次引用
黄昏的海面,两侧是细线勾勒的悬崖