Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Security issue with api key in html #7

Open
synth opened this issue Oct 20, 2024 · 0 comments
Open

Security issue with api key in html #7

synth opened this issue Oct 20, 2024 · 0 comments

Comments

@synth
Copy link

synth commented Oct 20, 2024

This is more of a question: Is it safe to include the API in the html as its described in the README? This seems like anyone can grab your OpenAI API key and use for their own purposes. To secure the API key, the key would need to be domain locked which, to my knowledge, OpenAI does not currently support client side keys that can be domain locked.

As an alternative, this tool can implement the ability to specify an alternative backend, such as our own server which holds the API key securely. Then our own server can validate something like CSRF token to ensure the request comes from html that is served on a legitimate host before proxying to OpenAI API. It's obviously a bit slower and involves having a host that can do this, but it's way more secure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant