T09 · Insecure Skill Coding Practices
- Location
SKILL.md:63- Finding
Insecure Credential Storage Fallback
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 63–72
Vulnerability Type: Insecure storage of OAuth credentials
Risk Level: MediumVulnerable Code:
text Newer gog versions may store only the OAuth client ID in `credentials.json` and keep the client secret in the OS keyring. `slidesmith auth doctor` checks both; if the keyring read is unavailable, follow its macOS Keychain guidance or use `GOG_ACCESS_TOKEN` / `gog auth credentials <file> --insecure` as a fallback. In a non-interactive process, keyring calls time out after 5 seconds instead of hanging on a Keychain prompt, and session-token operations fall back to the 0600 file store. Set `SLIDESMITH_KEYRING_TIMEOUT=<float-seconds>` to override that bound, or `SLIDESMITH_KEYRING_TIMEOUT=0` to disable all keyring access; `SLIDESMITH_TOKEN_STORE=file` selects only the session store, not gogcli's bounded client-secret lookup.Technical Analysis
The Skill recommends
gog auth credentials <file> --insecurewhen secure keyring access is unavailable. This fallback can store OAuth client credentials outside an operating-system-backed credential vault. File permissions such as mode0600reduce access by other local users but do not provide encryption at rest or protection from processes running under the same user account.The same section also documents options that disable keyring access and select a file-based token store. If these options are used without an external secret manager or equivalent protection, OAuth client secrets or session tokens may be exposed through local files, backups, filesystem snapshots, malware operating as the user, or accidental workspace disclosure.
Attack Path
- Secure keyring access is unavailable, times out, or is disabled.
- The user follows the documented fallback and imports credentials using
gog auth credentials <file> --insecure, or selects file-based token storag ...[truncated 1134 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove the recommendation to use
gog auth credentials <file> --insecureas a routine fallback. - Require an operating-system-backed keyring or an approved external secret manager for persistent OAuth client secrets and refresh tokens.
- For non-interactive environments, inject short-lived access tokens through a protected CI/CD secret facility rather than persisting them in a workspace.
- If file storage is unavoidable, store credentials outside the project directory, enforce owner-only permissions, use encrypted storage, exclude the location from backups and version control, and document secure deletion procedures.
- Warn users that environment variables may be exposed through process inspection, crash reports, logs, or CI diagnostics; ensure commands never print token values.
- Document token rotation and revocation procedures for cases where insecure storage may already have been used.
- Fail closed when protected credential storage is unavailable instead of silently or routinely degrading to plaintext file storage.
- Remove the recommendation to use
