T09 · Insecure Skill Coding Practices
- Location
SKILL.md:47- Finding
Plaintext API Key Storage Without Access-Control Requirements
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:47-54
Vulnerability Type: Plaintext credential storage
Risk Level: MediumVulnerable Code:
json Store credentials: // ~/.config/vydra/credentials.json { "api_key": "vydra_live_xxx", "agent_name": "YourAgentName" }Technical Analysis
The Skill instructs the agent to persist a bearer API key in a plaintext JSON file under the user's home directory. It does not require restrictive permissions for either the configuration directory or the credential file.
Bearer tokens grant access based solely on possession. Consequently, any local user, process, backup service, diagnostic utility, or unrelated agent capable of reading this file could use the token. This storage is not required for the declared functionality because the Skill metadata already identifies
VYDRA_API_KEYas the supported environment variable.The behavior exceeds minimum privilege by introducing persistent filesystem access to sensitive credentials where an ephemeral environment variable or operating-system secret manager would suffice.
Attack Path
- An agent self-registers with Vydra and receives an API key.
- Following the Skill instructions, it creates
~/.config/vydra/credentials.json. - The file is created using the process's default permissions, which may permit access by other local principals or services.
- An unrelated local process, another user, a backup collector, or a compromised agent reads the file.
- The attacker extracts the bearer API key.
- The attacker submits authenticated requests to Vydra and consumes the victim's paid credits or accesses account-scoped API functionality.
Impact Assessment
Exploitation grants the attacker the same Vydra API privileges as the exposed key. The likely scope includes generating paid media, checking credit information, and invoking other endpoints authorized for the associated account or organiza ...[truncated 328 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove the instruction to store the API key in a plaintext JSON file.
- Use the already-declared
VYDRA_API_KEYenvironment variable or an operating-system credential manager. - If file-based storage is unavoidable:
- Create
~/.config/vydrawith permission mode0700. - Create
credentials.jsonwith permission mode0600. - Reject or repair files with broader permissions before reading them.
- Avoid following symbolic links when creating or updating the file.
- Write updates atomically and never use shared temporary directories.
- Create
- Ensure credentials are excluded from source control, logs, command output, telemetry, crash reports, and backups where feasible.
- Document key rotation and revocation procedures.
- Use narrowly scoped, revocable tokens if the Vydra service supports them.
