Back to skill

Security audit

Ecosincronia Supabase

Security checks for vulnerabilities and agentic risk

Overview

This Supabase skill is mostly purpose-aligned, but it needs review because it uses a full-access service-role key for broad database and raw SQL operations without strong safeguards.

Install only if you intend to let the agent operate as a privileged Supabase administrator. Use a dedicated project or tightly scoped credentials where possible, verify SUPABASE_URL before any run, avoid entering confidential vector-search text unless OpenAI transmission is acceptable, and require manual review before raw SQL, update, delete, or RPC operations.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/supabase.sh:231
Finding

Mutation Safety Guard Accepts Non-Predicate Query Options

Content
View full analysis
&2 exit 1 fi local url="${REST_URL}/${table}?${filters:1}" api_request PATCH "$url" "$data" | jq . ``` The delete operation uses the same insufficient check: ```bash local filters filters=$(build_filters "$@") if [[ -z "$filters" ]]; then echo "Error: At least one filter required for delete (use --eq)" >&2 exit 1 fi local url="${REST_URL}/${table}?${filters:1}" api_request DELETE "$url" | jq . ``` ### Technical Analysis The update and delete commands claim to require a row filter, but the implementation only checks whether `build_filters` returned any query-string content. Options such as `--limit`, `--offset`, and `--order` can produce a nonempty string without creating a predicate that restricts rows by column value. Consequently, modifier-only commands can pass the safety check. For example, `delete users --limit 100` produces a nonempty query string even though no `eq`, `neq`, `gt`, `lt`, or other row predicate is present. The problem is especially serious because the request is authenticated with a Supabase service-role key, which bypasses Row Level Security. The server's precise handling of modifiers on update and delete requests depends on the PostgREST configuration and ...[truncated 1401 chars]
Remediation
View remediation
&2 exit 1 fi ``` ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/supabase.sh:65
Finding

Unvalidated Supabase URL Can Expose the Service-Role Credential

Content
View full analysis
&2 exit 1 fi if [[ -z "${SUPABASE_SERVICE_KEY:-}" ]]; then echo "Error: SUPABASE_SERVICE_KEY not set" >&2 exit 1 fi REST_URL="${SUPABASE_URL}/rest/v1" RPC_URL="${SUPABASE_URL}/rest/v1/rpc" ``` Every API request sends the service-role key to the derived endpoint: ```bash api_request() { local method="$1" local endpoint="$2" local data="${3:-}" local extra_headers=("${@:4}") local args=( -s -X "$method" -H "apikey: ${SUPABASE_SERVICE_KEY}" -H "Authorization: Bearer ${SUPABASE_SERVICE_KEY}" -H "Content-Type: application/json" -H "Prefer: return=representation" ) for header in "${extra_headers[@]:-}"; do [[ -n "$header" ]] && args+=(-H "$header") done if [[ -n "$data" ]]; then args+=(-d "$data") fi curl "${args[@]}" "$endpoint" } ``` ### Technical Analysis `SUPABASE_URL` is only checked for emptiness. The script does not enforce HTTPS, validate the hostname, reject embedded user information, or restrict requests to a trusted Supabase project domain. The value is used directly to construct the REST and RPC endpoints. The `api_request` function then attaches the service-role key to both the `apikey` and `Authorization` headers for every request. If configuration is manipulated or accidentally points to an HTTP or attacker-controlled endpoint, the full service-role credential is transmitted to that destination. The documentation recommends an HTTPS Supabase URL, but this is not enforced by the executable implementation. ### Attack Path 1. An attacker gains influence over the environment or configura ...[truncated 1233 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/supabase.sh:71
Finding

Routine Operations Unconditionally Use an RLS-Bypassing Service-Role Key

Content
View full analysis
&2 exit 1 fi ``` ```bash local args=( -s -X "$method" -H "apikey: ${SUPABASE_SERVICE_KEY}" -H "Authorization: Bearer ${SUPABASE_SERVICE_KEY}" -H "Content-Type: application/json" -H "Prefer: return=representation" ) ``` ### Technical Analysis The Skill uses a service-role key for every database operation, including routine reads, inserts, and vector searches. It does not implement a restricted-key mode, even though `SUPABASE_ANON_KEY` is documented as an optional environment variable. A service-role key bypasses Supabase Row Level Security. Therefore, authorization boundaries that ordinarily restrict users or tenants are not applied to requests from this script. This violates least-privilege principles and magnifies the consequences of command-generation errors, malicious task input, endpoint mistakes, and defects ...[truncated 1667 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (11)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill description says it handles Supabase database, vector, and storage tasks, but the documented behavior also depends on OpenAI embeddings and does not actually document storage bucket/file operations. This mismatch can mislead users and reviewers about what external services are contacted and what capabilities are present, undermining trust and safe approval of the skill.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill advertises shell-driven database operations but does not declare an explicit tool scope such as allowed tools or permissions. That increases the chance the agent can invoke shell access more broadly than reviewers or orchestrators expect, which is risky because the documented commands include raw SQL and destructive database actions.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger description is broad enough to match many generic database or vector-related requests, which can cause this high-privilege skill to activate unintentionally. In context, that is especially dangerous because the skill is configured around a Supabase service role key that bypasses RLS and supports destructive actions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documentation includes update and delete examples without prominent warnings, confirmations, or guardrails around irreversible data modification. Because this skill is intended to run against a live Supabase project and commonly uses a service role key, accidental or prompted misuse could lead to broad data loss or unauthorized changes.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The raw SQL section shows arbitrary query execution, including DDL like CREATE TABLE, without warning that the same interface can run destructive or irreversible statements. In a shell-executed skill backed by privileged Supabase credentials, this substantially raises the risk of prompt-driven schema changes, data deletion, or privilege abuse.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The environment variable documentation prominently instructs use of a Supabase service role key, while only briefly noting that it bypasses RLS. Exposing a high-privilege credential as the normal operating mode makes the skill more dangerous in practice, since any mistaken or malicious invocation can act with full database authority.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The vector-search command transmits the user's query text to OpenAI to generate embeddings, creating third-party data egress that is not disclosed in the skill description, which frames the tool as a Supabase connector. This can expose sensitive prompts, database search terms, or proprietary content to an external provider unexpectedly, especially in enterprise environments with strict data-boundary assumptions.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

Although the skill is presented as a Supabase connector, the vector-search path reads an unrelated credential (OPENAI_API_KEY) and makes outbound requests to OpenAI. This broadens the trust boundary and may cause users or orchestrators to expose additional secrets and data flows they did not expect when enabling a database skill.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script sends raw user query text to OpenAI during vector search without any user-facing warning, consent step, or disclosure in the CLI output or skill description. If users enter confidential search material, internal documents, secrets, or regulated data fragments, that content is transmitted externally without an obvious signal.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
95% confidence
Finding

The hardcoded OpenAI API endpoint indicates that vector search depends on a third-party service, creating an outbound data path and dependency beyond Supabase. In a database-focused skill, this increases privacy and compliance risk because user search inputs may leave the expected platform boundary.

Content

Scanner excerpt · scripts/supabase.sh (reported line 362)May include surrounding context.

sh
fi
    
    local embedding
    embedding=$(curl -s https://api.openai.com/v1/embeddings \
        -H "Authorization: Bearer ${OPENAI_API_KEY}" \
        -H "Content-Type: application/json" \
        -d "{\"input\": $(printf '%s' "$query" | jq -Rs .), \"model\": \"text-embedding-ada-002\"}" \

External Transmission

Medium
Category
Data Exfiltration
Confidence
95% confidence
Finding

The hardcoded OpenAI API endpoint indicates that vector search depends on a third-party service, creating an outbound data path and dependency beyond Supabase. In a database-focused skill, this increases privacy and compliance risk because user search inputs may leave the expected platform boundary.

Content

Scanner excerpt · scripts/supabase.sh (reported line 362)May include surrounding context.

sh
fi
    
    local embedding
    embedding=$(curl -s https://api.openai.com/v1/embeddings \
        -H "Authorization: Bearer ${OPENAI_API_KEY}" \
        -H "Content-Type: application/json" \
        -d "{\"input\": $(printf '%s' "$query" | jq -Rs .), \"model\": \"text-embedding-ada-002\"}" \

Static analysis

No suspicious patterns detected.