Exposed API Key / API 密钥暴露在代码中 ‼️

#1
by kerkko - opened

Hi @Liyonghui !

I found your project on HuggingFace Spaces by chance while looking for a HuggingFace page related to MiniMax (https://www.minimaxi.com). Out of curiosity, I checked your project files to see if it uses the MiniMax API or runs the models locally. It looks like your project is using the API, but I noticed there’s a problem: a working API key is visible in your code here: app.py#L6.

You should move this key to secrets or environment variables so it’s not visible in the code.

Here’s what I suggest you do:
1. Log in to MiniMax and cancel/remove this API key to stop anyone from misusing it.
2. Create a new key, and when you add it to your project, use the HuggingFace guide to learn how to use secrets or environment variables in Spaces.

中文版 // Chinese Translation 你好 @Liyonghui

我偶然间在 HuggingFace Spaces 上找到了你的项目,当时我正在寻找一个与 MiniMax (https://www.minimaxi.com) 相关的 HuggingFace 页面。出于好奇,我查看了你的项目文件,想知道它是通过调用 MiniMax 的 API 还是本地运行模型。看起来你的项目正在使用 API,但我发现一个问题:一个可用的 API 密钥暴露在你的代码中:app.py#L6

你应该把这个密钥放到 secrets 或环境变量中,这样就不会直接在代码中显示。

我建议你采取以下措施:

  1. 登录 MiniMax,取消/删除这个 API 密钥,避免它被滥用。
  2. 创建一个新的密钥,并在将它添加到项目时,查看 HuggingFace 的文档,学习如何在 Spaces 中使用 secrets 或环境变量。

Kind regards / 敬上,
🌸 ✿ Lumi ✿ 🌸
🤗 HF: @kerkko ❄️

Sign up or log in to comment