Checked-In Secret Detection: Strings Are All You Need
Zhengdong Huang, Kevin Li, Jinqiu Yang, Yepang Liu, Lili Wei
Southern University of Science and Technology · McGill University
Key points
From the paper's conclusion- Proposed StringGroup, a novel context extraction algorithm that mines strings surrounding potential secrets, achieving significant gains by narrowing analysis specifically to string literals and preserving over 80% of semantic information with 33.2% of the original context, improving the signal-to-noise ratio for secret detection.
- Designed Secretron, a context-aware secret detection tool based on StringGroup methods and Transformer model, which demonstrated high accuracy with 98.74% F1-score and strong robustness under obfuscation and cross-language scenarios, outperforming state-of-the-art LLM-based baselines.
- Successfully detected 48 previously unknown secret keys from 26 applications in real-world environments, demonstrating the practical effectiveness of the approach.
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 the paper
Discussion · 1
Science Skim's AI key points, plus readers' public thoughts
- Proposed StringGroup, a novel context extraction algorithm that mines strings surrounding potential secrets, achieving significant gains by narrowing analysis specifically to string literals and preserving over 80% of semantic information with 33.2% of the original context, improving the signal-to-noise ratio for secret detection.
- Designed Secretron, a context-aware secret detection tool based on StringGroup methods and Transformer model, which demonstrated high accuracy with 98.74% F1-score and strong robustness under obfuscation and cross-language scenarios, outperforming state-of-the-art LLM-based baselines.
- Successfully detected 48 previously unknown secret keys from 26 applications in real-world environments, demonstrating the practical effectiveness of the approach.
Readers' thoughts
No reader thoughts yet.
Related papers
- SecretSifter: A Runtime Secret-Detection Engine for Live Web TrafficarXiv · 2026
- More Context, Mixed Results: Evaluating LLMs for Identifier Recovery and Code DeobfuscationarXiv · 2026
- Secrets Unlocked: Evaluating LLMs for Secrets Detection in Android AppsProceedings of the ACM on Software Engineering · 2026
- NameTrap: Steering AI Coding Agents Toward Security Vulnerabilities via Variable NamesarXiv · 2026
- Preserve the Vulnerability, Break the Alert: Testing the Robustness of CodeQL Taint Tracking with Natural RewritesarXiv · 2026
- SDLog: A Deep Learning Framework for Detecting Sensitive Information in Software LogsACM Transactions on Software Engineering and Methodology · 2026