T09 · Insecure Skill Coding Practices
- Location
SKILL.md:31- Finding
Unredacted Environment Variables May Expose Supabase Credentials
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 31–32
Vulnerability Type: Plaintext sensitive-data exposure
Risk Level: MediumComplete Code Snippet:
bash # Check for exposed keys grep -rn "SUPABASE_\|supabase\.\(url\|key\|anon\)" .env* src/ | head -10Technical Analysis
The skill instructs the agent to search
.env*and source files for Supabase-related values. Becausegrepreturns the entire matching line without redaction, the command can expose complete credentials—including aSUPABASE_SERVICE_ROLE_KEY—to the agent context and any generated audit report.Searching for exposed credentials is consistent with the skill's security-audit purpose. However, ingesting complete secret values is unnecessary: variable names, file locations, and redacted value metadata are sufficient to identify insecure storage. The command does not transmit data externally, but secrets may persist in session transcripts, model-processing infrastructure, logs, or reports.
Attack Path
- The audited project stores a Supabase credential in an
.env*file or matching source file. - The agent executes the documented
grepcommand during project discovery. grepprints the complete matching line, including the credential value.- The secret enters the agent context and may be quoted in the audit report or retained in associated logs.
- A party with access to that transcript, report, or logging system obtains the credential.
- If the exposed value is a
service_rolekey, the party can authenticate with elevated Supabase API privileges and bypass Row Level Security within the affected project.
Impact Assessment
The impact depends on the credential discovered. Exposure of an anonymous key generally provides only the access allowed by configured RLS and API policies. Exposure of a
service_rolekey can permit privileged database and storage operations through Supabase APIs, bypass RLS, ...[truncated 279 chars]- The audited project stores a Supabase credential in an
- Remediation
View remediation
Remediation Suggestions
- Search for variable names and locations without returning raw values.
- Redact everything after the assignment delimiter before output reaches the agent:
bash grep -rnE 'SUPABASE_[A-Z0-9_]*=' .env* src/ 2>/dev/null | sed -E 's/(=.*)$/=[REDACTED]/' | head -10 - Add an explicit instruction that complete API keys, JWTs, passwords, and connection strings must never be displayed, stored, or included in reports.
- Report only the file path, line number, credential type, and whether the value appears hardcoded.
- If a privileged credential has already entered logs or an audit report, remove it where possible, restrict access to affected records, rotate the credential immediately, and review Supabase access logs for unauthorized use.
- Prefer secret-scanning tools configured to mask detected values and to exclude generated files, dependencies, and unrelated directories.
