T09 · Insecure Skill Coding Practices
- Location
SKILL.md:47- Finding
Plaintext API Key Storage Is Recommended
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 47–51
Vulnerability Type: Plaintext sensitive-data storage
Risk Level: MediumVulnerable Documentation
text **Method 2** - Password document (recommended): Add the following to `secrets/key存储文档.txt`:text Meta AI api:your_api_key_hereTechnical Analysis
The skill documentation recommends storing the Meta AI API key in an ordinary plaintext file. It does not require encryption, restrictive filesystem permissions, placement outside the repository, exclusion from version control, or integration with an operating-system secret store.
Because the method is explicitly marked as recommended, users may choose it instead of the environment variable declared in
skill.json. API keys are bearer credentials: any party that obtains the value can generally use it without possessing additional authentication factors.Attack Path
- A user follows the documented configuration procedure.
- The user writes a valid API key to
secrets/key存储文档.txt. - The file is exposed to another local user or process, included in a backup, indexed by a development tool, or accidentally committed to source control.
- An unauthorized party retrieves the key from the plaintext file.
- The unauthorized party submits requests to the Meta AI API using the compromised bearer credential.
Impact Assessment
Exploitation does not directly grant operating-system privileges. It grants the attacker the API access associated with the exposed key, potentially allowing unauthorized searches, consumption of the victim's API credits or quota, and access to any capabilities assigned to that credential. The scope is limited by the permissions and account limits attached to the compromised API key.
- Remediation
View remediation
Remediation Suggestions
- Remove the recommendation to store API keys in a plaintext document.
- Use the
METASO_API_KEYenvironment variable or an operating-system credential manager. - If file-based storage must be supported:
- Store the file outside the project and source-control directories.
- Restrict access to the owning account using filesystem permissions.
- Add the credential path to version-control ignore rules.
- Prevent backup, logging, indexing, and diagnostic tools from collecting the file.
- Validate permissions before reading the credential and refuse overly permissive files.
- Document key rotation and immediate revocation procedures for suspected exposure.
- Ensure the implementation never prints the key in logs, command output, or exception messages.
