Skip to content
Open access

Checked-In Secret Detection: Strings Are All You Need

Aug 2026 · Proceedings of the ACM on Software Engineering · Vol 3, pp. 2660 - 2683 · 0 citations · 79 references
Computer Science

TL;DR

It is observed that strings serve as a critical information source for code semantics, offering superior contextual density, obfuscation robustness, and language independence, and a context-aware secret detection tool, Secretron, is designed, based on StringGroup methods and Transformer model.

Abstract

Hardcoded secrets in source code pose critical security vulnerabilities which can be easily exploited by malicious adversaries. Existing regex-based detection approaches suffer from fundamental limitations, as secrets often lack identifiable patterns, resulting in poor precision and recall. Recent studies have explored context-aware detection methods, as surrounding code can reveal the purpose of candidate strings. However, these methods confront three key challenges: (1) obfuscation robustness where models over-rely on easily obfuscated identifiers, (2) cross-language generalization difficulties due to uneven training data distribution, and (3) lengthy and noisy context that introduces excessive irrelevant tokens and slows inference. We observe that strings serve as a critical information source for code semantics, offering superior contextual density, obfuscation robustness, and language independence. Based on this insight, we propose StringGroup, a novel context extraction algorithm that mines strings surrounding potential secrets. By introducing a relatively simple modification to existing patterns that narrows the analysis specifically to string literals, the method achieves significant gains. With only 33.2% of the original context, it preserves over 80% of semantic information and significantly improves the signal-to-noise ratio for secret detection. We further design a context-aware secret detection tool, Secretron, based on StringGroup methods and Transformer model. Evaluation on the SecretBench dataset demonstrates high accuracy with 98.74% F1-score and strong robustness under obfuscation and cross-language scenarios, outperforming state-of-the-art LLM-based baselines. We deploy our tool in real-world environments and successfully detect 48 previously unknown secret keys from 26 applications, demonstrating the practical effectiveness of our approach.

Read PDF

Similar papers

Sep 2026

Practical Secrets Extraction against Black-box LLMs

This work presents a black-box secret extraction framework for commercial, API-based LLMs under output-only access, and improves recovery effectiveness and real-key rates over representative baselines while reducing extraction latency.

Shi-Qian Zhao, Si-Wei Jiang, Xin-Feng Li et al. · 0 citations
Preprint Sep 2026

CASHEWS: Source Preprocessor for LLM-based Malicious Package Detection

Malicious npm package detection tools now leverage LLMs'semantic understanding of source code to detect malicious intent at scale. This capability has proven invaluable in identifying packages involved in recent supply-chain attacks such as Shai-Hulud. However, threat actors exploit the limited context windows of LLMs...

Jean-Charles Noirot Ferrand, David Adei, Anders Møller et al. · 0 citations
Open access Oct 2026

Secrets Unlocked: Evaluating LLMs for Secrets Detection in Android Apps

This paper presents the first large-scale empirical evidence that off-the-shelf large language models (LLMs) can automatically identify secrets in Android apps without any domain-specific prior knowledge, thereby substantially lowering the barrier for attackers.

Marco Alecci, Jordan Samhi, T. Bissyandé et al. · 1 citation

ALIBI: Adversarial Legitimacy Injection in Binary Input against LLM Malware Analyzers

ALIBI is presented, a semantic cover story attack against frontier LLM-based malware analyzers that adds a small, non-executed read-only section to a compiled binary, containing a coherent but false security product narrative, without altering imports or executable behavior.

H. Choi, Wonyoung Jung, Haehoon Seo et al. · 0 citations

From Bits to Beliefs: Recoverable Semantic Fingerprints for Black-Box Verification of Large Language Models

Open-weight large language models (LLMs) can be copied, modified, and redeployed behind black-box APIs, making post-release ownership verification difficult. Existing black-box fingerprints often rely on secret query-key pairs that reproduce predefined responses, and can therefore be easily disrupted by fine-tuning, pr...

Jia-Xin Hong, Yu-Xin Peng, Hong-Yao Yu et al. · 0 citations
#artificial intelligence Preprint Oct 2026

The Fragility of Trigger-Tag Mechanisms for Misuse Detection in Open-Weight LLMs

Open-weight language models can be downloaded, modified, and deployed beyond their developers'control, limiting the effectiveness of centrally enforced safeguards. Recent work has therefore proposed \emph{trigger-tag} mechanisms that produce a detectable signal when a model is used under a target condition, such as gen...

Toluwani Aremu, Manit Baser, M. Gurusamy et al. · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.