AIセキュリティポータル K Program
Mind your key: An Empirical Study of LLM API Credential Leakage in iOS Apps
Share
Abstract
The rapid integration of large language models (LLMs) into mobile applications has introduced a new class of credential security risk: leaked credentials that grant unauthorized access to LLM inference services, causing financial damage to developers. Prior work on credential leakage has focused primarily on Android apps; to date, no empirical study has systematically investigated LLM API key leakage in iOS applications. We present the first in-depth empirical study of API key leakage in LLM-integrated apps. We construct a high-quality dataset of 444 iOS applications, filtered from 1092 candidates through a standardized process, and develop LLMKeyLens, a dynamic analysis framework that detects LLM API key leakage via traffic interception, provider-specific key extraction, and active validity confirmation, requiring neither source code access nor binary decryption. Our analysis reveals that 282 applications expose exploitable LLM API credentials in network traffic, spanning at least ten providers. We identify three leakage patterns: JWT-based token leakage (48%), unauthenticated backend proxy access (33%), and plaintext API key transmission (19%). To assess remediation, we re-analyzed the same 282 vulnerable applications three months after responsible disclosure; only 28% had remediated the reported vulnerability, while 72% remained exploitable, with persistent issues stemming from unauthenticated backends and broken JWT implementations. Our findings show that LLM API key leakage is both prevalent and persistent in the iOS ecosystem, exposing a systemic gap between developer practice and secure integration principles, and suggest that secure LLM integration requires not only developer awareness but also explicit security guidance from providers and platform-level enforcement.
Sampling Techniques
William G. Cochran
Published: 1977
Masterkey: Automated jailbreaking of large language model chatbots
Gelei Deng, Yi Liu, Yuekang Li, Kailong Wang, Ying Zhang, Zefeng Li, Haoyu Wang, Tianwei Zhang, Yang Liu
Published: 2024
Automated detection of password leakage from public github repositories
Runhan Feng, Ziyang Yan, Shiyan Peng, Yuanyuan Zhang
Published: 2022
On the (in) security of llm app stores
Xinyi Hou, Yanjie Zhao, Haoyu Wang
Published: 2025
PLeak: Prompt Leaking Attacks against Large Language Model Applications
Bo Hui, Haolin Yuan, Neil Gong, Philippe Burlina, Yinzhi Cao
Published: 2024.5.11
JSON Web Token (JWT)
Michael B. Jones, John Bradley, Nat Sakimura
Published: 2015
A large-scale empirical study on android runtime-permission rationale messages
X. Liu, Y. Leng, W. Yang, W. Wang, C. Zhai, T. Xie
Published: 2018
Prompt Injection attack against LLM-integrated Applications
Yi Liu, Gelei Deng, Yuekang Li, Kailong Wang, Zihao Wang, Xiaofeng Wang, Tianwei Zhang, Yepang Liu, Haoyu Wang, Yan Zheng, Yang Liu
Published: 2023.6.9
Mobile application web API reconnaissance: Web-to-mobile inconsistencies & vulnerabilities
A. Mendoza, G. Gu
Published: 2018
Recon: Revealing and controlling pii leaks in mobile network traffic
J. Ren, A. Rao, M. Lindorfer, A. Legout, D. Choffnes
Published: 2016
Don’t leak your keys: Understanding, measuring, and exploiting the appsecret leaks in mini-programs
Y. Zhang, Y. Yang, Z. Lin
Published: 2023
Share