T09 · Insecure Skill Coding Practices
- Location
SKILL.md:32- Finding
Sensitive credentials are exposed through diagnostic output and plaintext reports
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 32-42; related occurrences at lines 57 and 111
Vulnerability Type: Plaintext sensitive-data exposure
Risk Level: HighVulnerable Code
markdown | Env var | `NEXT_PUBLIC_SUPABASE_URL` | `echo $NEXT_PUBLIC_SUPABASE_URL` | stack-scaffold, supabase-ops | | Env var | `NEXT_PUBLIC_SUPABASE_ANON_KEY` | `echo $NEXT_PUBLIC_SUPABASE_ANON_KEY` | stack-scaffold, supabase-ops | | Env var | `SUPABASE_SERVICE_ROLE_KEY` | `echo $SUPABASE_SERVICE_ROLE_KEY` | supabase-ops, firebase-auth-setup | | Env var | `NEXT_PUBLIC_FIREBASE_API_KEY` | `echo $NEXT_PUBLIC_FIREBASE_API_KEY` | stack-scaffold, firebase-auth-setup | | Env var | `NEXT_PUBLIC_FIREBASE_PROJECT_ID` | `echo $NEXT_PUBLIC_FIREBASE_PROJECT_ID` | stack-scaffold, firebase-auth-setup | | Env var | `FIREBASE_PROJECT_ID` | `echo $FIREBASE_PROJECT_ID` | firebase-auth-setup | | Env var | `FIREBASE_CLIENT_EMAIL` | `echo $FIREBASE_CLIENT_EMAIL` | firebase-auth-setup | | Env var | `FIREBASE_PRIVATE_KEY` | `echo $FIREBASE_PRIVATE_KEY \| head -c 20` | firebase-auth-setup | | Env var | `VERCEL_TOKEN` | `echo $VERCEL_TOKEN \| head -c 10` | deploy-pilot | | Env var | `CLOUDFLARE_API_TOKEN` | `echo $CLOUDFLARE_API_TOKEN \| head -c 10` | cloudflare-guard | | Env var | `CLOUDFLARE_ZONE_ID` | `echo $CLOUDFLARE_ZONE_ID` | cloudflare-guard |Additional affected instructions include:
markdown | Env var | `OPENROUTER_API_KEY` (optional) | `echo $OPENROUTER_API_KEY \| head -c 10` | web-scraper (Stage 5 only) |markdown Save the report to `preflight-report.json` in the project root.Technical Analysis
The skill checks whether credentials are configured by printing their values. In particular,
SUPABASE_SERVICE_ROLE_KEYis printed in full. Other sensitive values, including the Firebase private key, Vercel token, Cloudflare API token, and OpenRouter API key, have prefixes printed.Credential ...[truncated 2488 chars]
- Remediation
View remediation
Remediation Suggestions
-
Replace all secret-printing commands with presence-only checks:
sh if test -n "${SUPABASE_SERVICE_ROLE_KEY:-}"; then printf '%s\n' "set" else printf '%s\n' "missing" fi -
Apply the same pattern to every credential, including
FIREBASE_PRIVATE_KEY,VERCEL_TOKEN,CLOUDFLARE_API_TOKEN, andOPENROUTER_API_KEY. Never print complete values, prefixes, suffixes, lengths, hashes, or other identifying fragments. -
Require report entries to contain only normalized states such as
set,missing,valid, orinvalid. Explicitly prohibit placing environment-variable values or command output containing secrets in thedetail,fix, or recommendation fields. -
Redact credentials defensively before displaying or serializing diagnostic data, even when a check unexpectedly returns sensitive content.
-
If
preflight-report.jsonmust be written, create it with owner-only permissions where supported, avoid following symbolic links, and add it to.gitignore. Prefer a user-approved output location outside the repository for reports that may contain environment metadata. -
Do not include credentials in shell command lines beyond what is strictly required for authenticated connectivity checks. Ensure connectivity-check output reports only success or failure and does not use verbose HTTP diagnostics that may reveal authorization headers.
-
Document report retention and deletion behavior, and advise users to remove previously generated reports and rotate any privileged credentials that may already have appeared in logs or reports.
-
