T09 · Insecure Skill Coding Practices
- Location
SKILL.md:118- Finding
Bearer Token Collection Through Chat and Plaintext Filesystem Storage
- Content
View full analysis
``` 4. 重跑 `python3 scripts/search_news.py --check-config` 确认 `configured: true`,再继续用户原请求 脚本内置的 `load_dotenv()` 自动读取 `.env`,环境变量优先于文件。更多约束(如跨 agent 禁止共享凭证)见 [references/aep-setup.md](references/aep-setup.md)。 ``` Supporting instructions from `references/aep-setup.md:20-36`: ```markdown ### Step 2 · 引导用户提供凭证 对用户说: > 使用外贸资讯查询需要 AEP 凭证。请到 https://tools.mentarc.cn/aim-skills/ 注册获取 AEP_AUTHORIZATION(Bearer token),然后把凭证粘到对话框里发给我,我会帮你配好。 **不要**让用户自己编辑文件或设置环境变量。 ### Step 3 · 持久化凭证 将凭证写入 skill 目录下的 `.env` 文件: ``` AEP_AUTHORIZATION=<用户提供的token> ``` 只需填写 token 值,脚本会自动补全 `Bearer` 前缀。 ``` ### Technical Analysis The Skill explicitly directs users to paste an authentication bearer token into the conversation and directs the Agent to persist that token in a plaintext `.env` file. This creates two independent exposure surfaces: 1. The credential can remain in conversation history, Agent traces, telemetry, or operational logs. 2. The plaintext file can be read through local account compromise, overly broad filesystem permissions, backups, diagnostic archives, or another process operating under the same user. The `.gitignore` entry for `.env` only reduces accidental Git commits. It does not encrypt the token, restrict filesystem access, remove it from chat records, or prevent bac ...[truncated 1585 chars]- Remediation
View remediation
