Your Code Secret Belongs to Me: Neural Code Completion Tools Can Memorize Hard-Coded Credentials
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
Citing papers per year: 2023: 2; 2024: 5; 2025: 8; 2026: 2.
17 papers.
Sort:
By area:
- 2023SoK: Memorization in General-Purpose Large Language Modelscited by 37
- 2024Undesirable Memorization in Large Language Models: A Surveycited by 29
- 2024Security Attacks on LLM-based Code Completion Toolscited by 16
- 2025"Your AI, My Shell": Demystifying Prompt Injection Attacks on Agentic AI Coding Editorscited by 15
- 2023Pitfalls in Language Models for Code Intelligence: A Taxonomy and Surveycited by 9
- 2025Scrub It Out! Erasing Sensitive Memorization in Code Language Models via Machine Unlearningcited by 7
- 2024Promise and Peril of Collaborative Code Generation Models: Balancing Effectiveness and Memorizationcited by 4
- 2024LibreLog: Accurate and Efficient Unsupervised Log Parsing Using Open-Source Large Language Modelscited by 3
- 2024Contextualized Data-Wrangling Code Generation in Computational Notebookscited by 3
- 2025Next Edit Prediction: Learning to Predict Code Edits from Context and Interaction Historycited by 3
- 2025Mitigating Sensitive Information Leakage in LLMs4Code through Machine Unlearningcited by 1
- 2025Effective Code Membership Inference for Code Completion Models via Adversarial Promptscited by 1
5 more
- 2025Understanding Privacy Risks in Code Models Through Training Dynamics: A Causal Approachcited by 1
- 2025Malicious and Unintentional Disclosure Risks in Large Language Models for Code Generationcited by 0
- 2025Towards Privacy-Preserving Code Generation: Differentially Private Code Language Modelscited by 0
- 2026Protecting Private Code in IDE Autocomplete using Differential Privacycited by 0
- 2026Understanding Secret Leakage Risks in Code LLMs: A Tokenization Perspectivecited by 0
- 2026Understanding Secret Leakage Risks in Code LLMs: A Tokenization Perspective20 Apr 2026
- 2026Protecting Private Code in IDE Autocomplete using Differential Privacy30 Jan 2026
- 2025Towards Privacy-Preserving Code Generation: Differentially Private Code Language Models12 Dec 2025
- 2025Understanding Privacy Risks in Code Models Through Training Dynamics: A Causal Approach8 Dec 2025
- 2025Effective Code Membership Inference for Code Completion Models via Adversarial Prompts19 Nov 2025
- 2025"Your AI, My Shell": Demystifying Prompt Injection Attacks on Agentic AI Coding Editors26 Sep 2025
- 2025Scrub It Out! Erasing Sensitive Memorization in Code Language Models via Machine Unlearning17 Sep 2025
- 2025Next Edit Prediction: Learning to Predict Code Edits from Context and Interaction History13 Aug 2025
- 2025Malicious and Unintentional Disclosure Risks in Large Language Models for Code Generation27 Mar 2025
- 2025Mitigating Sensitive Information Leakage in LLMs4Code through Machine Unlearning9 Feb 2025
- 2024Undesirable Memorization in Large Language Models: A Survey3 Oct 2024
- 2024Contextualized Data-Wrangling Code Generation in Computational Notebooks20 Sep 2024
5 more
- 2024Promise and Peril of Collaborative Code Generation Models: Balancing Effectiveness and Memorization18 Sep 2024
- 2024Security Attacks on LLM-based Code Completion Tools20 Aug 2024
- 2024LibreLog: Accurate and Efficient Unsupervised Log Parsing Using Open-Source Large Language Models2 Aug 2024
- 2023Pitfalls in Language Models for Code Intelligence: A Taxonomy and Survey27 Oct 2023
- 2023SoK: Memorization in General-Purpose Large Language Models24 Oct 2023
- 2024Security Attacks on LLM-based Code Completion Toolscited by 16
- 2025Scrub It Out! Erasing Sensitive Memorization in Code Language Models via Machine Unlearningcited by 7
- 2025Mitigating Sensitive Information Leakage in LLMs4Code through Machine Unlearningcited by 1
- 2025Effective Code Membership Inference for Code Completion Models via Adversarial Promptscited by 1
- 2025Effective Code Membership Inference for Code Completion Models via Adversarial Prompts19 Nov 2025
- 2025Scrub It Out! Erasing Sensitive Memorization in Code Language Models via Machine Unlearning17 Sep 2025
- 2025Mitigating Sensitive Information Leakage in LLMs4Code through Machine Unlearning9 Feb 2025
- 2024Security Attacks on LLM-based Code Completion Tools20 Aug 2024
- 2023SoK: Memorization in General-Purpose Large Language Modelscited by 37
- 2024Undesirable Memorization in Large Language Models: A Surveycited by 29
- 2023Pitfalls in Language Models for Code Intelligence: A Taxonomy and Surveycited by 9
- 2024Promise and Peril of Collaborative Code Generation Models: Balancing Effectiveness and Memorizationcited by 4
- 2024LibreLog: Accurate and Efficient Unsupervised Log Parsing Using Open-Source Large Language Modelscited by 3
- 2024Contextualized Data-Wrangling Code Generation in Computational Notebookscited by 3
- 2025Next Edit Prediction: Learning to Predict Code Edits from Context and Interaction Historycited by 3
- 2025Understanding Privacy Risks in Code Models Through Training Dynamics: A Causal Approachcited by 1
- 2025Malicious and Unintentional Disclosure Risks in Large Language Models for Code Generationcited by 0
- 2025Towards Privacy-Preserving Code Generation: Differentially Private Code Language Modelscited by 0
- 2026Protecting Private Code in IDE Autocomplete using Differential Privacycited by 0
- 2026Understanding Secret Leakage Risks in Code LLMs: A Tokenization Perspectivecited by 0
- 2026Understanding Secret Leakage Risks in Code LLMs: A Tokenization Perspective20 Apr 2026
- 2026Protecting Private Code in IDE Autocomplete using Differential Privacy30 Jan 2026
- 2025Towards Privacy-Preserving Code Generation: Differentially Private Code Language Models12 Dec 2025
- 2025Understanding Privacy Risks in Code Models Through Training Dynamics: A Causal Approach8 Dec 2025
- 2025Next Edit Prediction: Learning to Predict Code Edits from Context and Interaction History13 Aug 2025
- 2025Malicious and Unintentional Disclosure Risks in Large Language Models for Code Generation27 Mar 2025
- 2024Undesirable Memorization in Large Language Models: A Survey3 Oct 2024
- 2024Contextualized Data-Wrangling Code Generation in Computational Notebooks20 Sep 2024
- 2024Promise and Peril of Collaborative Code Generation Models: Balancing Effectiveness and Memorization18 Sep 2024
- 2024LibreLog: Accurate and Efficient Unsupervised Log Parsing Using Open-Source Large Language Models2 Aug 2024
- 2023Pitfalls in Language Models for Code Intelligence: A Taxonomy and Survey27 Oct 2023
- 2023SoK: Memorization in General-Purpose Large Language Models24 Oct 2023