T09 · Insecure Skill Coding Practices
- Location
SKILL.md:11- Finding
Hard-Coded API Credential and Insecure Plaintext Persistence
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 11–13
Vulnerability Type: Hard-coded secret and plaintext credential storage
Risk Level: Highbash export VOLCENGINE_API_KEY="222b33d4-f22f-4f99-b68f-0eb9150ab507" # 或在 ~/.bashrc 中持久化 echo 'export VOLCENGINE_API_KEY="222b33d4-f22f-4f99-b68f-0eb9150ab507"' >> ~/.bashrcTechnical Analysis
The Skill embeds a concrete Volcengine API credential directly in its documentation rather than using a placeholder. Anyone who can access the Skill package can extract and attempt to use this credential.
The instructions also recommend appending the credential to
~/.bashrc. This stores the secret in plaintext and automatically exports it into subsequent interactive shell environments. The credential may consequently be exposed through repository copies, workstation backups, shell configuration disclosure, diagnostic output, or access to the environments of descendant processes.Although modifying
~/.bashrcpersists a configuration value across shell sessions, the observed command does not install a backdoor or malicious startup hook. The primary issue is therefore insecure secret handling underT09, not confirmed system persistence underT06.Attack Path
- An attacker obtains a copy of
SKILL.mdfrom the distributed Skill package or another location where it was copied. - The attacker extracts the embedded value assigned to
VOLCENGINE_API_KEY. - The attacker submits requests with
Authorization: Bearer <extracted-key>to the documented Volcengine Ark API. - If the credential remains valid, the attacker invokes any API operations and accesses any resources authorized by its assigned permissions.
- Alternatively, after a user follows the persistence instruction, an attacker with read access to that user's
~/.bashrc, backups, or exported process environment can recover the same credential.
Impact Assessment
Successful exploitation could permit unauthorized use ...[truncated 485 chars]
- An attacker obtains a copy of
- Remediation
View remediation
Remediation Suggestions
- Immediately revoke the exposed credential and issue a replacement, because removing it from the current file does not invalidate copies already distributed or retained in history.
- Replace the concrete value with a nonfunctional placeholder:
bash export VOLCENGINE_API_KEY="YOUR_VOLCENGINE_API_KEY" - Require every user to provision an individual credential with only the minimum API permissions needed for the intended operations.
- Avoid recommending plaintext storage in
~/.bashrc. Prefer an operating-system credential store, secrets manager, protected CI/CD secret, or runtime credential injection. - If environment variables must be used, supply them only for the required process or session and ensure they are not printed in logs or diagnostic output.
- Review repository history, published packages, logs, backups, and documentation mirrors for additional copies of the exposed secret.
- Enable provider-side usage alerts, restrictive quotas, credential expiration, and audit logging to detect and limit unauthorized use.
- Add automated secret scanning to the publication workflow to prevent future credentials from being committed or distributed.
