T09 · Insecure Skill Coding Practices
- Location
scripts/qutedance-quotes.js:25- Finding
Plaintext API Key Storage in Tracked Configuration Is Encouraged and Prioritized
- Content
View full analysis
Vulnerability Details
File Location:
scripts/qutedance-quotes.js:25-28; related documentation atSKILL.md:20-22and configuration field atconfig.json:3
Vulnerability Type: Plaintext secret storage and insecure credential precedence
Risk Level: MediumVulnerable Code
js const API_KEY = CONFIG.apiKey || process.env.QUTEDANCE_API_KEY || '';Related documented configuration:
json { "serviceUrl": "https://quotedance.api.gapgap.cc", "apiKey": "" }The documentation explicitly directs users to place the API key in the configuration file for convenience. The distributed configuration currently contains an empty value, so no active credential was exposed in the audited artifact.
Technical Analysis
The implementation reads
apiKeyfrom the repository-localconfig.jsonbefore checking theQUTEDANCE_API_KEYenvironment variable. This design encourages users to save a live credential as plaintext inside the Skill directory and makes the less secure source take precedence over the safer environment-based mechanism.A populated configuration file can subsequently be committed to source control, included in backups or archives, copied with the workspace, or disclosed when the Skill directory is shared. The script then transmits the key in the
X-API-Keyheader over HTTPS to the declared Qutedance service. That network transmission is necessary for the documented authentication flow and is not, by itself, covert exfiltration; the security issue is the credential's persistent plaintext storage.Attack Path
- A user follows the documentation and writes a valid Qutedance API key into
config.json. - The plaintext configuration is committed, archived, backed up, or shared with the Skill directory.
- An unauthorized party obtains read access to that copy and extracts the API key.
- The party submits the stolen key in an
X-API-Keyheader to the configure ...[truncated 890 chars]
- A user follows the documentation and writes a valid Qutedance API key into
- Remediation
View remediation
Remediation Suggestions
- Remove support for credentials stored in tracked
config.json, or reserve that file exclusively for non-sensitive settings. - Read the key from
QUTEDANCE_API_KEYor a platform-managed secret store:js const API_KEY = process.env.QUTEDANCE_API_KEY || ''; - Update
SKILL.mdto instruct users never to place credentials in repository files. - If file-based secrets are operationally necessary, use a separate untracked file with restrictive filesystem permissions and add it to
.gitignore. - Provide only a redacted example configuration, such as
config.example.json, without anapiKeyvalue. - Fail with a clear message when authentication is required but no key is available; never print the key in errors or logs.
- Scan repository history and distributed archives for previously committed keys. Revoke and rotate any credential that may have been exposed.
- Retain HTTPS certificate verification and restrict the service URL to approved HTTPS origins where deployment requirements permit.
- Remove support for credentials stored in tracked
