Back to skill

Security audit

Find Ai Directories

Security checks for vulnerabilities and agentic risk

Overview

The skill has a coherent directory-search purpose, but its REST authentication instructions use an unsafe local `.env.local` shell-sourcing pattern that can execute project-controlled code.

Review before installing. Prefer the documented OAuth/MCP path or provide `SERVICEGRAPH_API_KEY` through a trusted secret manager or already-exported environment variable. Avoid running the shown wrapper that sources `.env.local`; also confirm paid unlocks with the user before spending credits.

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:74
Finding

Unsafe Execution of Project-Local Environment File

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 74–76
Vulnerability Type: Unsafe shell sourcing and excessive environment export
Risk Level: High

Vulnerable Code

bash
( set -a; [ -f .env.local ] && . ./.env.local; set +a;
  curl -sS -H "Authorization: Bearer $SERVICEGRAPH_API_KEY" \
       'https://api.servicegraph.co/v1/datasets/product_directory/fields' )

Technical Analysis

The documented authentication wrapper loads .env.local with the POSIX shell . command. This command does not treat the file as passive key-value configuration: it executes all shell syntax contained in the file with the invoking user's privileges.

Because .env.local is resolved relative to the current project directory, anyone able to create or alter that file can inject shell commands that execute when an agent follows the Skill's documented authentication procedure. This is unnecessary for the declared functionality, which only requires access to SERVICEGRAPH_API_KEY.

Additionally, set -a exports every variable created or modified while loading the file. As a result, all values in .env.local, rather than only the required API key, are inherited by curl. Although the shown request sends only SERVICEGRAPH_API_KEY in its HTTP header, exporting unrelated secrets to a child process exceeds least privilege.

The subsequent transmission of SERVICEGRAPH_API_KEY as a bearer token to the declared host, https://api.servicegraph.co, is consistent with the Skill's authenticated API functionality. The vulnerability is the executable loading mechanism, not the documented bearer-authentication request itself.

Attack Path

  1. An attacker gains the ability to commit, generate, or modify .env.local in the directory from which the Skill's command is run.
  2. The attacker adds valid shell syntax, for example a command that reads credentials, modifies files, or initiates an external connection.
  3. The user or agent follows the Skill document ...[truncated 916 chars]
Remediation
View remediation

Remediation Suggestions

  1. Do not source .env.local or any other project-controlled file as shell code.
  2. Prefer the Skill's documented OAuth-enabled MCP integration, which keeps credentials in the harness sandbox and out of the model context.
  3. For REST usage, require SERVICEGRAPH_API_KEY to be supplied by a trusted process environment or secret manager:
    bash
    : "${SERVICEGRAPH_API_KEY:?SERVICEGRAPH_API_KEY is not configured}"
    curl --fail-with-body --silent --show-error \
      -H "Authorization: Bearer ${SERVICEGRAPH_API_KEY}" \
      'https://api.servicegraph.co/v1/datasets/product_directory/fields'
    
  4. If loading a configuration file is unavoidable, use a non-executing parser that accepts only a strict SERVICEGRAPH_API_KEY=<value> record. Reject command substitutions, shell metacharacters, duplicate keys, unexpected fields, and malformed token values.
  5. Remove set -a; pass only the required credential to the intended process.
  6. Validate that the key matches the expected format without printing it, and ensure logs, shell tracing, and error output cannot disclose the authorization header.
  7. Pin outbound authenticated requests to the expected HTTPS origin and avoid following redirects that could forward the authorization header to an unintended host.
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
Findings (3)

Credential Access

High
Category
Privilege Escalation
Confidence
83% confidence
Finding

The skill instructs the agent to source .env.local in a shell wrapper, which accesses local secrets during execution. Although it says not to place the token in LLM context, reading local environment files from a skill increases the risk of secret exposure through command output, prompt leakage, misconfigured wrappers, or broader unintended access to local credentials.

Content

Scanner excerpt · SKILL.md (reported line 74)May include surrounding context.

  1. Try the call through a wrapper that sources .env.local:

    bash
    ( set -a; [ -f .env.local ] && . ./.env.local; set +a;
      curl -sS -H "Authorization: Bearer $SERVICEGRAPH_API_KEY" \
           'https://api.servicegraph.co/v1/datasets/product_directory/fields' )
    

Anti-Refusal Statement

High
Category
Anti-Refusal
Confidence
85% confidence
Finding

Skill instructs the agent to never refuse or to always comply. Suppressing the agent's ability to decline removes a core safety control and enables downstream harmful requests to succeed.

Content

Scanner excerpt · SKILL.md (reported line 205)May include surrounding context.

md
what this dataset answers.
- **`dr` is free and briefs are pre-sorted by it** — rank for zero credits.
- **Gated fields are still filterable** (`organic_traffic>=10000`).
- **Catalog is global, not US-only.** Don't refuse non-US asks.
- **AI ↔ MCP ↔ agent-skill registries overlap.** When the artifact is
  specifically an MCP server, defer to `find-mcp-directories`.
- **Multi-word phrases must be quoted.** `ai agents` = two AND'd keywords;

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 76)May include surrounding context.

bash
   ( set -a; [ -f .env.local ] && . ./.env.local; set +a;
     curl -sS -H "Authorization: Bearer $SERVICEGRAPH_API_KEY" \
          'https://api.servicegraph.co/v1/datasets/product_directory/fields' )
  1. On 401, prompt the user (don't accept the key in chat):