Back to skill

Security audit

Andara Rag Search

Security checks for vulnerabilities and agentic risk

Overview

This skill is a direct internal database search helper, but it exposes sensitive business and personal data with weak scoping and unsafe query examples.

Install only in an environment where users are authorized to query the referenced Andara database. Use a read-only, least-privilege DATABASE_URL, prefer approved views over base tables, avoid returning emails/equity/customer details unless clearly authorized, and do not paste untrusted search text into the documented shell SQL template without safe parameterization.

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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:20
Finding
Unsafe Search-Term Interpolation Enables SQL and Shell Command Injection## Vulnerability Details **File Location**: `SKILL.md`, lines 20-27 **Vulnerability Type**: SQL injection and shell command injection **Risk Level**: High ### Vulnerable Code ```bash Run a PostgreSQL query against the `knowledge_base` table using the `bash` tool: ```bash psql "$DATABASE_URL" \ -c "SELECT content::text, source, data_type FROM knowledge_base WHERE content::text ILIKE '%SEARCH_TERM%' LIMIT 5;" ``` Replace `SEARCH_TERM` with the relevant keyword(s). ``` ### Technical Analysis The Skill directs the Agent to replace `SEARCH_TERM` directly inside a SQL string that is itself embedded in a double-quoted shell argument. No prepared statement, SQL-literal escaping, shell-safe argument handling, or input validation is required. This creates two injection boundaries: 1. **SQL injection:** A search term containing a single quote can terminate the `ILIKE` pattern and append arbitrary SQL. For example, a value shaped like `' OR 1=1 --` can change the predicate, comment out the documented result limit, and retrieve unrelated records. 2. **Shell command injection:** Because the complete SQL statement is enclosed in shell double quotes, shell expansions such as command substitution can be interpreted before `psql` receives the SQL. If the Agent constructs and executes the documented command with an attacker-controlled term such as `$(...)`, the shell may execute the substituted command locally. The instruction prohibiting `INSERT`, `UPDATE`, and `DELETE` is advisory. It does not prevent injected statements if the database account referenced by `DATABASE_URL` has write or administrative privileges. ### Attack Path 1. An attacker asks the Agent to search for a crafted keyword. 2. The Agent follows the Skill and replaces `SEARCH_TERM` in the documented command. 3. For SQL injection, the crafted term closes the SQL literal and adds a new condition or stacked statement. 4. For shell injection, the crafted term ...[truncated 1039 chars]
Remediation
## Remediation Suggestions - Do not interpolate user-provided terms into shell source or SQL text. - Prefer an application database library with prepared statements and bound parameters. - If `psql` must be used, pass the search term as a separately quoted variable and use PostgreSQL/psql literal quoting rather than textual replacement. - Construct process arguments as an argument array without invoking a shell. - Reject control characters and unexpected syntax as defense in depth, but do not treat validation as a substitute for parameterization. - Configure `DATABASE_URL` with a dedicated database role that has only the minimum required `SELECT` permissions. - Set transaction-level read-only enforcement, statement timeouts, and row limits at the database layer. - Restrict access to approved views instead of exposing base tables. - Add tests using single quotes, SQL comments, semicolons, command substitutions, backticks, newlines, and other shell metacharacters.

T05 · Unauthorized Access and Privilege Escalation

Error
Location
SKILL.md:31
Finding
Broad Sensitive-Data Access Without Authorization or Redaction Controls## Vulnerability Details **File Location**: `SKILL.md`, lines 31-54 **Vulnerability Type**: Missing access control for confidential business data and personal information **Risk Level**: High ### Vulnerable Code ```markdown ### Core Data | Table | Description | Key Columns | |-------|-------------|-------------| | `knowledge_base` | RAG chunks (3,800+) | `content`, `source`, `data_type` | | `team_members` | Team roster (6 active) | `name`, `role`, `title`, `email`, `department`, `equity_percent` | | `team_meetings` | Meeting notes (5) | `title`, `date`, `summary`, `key_insights`, `decisions` | | `meeting_action_items` | Action items (32) | `title`, `assignee`, `status`, `priority`, `due_date` | | `team_goals` | Company goals (4) | `title`, `status`, `target_date`, `progress_percent` | ### CMS & Commerce | Table | Description | Key Columns | |-------|-------------|-------------| | `pages` | CMS pages (155) | `slug`, `title`, `content`, `zone`, `cluster_id`, `status` | | `products` | Products (2) | `name`, `price_cents`, `description`, `sku` | | `orders` | Orders (11) | `total`, `status`, `customer_name`, `created_at` | | `customers` | Customers (10) | `name`, `email`, `created_at` | | `clusters` | Topic clusters (20) | `name`, `slug`, `description` | ### Intelligence | Table | Description | |-------|-------------| | `rag_memory_objects` | Learned lessons & policies | | `science_articles` | Scientific content | | `newsletter_subscribers` | Email subscribers | ``` ### Technical Analysis The Skill advertises direct query access to base tables containing employee email addresses and equity, customer identities and email addresses, subscriber information, internal meeting decisions, action items, orders, revenue-related data, and learned internal policies. No instruction requires the Agent to: - Authenticate or authorize the requester for the requested dataset. - distinguish public infor ...[truncated 1809 chars]
Remediation
## Remediation Suggestions - Require an explicit authorization decision before querying confidential or personally identifiable information. - Separate public research access from employee, customer, subscriber, order, governance, and revenue access. - Replace access to base tables with narrowly scoped database views containing only approved columns. - Apply row-level security and tenant or user-based filtering at the database layer. - Use separate least-privilege database roles for each data classification and operation. - Mask or omit email addresses, customer names, equity percentages, and other sensitive fields by default. - Require explicit confirmation and elevated authorization for bulk exports or highly sensitive business records. - Add query and disclosure audit logs associated with the authenticated requester. - Establish data-classification, retention, and output-redaction rules in the Skill. - Enforce result and rate limits server-side to prevent enumeration through repeated small queries.
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (2)

Missing User Warnings

High
Confidence
98% confidence
Finding
The documentation explicitly exposes access patterns for sensitive tables containing personal data, equity information, customer emails, orders, meeting notes, and governance-related content, but provides no warnings, approval requirements, or redaction guidance. In this context, omission of safeguards is dangerous because the skill normalizes direct retrieval of confidential business and personal records through simple SQL queries, increasing the risk of data leakage by an agent following the instructions as written.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The skill advertises an extremely broad activation scope covering general business intelligence, products, team, meetings, customers, orders, and "any indexed content," making it likely to trigger for many routine requests without adequate sensitivity checks. Because the skill directly instructs the agent to query internal business and personal data stores, overbroad invocation materially increases the chance of unnecessary access and disclosure of sensitive information.

Static analysis

No suspicious patterns detected.