mlsanityData to 14 Oct 2026

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

arXiv 2309.07639 ↗First posted 14 Sep 2023cs.CRcited by 17

Not on the map. Why?

Abstract (arXiv)

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.

Key facts. Cited by 17 papers in the map (data through 14 Oct 2026). First posted on arXiv 14 Sep 2023.

Builds on

No reference list yet.

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2023: 2; 2024: 5; 2025: 8; 2026: 2.

17 papers.

Sort:

By area:

  1. 2023SoK: Memorization in General-Purpose Large Language Modelscited by 37
  2. 2024Undesirable Memorization in Large Language Models: A Surveycited by 29
  3. 2024Security Attacks on LLM-based Code Completion Toolscited by 16
  4. 2025"Your AI, My Shell": Demystifying Prompt Injection Attacks on Agentic AI Coding Editorscited by 15
  5. 2023Pitfalls in Language Models for Code Intelligence: A Taxonomy and Surveycited by 9
  6. 2025Scrub It Out! Erasing Sensitive Memorization in Code Language Models via Machine Unlearningcited by 7
  7. 2024Promise and Peril of Collaborative Code Generation Models: Balancing Effectiveness and Memorizationcited by 4
  8. 2024LibreLog: Accurate and Efficient Unsupervised Log Parsing Using Open-Source Large Language Modelscited by 3
  9. 2024Contextualized Data-Wrangling Code Generation in Computational Notebookscited by 3
  10. 2025Next Edit Prediction: Learning to Predict Code Edits from Context and Interaction Historycited by 3
  11. 2025Mitigating Sensitive Information Leakage in LLMs4Code through Machine Unlearningcited by 1
  12. 2025Effective Code Membership Inference for Code Completion Models via Adversarial Promptscited by 1
5 more
  1. 2025Understanding Privacy Risks in Code Models Through Training Dynamics: A Causal Approachcited by 1
  2. 2025Malicious and Unintentional Disclosure Risks in Large Language Models for Code Generationcited by 0
  3. 2025Towards Privacy-Preserving Code Generation: Differentially Private Code Language Modelscited by 0
  4. 2026Protecting Private Code in IDE Autocomplete using Differential Privacycited by 0
  5. 2026Understanding Secret Leakage Risks in Code LLMs: A Tokenization Perspectivecited by 0