Exposed API Keys in Apps

The cluster discusses security risks of hardcoding or exposing API keys in mobile apps, web frontends, and client-side code, including how hackers can easily extract them from binaries or traffic, and debates on prevention methods like encryption or open-sourcing.

➡️ Stable 0.6x Security
2,167
Comments
20
Years Active
5
Top Authors
#3168
Topic ID

Activity Over Time

2007
1
2008
7
2009
8
2010
23
2011
51
2012
93
2013
114
2014
159
2015
90
2016
97
2017
159
2018
130
2019
133
2020
122
2021
170
2022
176
2023
228
2024
165
2025
224
2026
17

Keywords

AI GUI mainsite.url REST E.g HTML HMAC MITM URL GPT api api key keys app key token access url frontend code

Sample Comments

crashbunny May 3, 2013 View on HN

it's security theater. if someone gets in again, they can download the api keys and own you that way.

fredsted Jun 20, 2014 View on HN

Maybe the hackers found their API keys in the app binary.

numerousEnt May 1, 2023 View on HN

Out of curiosity - do you think users/companies would feel secure knowing that the app uses a common API key?

byoung2 Jan 10, 2014 View on HN

It could be that the app uses the api key (despite it being disabled), and somehow someone was able to steal it. I hope it isn't sent in plain text.

kvee Apr 5, 2023 View on HN

Also recommend open sourcing the code so everyone can see that API keys aren't being stolen

TorKlingberg Aug 9, 2017 View on HN

Lots of mobile apps ship with API credentials in the binary. The whole thing runs on the honour system basically.

llamataboot Apr 28, 2023 View on HN

it doesn't contain private keys, arguably it contains irresponsible disclosures of various ways some large API users can predictably get their keys hijacked

roywiggins Sep 10, 2025 View on HN

You still have to be pretty careful it doesn't have access to any API keys it could decide to exfiltrate...

thirsteh Apr 8, 2014 View on HN

Most API requests are signed (using HMAC) with the API secret key, and do not actually include it, so no, probably. But certainly many other things could have been read if they were vulnerable.

ec109685 Jan 25, 2016 View on HN

Can't someone just steal the API key in a currently authorized app?