T09 · Insecure Skill Coding Practices
- Location
SKILL.md:62- Finding
Plaintext Storage of an Overprivileged GitHub Access Token
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 62–68 and 133–137
Vulnerability Type: Plaintext credential storage and excessive token permissions
Risk Level: HighVulnerable Code
SKILL.md, lines 62–68:markdown Create `~/.openclaw/daily-ops-config.json`: ```json { "github_token": "ghp_xxx", "watch_topics": ["ai", "open-source", "developer-tools"],SKILL.md, lines 133–137:markdown ## Requirements - `gh` CLI authenticated with appropriate scopes - GitHub token with: `repo`, `read:user`, `public_repo` - OpenClaw with `github` skill installedTechnical Analysis
The Skill instructs users to store a GitHub access token directly in a plaintext JSON configuration file under the user's home directory. It does not require restrictive file permissions, encryption, an operating-system credential store, or a dedicated secrets manager. Consequently, the token may be exposed to other local users, processes, backup systems, diagnostic tools, or accidental configuration-file disclosure.
The requested permissions also exceed the minimum privileges evidently required by the declared workflow. The broad classic
reposcope can grant access to private repositories and repository write operations, while the described activities primarily concern public trending projects, stars, comments, issue updates, and report publication. The simultaneous request forrepoandpublic_repois redundant becauserepoencompasses public-repository access.No real token is embedded in the package—the displayed
ghp_xxxvalue is a placeholder. The vulnerability arises from instructing users to persist their actual credential insecurely and to grant it unnecessarily broad authority.Attack Path
- A user configures the Skill by placing a real GitHub token in
~/.openclaw/daily-ops-config.json. - The user grants the documented
repo,read:user, andpublic_reposcopes.
...[truncated 1433 chars]
- A user configures the Skill by placing a real GitHub token in
- Remediation
View remediation
Remediation Suggestions
- Do not store GitHub tokens directly in
daily-ops-config.json. Keep only a secret reference or credential identifier in the configuration file. - Retrieve credentials at runtime from an operating-system keychain, a dedicated secrets manager, or GitHub CLI's protected authentication store.
- If file-based storage is unavoidable, place the secret in a separate file, require permission mode
0600, verify ownership before use, and prevent the file from being committed, logged, backed up insecurely, or included in reports. - Prefer a fine-grained personal access token or GitHub App installation token restricted to explicitly configured repositories.
- Grant only the permissions needed for enabled operations. Do not request private-repository access when the workflow targets only public repositories.
- Remove the redundant combination of
repoandpublic_repo; avoid the broad classicreposcope wherever possible. - Separate read-only trending and health-check operations from write operations. Request write credentials only when starring, commenting, updating issues, or uploading reports is explicitly enabled.
- Add token expiration, rotation, and revocation guidance, and instruct users to review the GitHub audit log after suspected exposure.
- Redact credentials from generated reports, command output, exceptions, logs, and social-platform publishing content.
- Do not store GitHub tokens directly in
