T09 · Insecure Skill Coding Practices
- Location
scripts/script.sh:6- Finding
Generated Shell Commands Permit Command Injection Through Unescaped Arguments
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This Supabase helper is transparent about its purpose, but it needs review because it generates copy-and-run shell commands for raw SQL and database writes without safe input quoting.
Review this skill before installing. Use it only with Supabase projects you control, inspect every generated command before running it, avoid passing untrusted SQL/table/filter/JSON values, and prefer least-privilege credentials instead of placing powerful management tokens directly in shell commands.
scripts/script.sh:6Generated Shell Commands Permit Command Injection Through Unescaped Arguments
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
#!/usr/bin/env bash
# supabase-tool — Generate Supabase API curl commands and SQL helpers
set -euo pipefail
cmd_query() {
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
cat << EOF
# Query table: $table (limit $limit)
curl -s "https://YOUR_PROJECT_REF.supabase.co/rest/v1/$table?limit=$limit${filter}" \\
-H "apikey: YOUR_ANON_KEY" \\
-H "Authorization: Bearer YOUR_ANON_KEY" | python3 -m json.tool
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
cat << EOF
# Insert record into table: $table
curl -s -X POST "https://YOUR_PROJECT_REF.supabase.co/rest/v1/$table" \\
-H "apikey: YOUR_ANON_KEY" \\
-H "Authorization: Bearer YOUR_ANON_KEY" \\
-H "Content-Type: application/json" \\
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# Project URL: https://YOUR_PROJECT_REF.supabase.co
# Anon key: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... (safe for client use)
# Access token: sbp_xxx (for management API — from https://supabase.com/dashboard/account/tokens)
# Quick test:
# curl -s "https://YOUR_PROJECT_REF.supabase.co/rest/v1/" -H "apikey: YOUR_ANON_KEY"
The skill exposes shell-based execution patterns via bash scripts/script.sh ... but does not declare any tool scope or permissions boundaries. That omission weakens reviewability and enforcement, making it easier for an agent or user to invoke database-affecting commands without an explicit statement of what capabilities the skill requires.
The trigger list includes broad terms like sql query, database health, count rows, and postgresql, which can cause the skill to activate in many generic database contexts beyond Supabase-specific intent. Overbroad auto-invocation increases the chance that shell commands or write-capable database helpers are suggested or run in situations where the user did not intend to use this skill.
The skill advertises command generation for querying, inserting records, running raw SQL, and checking health, but it does not clearly warn that generated commands may send data to external Supabase APIs or modify database state. In this context, the missing warning is significant because the skill includes both raw SQL and insert functionality, which raises the risk of unintended writes, sensitive data disclosure, or unsafe command use by a user who assumes the actions are read-only.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
#!/usr/bin/env bash
# supabase-tool — Generate Supabase API curl commands and SQL helpers
set -euo pipefail
cmd_query() {
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# Run SQL query against your Supabase project
# Replace YOUR_PROJECT_REF, YOUR_ACCESS_TOKEN, and YOUR_SQL:
curl -s -X POST "https://api.supabase.com/v1/projects/YOUR_PROJECT_REF/database/query" \\
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \\
-H "Content-Type: application/json" \\
-d '{"query": "$sql"}' | python3 -m json.tool
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# Run SQL query against your Supabase project
# Replace YOUR_PROJECT_REF, YOUR_ACCESS_TOKEN, and YOUR_SQL:
curl -s -X POST "https://api.supabase.com/v1/projects/YOUR_PROJECT_REF/database/query" \\
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \\
-H "Content-Type: application/json" \\
-d '{"query": "$sql"}' | python3 -m json.tool
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# Run SQL query against your Supabase project
# Replace YOUR_PROJECT_REF, YOUR_ACCESS_TOKEN, and YOUR_SQL:
curl -s -X POST "https://api.supabase.com/v1/projects/YOUR_PROJECT_REF/database/query" \\
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \\
-H "Content-Type: application/json" \\
-d '{"query": "$sql"}' | python3 -m json.tool
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
cat << EOF
# Insert record into table: $table
curl -s -X POST "https://YOUR_PROJECT_REF.supabase.co/rest/v1/$table" \\
-H "apikey: YOUR_ANON_KEY" \\
-H "Authorization: Bearer YOUR_ANON_KEY" \\
-H "Content-Type: application/json" \\
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
cat << 'EOF'
# List all public tables in your Supabase project
curl -s -X POST "https://api.supabase.com/v1/projects/YOUR_PROJECT_REF/database/query" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"query": "SELECT table_name FROM information_schema.tables WHERE table_schema='"'"'public'"'"' ORDER BY table_name"}' | \
No suspicious patterns detected.