Lune

NDSS2019Top-tier venue

How Bad Can It Git? Characterizing Secret Leakage in Public GitHub Repositories

Michael Meli, Matthew R. McNiece, Bradley Reaves

Abstract

GitHub and similar platforms have made public collaborative development of software commonplace. However, a problem arises when this public code must manage authentication secrets, such as API keys or cryptographic secrets. These secrets must be kept private for security, yet common development practices like adding these secrets to code make accidental leakage frequent. In this paper, we present the first large-scale and longitudinal analysis of secret leakage on GitHub. We examine billions of files collected using two complementary approaches: a nearly six-month scan of real-time public GitHub commits and a public snapshot covering 13% of open-source repositories. We focus on private key files and 11 high-impact platforms with distinctive API key formats. This focus allows us to develop conservative detection techniques that we manually and automatically evaluate to ensure accurate results. We find that not only is secret leakage pervasive -affecting over 100,000 repositories -but that thousands of new, unique secrets are leaked every day. We also use our data to explore possible root causes of leakage and to evaluate potential mitigation strategies. This work shows that secret leakage on public repository platforms is rampant and far from a solved problem, placing developers and services at persistent risk of compromise and abuse.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

30 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Decoding Secret Memorization in Code LLMs Through Token-Level Characterization cites Your Code Secret Belongs to Me: Neural Code Completion Tools Can Memorize Hard-Coded Credentials
  • Don't Leak Your Keys: Understanding, Measuring, and Exploiting the AppSecret Leaks in Mini-Programs cites Automated Detection of Password Leakage from Public GitHub Repositories
  • Your Code Secret Belongs to Me: Neural Code Completion Tools Can Memorize Hard-Coded Credentials cites Automated Detection of Password Leakage from Public GitHub Repositories
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers30

  1. Automated Detection of Password Leakage from Public GitHub RepositoriesRunhan Feng, Ziyang Yan, Shiyan Peng, Yuanyuan ZhangICSE 2022 · 36 citations
  2. Your Code Secret Belongs to Me: Neural Code Completion Tools Can Memorize Hard-Coded CredentialsYizhan Huang, Yichen Li, Weibin Wu, Jianping Zhang et al.FSE 2024 · 22 citations
  3. Don't Leak Your Keys: Understanding, Measuring, and Exploiting the AppSecret Leaks in Mini-ProgramsYue Zhang, Yuqing Yang, Zhiqiang LinCCS 2023 · 14 citations
  4. Decoding Secret Memorization in Code LLMs Through Token-Level CharacterizationYuqing Nie, Chong Wang, Kailong Wang, Guoai Xu et al.ICSE 2025 · 10 citations
  5. Enabling Collaborative Data Science Development with the Ballet FrameworkMicah J. Smith, Jürgen Cito, Kelvin Lu, Kalyan VeeramachaneniCSCW 2021 · 9 citations

Builds on1

  1. A Comprehensive Formal Security Analysis of OAuth 2.0Daniel Fett, Ralf Küsters, Guido SchmitzCCS 2016 · 228 citations

Related papers

  1. Pushed by Accident: A Mixed-Methods Study on Strategies of Handling Secret Information in Source Code RepositoriesAlexander Krause, Jan H. Klemmer, Nicolas Huaman, Dominik Wermke et al.USENIX Security 2023
  2. A Large-Scale Empirical Study of Secret Key Leakage in Hugging Face SpacesShaoxuan Yun, Yuchao Zhang, Zhikun Shi, Liu Wang et al.ICSE 2026
  3. What Challenges Do Developers Face About Checked-in Secrets in Software Artifacts?Setu Kumar Basak, Lorenzo Neil, Bradley Reaves, Laurie A. WilliamsICSE 2023 · 9 citations
  4. Hey, Your Secrets Leaked! Detecting and Characterizing Secret Leakage in the WildJiawei Zhou, Zidong Zhang, Lingyun Ying, Huajun Chai et al.S&P 2025
  5. The File That Contained the Keys Has Been Removed: An Empirical Analysis of Secret Leaks in Cloud Buckets and Responsible Disclosure OutcomesSoufian El Yadmani, Olga Gadyatskaya, Yury ZhauniarovichS&P 2025
Dusk over the sea between two cliffs drawn in fine vertical lines