How AI API Keys Leak From Mobile Apps, and How to Stop It

Dan Haiem, CEO of AppMakers USA, explains how AI provider keys end up exposed in mobile apps and what a secure setup looks like. The piece opens with a Wake Forest University study of 444 iPhone AI chatbot apps, 282 of which exposed paid AI access through their network traffic—researchers simply watched what apps sent over the network and collected credentials as they passed, letting anyone run AI requests on the developer's account. Worse, when the researchers warned all 282 developers and waited three months, only 28% had clearly fixed the problem. Haiem attributes the problem to speed to launch (calling the AI provider directly from the app skips building a backend), AI-generated code that ships unreviewed with keys in config files, prototypes quietly becoming production apps, and the false belief that a compiled app hides its secrets. The study sorted leaks into three patterns: replayable tokens (136 apps—tokens that leak and stay valid far too long, one expiring in 2125 and another still working after 128 days), no key needed (92 apps routing through unauthenticated servers that answer anyone), and plaintext keys (54 apps, 28 of which also exposed the hidden system prompt). Stolen credentials feed LLMjacking, with Sysdig estimating a worst case of over $46,000 a day in AI charges; other costs include copied system prompts, abuse under your account, provider suspension, and lost user trust. Haiem notes that deleting a leaked key isn't enough—many developers never revoke it. The recommended architecture: route every AI call through your own backend with the key in server-side secret storage, authenticate every request, keep tokens short-lived and user-bound, set rate limits and spending caps, monitor for unusual usage, keep the system prompt server-side, and rotate and revoke any key that ever shipped. He closes with an eight-item pre-launch checklist and the simplest test: install your own app, watch its traffic with a free proxy, and see what you can grab. 

https://shattered.io/ai-api-keys-leak-mobile-apps/

Comments

Popular posts from this blog

OWASP ASVS 5.0 Released - Key Updates and What You Need to Know

Critical OpenSSH Flaws Enable MITM and DoS Attacks

MITRE ATT&CK v19 Redefines How Defenders Model Modern Threats