Back to skill

Security audit

Exa Lead Generation

Security checks for vulnerabilities and agentic risk

Overview

The skill’s lead-generation purpose is coherent, but its shell command templates create a real command-injection review concern if user or search-result values are substituted directly.

Review before installing. This skill should be used only where the agent or wrapper passes queries and IDs as literal process arguments, validates IDs, and avoids direct shell interpolation. Expect it to read local product-marketing context files if present and to use Exa web/API searches for prospecting.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:36
Finding
Shell Command Injection Through Untrusted Search Queries and Result IDs<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 36-65 **Vulnerability Type**: Shell command injection through unsafe interpolation of user-controlled and externally sourced values **Risk Level**: High ### Vulnerable Code ```markdown Execute each query: ```bash node tools/clis/exa.js search --query "[ICP-targeted query]" --num-results 20 --text ``` For domain-specific searches, filter to relevant sites: ```bash node tools/clis/exa.js search --query "[query]" --num-results 20 --include-domains "crunchbase.com,linkedin.com" --text ``` To find companies similar to existing customers: ```bash node tools/clis/exa.js search --query "[existing customer name] competitors alternatives" --num-results 15 --text ``` To preview without making API calls: ```bash node tools/clis/exa.js search --query "[query]" --num-results 20 --dry-run ``` ### Step 3: Enrich Top Prospects For the most promising results, fetch detailed content: ```bash node tools/clis/exa.js contents --ids "[id1],[id2],[id3]" --text --highlights ``` ``` ### Technical Analysis The skill instructs the agent to interpolate ideal-customer-profile terms, search queries, customer names, and search-result identifiers directly into shell command templates. These values can originate from users or externally controlled search results. Enclosing a value in double quotes does not make it safe for shell evaluation. Command substitutions such as `$(...)` and backtick expressions are still evaluated inside double-quoted strings. An embedded double quote can also terminate the intended argument and introduce shell operators or additional commands. For example, if an untrusted query contains `$(touch /tmp/exa-skill-poc)`, directly substituting it into the documented template and executing the result through a shell would run the substituted command before or while launching the Node.js CLI. Similar injection may occur through a malicious customer name or externally influenced result ID. ...[truncated 1737 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Do not construct shell command strings by replacing placeholders with untrusted values. 2. Invoke Node.js and the Exa CLI through a process API that accepts a structured argument array, for example: ```javascript spawn("node", [ "tools/clis/exa.js", "search", "--query", userQuery, "--num-results", "20", "--text" ], { shell: false }); ``` 3. Explicitly require `shell: false` or the equivalent behavior in the execution environment. 4. Validate result IDs with a strict allowlist matching the identifier format expected by the Exa API. Reject unexpected whitespace, quotes, control characters, and shell metacharacters. 5. Apply reasonable length limits and type validation to queries, customer names, domains, and IDs. 6. If a shell is unavoidable, use a well-tested platform-specific argument-escaping library rather than manual quoting. Escaping should be a secondary control, not the primary design. 7. Update the skill documentation to state that placeholders must be passed as literal process arguments and must never be interpolated into a shell command. 8. Add tests using values containing quotes, backticks, `$()`, semicolons, newlines, and shell operators to verify that they remain literal arguments and cannot trigger command execution. ]]>
Vulnerability Patterns
  • 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
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep

Static analysis

No suspicious patterns detected.