T09 · Insecure Skill Coding Practices
- Location
SKILL.md:26- Finding
Feishu Application Secret Stored in Plaintext Shell Startup Files
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 26–29
Vulnerability Type: Plaintext persistence of reusable application credentials
Risk Level: Mediumbash # 永久配置(添加到 ~/.zshrc 或 ~/.bashrc) echo "export FEISHU_APP_ID='cli_xxx'" >> ~/.zshrc echo "export FEISHU_APP_SECRET='xxx'" >> ~/.zshrc source ~/.zshrcTechnical Analysis
The Skill recommends writing the Feishu App ID and reusable App Secret directly into a shell startup file such as
~/.zshrcor~/.bashrc. These files are plaintext, are loaded into interactive shell environments, and are not designed to provide secure secret storage.This practice increases credential exposure through user-level processes, shell configuration backups, support bundles, accidental repository commits, synchronization services, overly permissive file permissions, or unintended environment-variable inheritance by child processes. The project does not contain a hardcoded production credential; the vulnerability arises from the documented credential-storage procedure.
Sending the credentials to Feishu's official tenant-token endpoint in
scripts/send_feishu_file.pyis necessary for the declared functionality. The security issue is their persistent plaintext storage, not their transmission to that official HTTPS endpoint.Attack Path
- A user follows the documented permanent configuration procedure.
- The Feishu App Secret is written unencrypted to
~/.zshrcor~/.bashrc. - A malicious or compromised process operating as that user, an exposed backup, or an accidental configuration-file disclosure obtains the startup file.
- The attacker extracts the Feishu App ID and App Secret.
- The attacker submits those credentials to Feishu's tenant access-token endpoint.
- If the credentials remain valid and tenant controls permit the request, the attacker receives a tenant access token.
- The attacker exercises the permissions granted to the assoc ...[truncated 722 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove the recommendation to store
FEISHU_APP_SECRETdirectly in shell startup files. - Store the secret in an operating-system credential manager, enterprise secret manager, or another access-controlled secret store.
- Inject credentials only into the process that needs them and avoid exporting them globally to every child process of an interactive shell.
- If file-based storage is unavoidable, use a dedicated configuration file outside source repositories, restrict it to the owning user with mode
0600, and load it only immediately before invoking the sender. - Ensure shell startup files and secret files are excluded from source control, backups, diagnostic bundles, and synchronization where appropriate.
- Rotate credentials that have already been stored in plaintext startup files.
- Grant the Feishu application only the minimum API scopes required to upload and send files, and periodically review those scopes.
- Avoid including credentials, tenant tokens, or authorization headers in logs and error messages.
- Remove the recommendation to store
