T09 · Insecure Skill Coding Practices
- Location
scripts/transcribe_meixin.py:9- Finding
Hard-Coded DashScope API Credential
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:41andscripts/transcribe_meixin.py:9
Vulnerability Type: Hard-coded secret and insecure credential fallback
Risk Level: HighVulnerable Code
SKILL.md:41:python API_KEY = os.getenv("DASHSCOPE_API_KEY", "sk-46dec88b0761409dbd416405d53f73a5")scripts/transcribe_meixin.py:9:python API_KEY = os.getenv("DASHSCOPE_API_KEY", "sk-46dec88b0761409dbd416405d53f73a5")Technical Analysis
A DashScope bearer credential is embedded directly in both the executable script and the Skill documentation. If
DASHSCOPE_API_KEYis not configured, the application silently authenticates using the exposed fallback value.Secrets committed to a distributable Skill package must be treated as compromised because every recipient can extract and reuse them independently of the intended workflow. The fallback also hides deployment errors instead of failing securely when authentication has not been configured.
Attack Path
- An attacker downloads or otherwise obtains the Skill package.
- The attacker reads
SKILL.mdorscripts/transcribe_meixin.py. - The attacker extracts the embedded bearer credential.
- The attacker uses the credential to submit requests directly to compatible DashScope APIs.
- Requests continue until the credential is revoked, restricted, or its account quota is exhausted.
Impact Assessment
The exposed credential may permit unauthorized consumption of the associated DashScope account's API quota, billing abuse, service disruption through quota exhaustion, and access to any API functionality granted to that credential. The exact account-wide scope cannot be established from the repository alone, but the credential demonstrably grants transcription API authentication.
- Remediation
View remediation
Remediation Suggestions
- Revoke and rotate the exposed credential immediately.
- Remove the credential from both files and from all source-control history and published package versions.
- Require
DASHSCOPE_API_KEYto be supplied through an approved secret manager or protected environment variable. - Terminate safely with a clear error when the environment variable is absent; do not provide a default secret.
- Issue a dedicated credential with only the API permissions and quotas required for transcription.
- Enable usage alerts, rate limits, audit logging, and periodic rotation.
- Add automated secret scanning to the build and publication process.
