Back to skill

Security audit

Find Product Directories

Security checks for vulnerabilities and agentic risk

Overview

The skill’s directory-search purpose is coherent, but its REST fallback tells agents to source a local .env file, which can execute unintended shell code and expose extra secrets.

Review before installing. The ServiceGraph API behavior is disclosed, but prefer the MCP/OAuth path and avoid the documented REST fallback unless it is changed to read only SERVICEGRAPH_API_KEY without sourcing .env.local. Confirm paid unlocks are explicitly approved 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

Warning
Location
SKILL.md:75
Finding

Unsafe Execution of Environment File Contents

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 75–86
Vulnerability Type: Unsafe shell sourcing and excessive environment-variable exposure
Risk Level: Medium

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 Skill instructs the Agent to load .env.local with the shell dot command (. ./.env.local). This operation does not safely parse a data file; it executes the entire file as shell code under the Agent's current user account. Consequently, any command substitution, shell function, redirection, or other executable shell syntax in .env.local runs before the ServiceGraph request.

The use of set -a also exports every variable defined by .env.local to the curl child process. The operation only needs SERVICEGRAPH_API_KEY, so making unrelated secrets available to the child process exceeds least privilege.

The documented HTTPS transmission of SERVICEGRAPH_API_KEY in the Authorization header to the declared api.servicegraph.co endpoint is necessary for the Skill's authenticated API functionality and is not, by itself, covert exfiltration. The vulnerability is the execution of the entire local environment file and the unnecessary inheritance of unrelated variables.

Attack Path

  1. An attacker, compromised development tool, or malicious project dependency writes shell syntax into the workspace's .env.local.
  2. The user invokes this Skill for its declared directory-discovery functionality.
  3. The Agent follows the documented authentication procedure.
  4. The shell evaluates . ./.env.local, executing the attacker-controlled syntax with the Agent process's operating-system privileges.
  5. The payload can access files and credentials available to that account, invoke local programs, or i ...[truncated 687 chars]
Remediation
View remediation

Remediation Suggestions

  1. Do not source .env.local or evaluate it as shell code.
  2. Retrieve only SERVICEGRAPH_API_KEY with a non-evaluating configuration parser that rejects shell syntax, duplicate assignments, malformed lines, and unexpected keys.
  3. Validate the extracted value against the expected vk_ token format before use.
  4. Pass only the required credential to the HTTP client rather than exporting all variables.
  5. Prefer the documented OAuth-enabled ServiceGraph MCP integration, which keeps credentials outside the language-model context and avoids workspace environment-file execution.
  6. Ensure .env.local has restrictive filesystem permissions and is excluded from version control.
  7. Retain HTTPS certificate verification and restrict authenticated requests to the declared https://api.servicegraph.co origin.
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
88% confidence
Finding

The skill tells the agent to source .env.local in a shell wrapper before making requests. Even though the stated goal is to avoid placing the token in LLM context, broadly sourcing a local env file can expose more secrets than necessary to the execution environment and creates a pattern where an LLM-driven workflow touches local credentials indirectly. In a hostile or over-permissive harness, this increases the blast radius if subsequent commands are influenced or if environment variables are logged, echoed, or reused.

Content

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

  1. Just try the call through a shell 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 254)May include surrounding context.

md
zero credits; spend only to reveal submission notes + traffic.
- **Gated fields can still be filtered.** `organic_traffic>=10000` narrows the
  set even though the value stays hidden until unlock.
- **Catalog is global, not US-only, and not B2B-only.** Don't refuse non-US or
  consumer-product asks the way the agency skills do — a directory is a
  directory regardless of who launches.
- **Local / brick-and-mortar business directories are a different dataset**

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 85)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 unauthorized, prompt the user (don't accept the key in chat):