T09 · Insecure Skill Coding Practices
- Location
SKILL.md:41- Finding
Camera API Credentials Persisted in Plaintext Configuration
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 41–53
Vulnerability Type: Plaintext storage of sensitive credentials
Risk Level: MediumVulnerable Code
markdown ### 授权配置 如果会话中收到 `TIVS_CLI_ID` 和 `TIVS_API_KEY`,请将其写入 `openclaw.json`: ```json { "skills": { "entries": { "tg-cam-api-test": { "env": { "TIVS_CLI_ID": "{TIVS_CLI_ID}", "TIVS_API_KEY": "{TIVS_API_KEY}" } } } } }text ### Technical Analysis The Skill instructs the Agent to take camera-service credentials received through a conversation and persist them directly in `openclaw.json`. The API key is therefore stored as plaintext in a general configuration file rather than through an operating-system credential vault, dedicated secret manager, or runtime-only secret-injection mechanism. Although the Skill separately prohibits displaying the key in chat, that restriction does not protect the persisted copy. No requirements are provided for restrictive file permissions, encryption at rest, exclusion from version control and backups, credential retention, secure deletion, or key rotation. Exploitation requires an attacker or process to gain read access to the resulting configuration file or a copy of it. The documentation does not establish that the file is publicly accessible, so this is not independently a remote compromise. Nevertheless, plaintext persistence increases the consequences of local compromise, overly broad filesystem permissions, diagnostic collection, backups, or accidental repository commits. ### Attack Path 1. A user supplies `TIVS_CLI_ID` and `TIVS_API_KEY` during a conversation. 2. Following the Skill instructions, the Agent writes both values into `openclaw.json`. 3. The configuration file or one of its copies becomes readable through local access, permissive filesystem permissions, backup extraction, support bundles, or an accidenta ...[truncated 1098 chars]- Remediation
View remediation
Remediation Suggestions
- Do not write
TIVS_API_KEYdirectly intoopenclaw.json. - Store the API key in an operating-system-backed credential vault or a dedicated secret-management service, and retain only a non-sensitive reference in configuration.
- Prefer runtime-only environment injection where persistent storage is unnecessary.
- If file-based storage is unavoidable:
- Obtain explicit user consent before persistence.
- Store secrets in a separate credentials file rather than a general configuration file.
- Enforce owner-only read and write permissions.
- Exclude the file from version control, backups, logs, diagnostics, and support bundles where possible.
- Avoid printing secret-bearing configuration during debugging or error reporting.
- Encrypt the credentials at rest using keys protected separately from the file.
- Define credential retention and secure-deletion procedures.
- Provide a mechanism to revoke and rotate credentials immediately after suspected exposure.
- Use narrowly scoped, short-lived credentials if the API supports them.
- Preserve the existing instruction not to echo the API key in chat, but treat it as an additional control rather than a substitute for secure storage.
- Do not write
