T09 · Insecure Skill Coding Practices
- Location
SKILL.md:24- Finding
Plaintext Storage of an Overprivileged GitHub Access Token
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 24–48
Vulnerability Type: Plaintext sensitive credential storage and excessive token permissions
Risk Level: MediumVulnerable Code Snippet
markdown **Token permission requirements:** - `repo` - Full repository operations - `read:user` - Read user information - `workflow` - GitHub Actions operationsjson { "env": { "GITHUB_TOKEN": "ghp_xxxxxxxxxxxx" } }Technical Analysis
The Skill instructs users to persist a GitHub personal access token directly in
~/.openclaw/openclaw.json. Although the displayed token is a placeholder rather than an exposed live credential, following this configuration pattern places the actual token in a plaintext file.The requested classic-token scopes are also broad. The
reposcope may provide read and write access to private repositories, whileworkflowpermits GitHub Actions workflow operations. These permissions are prescribed globally rather than being limited to the repositories and operations required for a particular task.The documentation does not require restrictive file permissions, token expiration, repository restrictions, secret-manager integration, or fine-grained permissions. Consequently, another local user or process, an insecure backup, or an accidentally published configuration could disclose a reusable and highly privileged credential.
Attack Path
- A user follows the documented instructions and writes a real GitHub token into
~/.openclaw/openclaw.json. - A local process, another user with file access, an untrusted plugin, a backup system, or an accidentally committed configuration obtains the plaintext token.
- The attacker extracts the
GITHUB_TOKENvalue and uses it to authenticate to the GitHub API. - The attacker performs operations allowed by the token's scopes and repository authorization.
- Depending on the token's effective access, the attacker reads private repository content, mo ...[truncated 921 chars]
- A user follows the documented instructions and writes a real GitHub token into
- Remediation
View remediation
Remediation Suggestions
- Replace classic broadly scoped personal access tokens with fine-grained GitHub tokens.
- Restrict each token to the minimum required repositories and operations.
- Request permissions per use case instead of prescribing
repoandworkflowglobally. - Store credentials in an operating-system keychain or dedicated secret manager and inject them only at runtime.
- If file-based storage is unavoidable, require owner-only file permissions, such as mode
0600, and ensure the configuration is excluded from version control and insecure backups. - Use short token expiration periods and establish regular rotation and immediate revocation procedures.
- Document how users can verify the token's effective repository access and permissions before use.
- Avoid printing tokens in command output, logs, diagnostics, or error messages.
