T09 · Insecure Skill Coding Practices
- Location
SKILL.md:17- Finding
Credential-Handling Functionality Is Delegated to Missing and Unauditable Scripts
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:17-45
Additional References:README.md:13-14,README.md:27-36,README.md:64-66
Vulnerability Type: Sensitive credential handling through missing executable components
Risk Level: MediumEvidence
markdown ### `claude-usage` Reads the Claude Code OAuth token from macOS Keychain and calls the Anthropic usage API. ```bash # Human-readable output with color bars scripts/claude-usage # JSON output (for programmatic use) scripts/claude-usage --jsonRequirements:
- macOS with
securityCLI (Keychain access) - Claude Code OAuth token in Keychain (run
claude loginto set up) - Token needs
user:profilescope (standard Claude Code login provides this)
Token location: macOS Keychain, service
Claude Code-credentials, account = your macOS username.openai-usageReads the OpenAI OAuth token from OpenClaw's auth-profiles and calls the ChatGPT usage API.
bash # Human-readable output with color bars scripts/openai-usage # JSON output scripts/openai-usage --jsonRequirements:
- OpenClaw with an authenticated
openai-codexprofile (runopenclaw auth openai-codex) - Auth profiles at
~/.openclaw/agents/main/agent/auth-profiles.json
text ### Technical Analysis The skill explicitly claims that `scripts/claude-usage` reads a Claude OAuth token from macOS Keychain and that `scripts/openai-usage` reads an OpenAI OAuth token from an OpenClaw authentication-profile file. However, the audited package contains only `README.md` and `SKILL.md`; neither referenced executable is present. Consequently, the security-critical implementation cannot be examined for: - Restriction of outbound requests to official Anthropic and OpenAI endpoints. - Safe construction of HTTP requests and command arguments. - Prevention of OAuth-token disclosure through standard output, error output, logs, or except ...[truncated 2774 chars]- macOS with
- Remediation
View remediation
Remediation Suggestions
- Include
scripts/claude-usageandscripts/openai-usagein the same reviewed and versioned package, or remove all commands and claims referring to them. - Pin the scripts to a verifiable release and publish cryptographic checksums or signed release artifacts.
- Restrict network requests to hard-coded, documented HTTPS origins operated by Anthropic and OpenAI. Reject redirects to other origins and retain TLS certificate verification.
- Request and use only the minimum OAuth scopes required to retrieve usage information.
- Never print, persist, cache, or include access tokens in command arguments, URLs, diagnostics, exception traces, or telemetry.
- Read authentication files without modifying them, validate ownership and restrictive permissions, and avoid copying their contents into temporary files.
- If temporary storage is unavoidable, use securely created user-only files and guarantee cleanup on normal and exceptional exits.
- Add automated tests covering token redaction, endpoint allowlisting, redirect rejection, malformed authentication data, timeout behavior, and failure paths.
- Update the installation documentation so users are not encouraged to obtain missing scripts from unofficial sources.
- Ensure release validation fails when documentation references executable files that are absent from the packaged artifact.
- Include
