Practical Secrets Extraction against Black-box LLMs
Shiqian Zhao, Siwei Jiang, Xinfeng Li, Runyi Hu, Yandan Zheng, Congyu Guo, Tianwei Zhang, Anh Tuan Luu
Abstract
Large language models (LLMs) increasingly power autonomous coding agents such as Codex and Claude Code, yet their training corpora may contain confidential credentials exposed in public repositories or collected from private development artifacts, creating risks of memorization and subsequent leakage. Existing extraction audits, however, largely assume access to model weights or token probabilities. In this work, we present a black-box secret extraction framework for commercial, API-based LLMs under output-only access. It comprises (i) \emph{Cross-Validated Secret Knowledge Distillation}, which uses semantics-preserving prompt variants, response cross-validation, and provider-specific format filtering to distill secret-relevant behavior into a local white-box proxy; and (ii) \emph{Proxy-Guided Secret Extraction and Candidate Filtering}, which combines truncated top- sampling with local token entropy, -gram frequency profiling, and provider-specific structural priors. On controlled API-key benchmarks, our framework improves recovery effectiveness and real-key rates over representative baselines while reducing extraction latency. A responsible real-world evaluation further recovers masked provider-specific credentials from three independently deployed black-box LLM systems spanning OpenAI and Claude Code, showing that memorized secrets can be exposed under output-only access.
Create a lesson
Metadata
- Comments
- This paper proposes a practical secret extraction method against black-box large language models
Related papers
Do Defenses Against LLM Extraction Work Across Attacks? A Lifecycle Benchmark of Black-Box Model Extraction
Shared title terminologycs.CRShuze Liu, Kaixiang Zhao, Runyang Xu et al.
Controlled Decoding Attacks on Black-Box LLMs
Shared title terminologycs.CRJesson Wang, Shawn Li, Wei Yang et al.
Ichnia: Semantic Effect Oracles for Black-Box Broken Access Control Detection in Web Applications
Shared title terminologycs.CRRuozhao Yang, Jiongchi Yu, Yuqiang Sun et al.
Entropy Bounded Secret Key Generation in a Live 5G NR Stack Guard-Band Extraction and an Emulated Channel Operating Envelope
Shared title terminologycs.CRSachinkumar B. Mallikarjun, Hans D. Schotten
LLMs Leak Secrets Through Unrelated Outputs
Shared title terminologycs.CRKayshav Bhardwaj, Yigitcan Kaya, Christopher Kruegel et al.
The TellTail of Embeddings: Fingerprinting Retrievers in Black-Box Systems
Shared title terminologycs.CRAbdullah Garra, Matan Ben-Tov, Mahmood Sharif