T09 · Insecure Skill Coding Practices
- Location
scripts/get_token.py:89- Finding
Feishu credentials and access tokens are stored in plaintext without enforced file permissions
- Content
View full analysis
app.json ``` ### Technical Analysis The application secret is stored in `scripts/env/app.json`, and the resulting tenant access token is stored in `scripts/env/token_cache.json`. Both are plaintext files. `Path.write_text()` creates the token cache using permissions derived from the process umask. The code does not explicitly enforce owner-only permissions such as `0600`, does not securely create the file, and does not use a secret-management facility. The development documentation claims that `scripts/.gitignore` protects `app.json` and `token_cache.json`, but no such file is present in the audited project. This increases the chance that credentials will be committed to version control or included in an archive. The network transmission of `app_id` and `app_secret` itself is expected and necessary: it uses HTTPS and targets the declared official Feishu endpoint. The finding concerns local storage rather than evidence of exfiltration. ### Attack Path 1. A user follows the setup instructions and creates `scripts/env/app.json`. 2. `get_token.py` obtains a tenant token and writes it to `scripts/env/token_cache.json`. 3. The files inherit ambient filesystem permissions ins ...[truncated 948 chars]- Remediation
View remediation
