#API key was exposed - last used field is not being updated and is set to never

1 messages · Page 1 of 1 (latest)

uneven raptor
#

Hey guys! Our API key has been exposed and we've reached our usage limits. API key is stored as an env variable. Our application is hosted on AWS. When we found out about this yesterday, we've generated a new key, increased the limit to test if the problem will appear again. And it appeared. Can you help?

stiff kite
#

Hi @uneven raptor this must be an issue with your implementation because OpenAI's key generation is secure, the key won't be exposed unless you expose it yourself or some part of your application code exposes it.

#

Are you making any frontend-bound API calls by any chance? If so, that could be exposing your key

olive wasp
#

This happens all the time

uneven raptor
#

But how is it possible to retrive token by reverse engineering?

#

@olive wasp

olive wasp
#

But they could be using your token to generate responses using your api

#

Is it a web application that you are hosting?

uneven raptor
#

yeah

#

Any solutions on how to protect from such actions?

olive wasp
#

Can I maybe see it?

#

So I can see if there are any obvious vulnerabilities

#

And are you just making a web request to your API without any authentication?

stiff kite
#

Yeah it would be useful for us to see the implementation so we can spot vulnerabilities

jagged zodiac
#

are you checking the env var into github?

#

and is your app in a private repo?