Back to skill

Security audit

Find Mcp Directories

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it claims, but its credential wrapper unsafely executes a local .env.local file before making API calls.

Review before installing. The skill is not malicious, but only use it in trusted workspaces or after changing the auth pattern to use a harness-managed environment variable or a strict non-executing dotenv parser. Be aware that unlock calls spend ServiceGraph credits and should remain user-approved.

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

Unsafe Shell Sourcing of Environment File

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 68–71
Vulnerability Type: Executable environment-file sourcing
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 documented authentication wrapper loads .env.local with the POSIX shell . command. This interprets the entire file as shell code rather than parsing it strictly as key-value configuration. Consequently, command substitutions, redirections, functions, and arbitrary commands in .env.local execute with the privileges of the user running the Skill.

Executing an environment file is not required to retrieve SERVICEGRAPH_API_KEY and exceeds the minimum privilege necessary for the declared API-querying functionality. Although the subsequent HTTPS request sends the bearer token only to the declared ServiceGraph host, the unsafe sourcing step creates an independent local command-execution risk.

Attack Path

  1. An attacker, compromised dependency, or untrusted project gains the ability to create or modify .env.local in the working directory.
  2. The attacker inserts shell syntax into the file, such as a command substitution or standalone command, alongside or instead of the expected API-key assignment.
  3. The Agent follows the documented wrapper and executes . ./.env.local.
  4. The shell runs the attacker-controlled content before invoking curl.
  5. The malicious command can access resources available to the Agent user and may steal credentials, exfiltrate files, or alter the workspace.

Impact Assessment

Successful exploitation provides arbitrary command execution under the existing Agent user's identity. The attacker does not automatically gain operating-system privileges beyond that account, but can access ...[truncated 569 chars]

Remediation
View remediation

Remediation Suggestions

  • Do not source .env.local with . or source.
  • Prefer credentials injected by the execution harness through an already established environment variable.
  • If dotenv-file support is necessary, use a non-executing parser that accepts only a strict KEY=VALUE grammar and retrieves only SERVICEGRAPH_API_KEY.
  • Validate that the key matches the expected vk_ token format, reject duplicate or malformed assignments, and never evaluate command substitutions or shell expansions.
  • Invoke the HTTP client with a minimal environment and ensure the authorization header is sent exclusively to the fixed HTTPS origin https://api.servicegraph.co.
  • Keep the existing guidance not to paste credentials into chat or expose them to model context.
  • Consider refusing to read credential files from untrusted project directories; use a harness-managed secret store or a user-owned configuration path with restrictive permissions instead.
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 (5)

MCP Config Access

High
Category
Agent Snooping
Confidence
80% confidence
Finding

Skill accesses MCP server configuration files (mcp.json). MCP configs contain server URLs, authentication tokens, and tool definitions — reading them allows the skill to discover and potentially abuse other tool integrations.

Content

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

md
## Sibling skills — defer when the niche is broader

- **General AI tools / AI agents / agent skills** ("where to list my AI tool",
  "agent-skills directories") → `find-ai-directories`. (Several registries list
  MCP servers *and* skills/tools — if the artifact is specifically an MCP
  server, this skill is the right pick.)
- **General SaaS / software / app launch** ("Product Hunt alternatives") →

MCP Config Access

High
Category
Agent Snooping
Confidence
80% confidence
Finding

Skill accesses MCP server configuration files (mcp.json). MCP configs contain server URLs, authentication tokens, and tool definitions — reading them allows the skill to discover and potentially abuse other tool integrations.

Content

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

md
## Sibling skills — defer when the niche is broader

- **General AI tools / AI agents / agent skills** ("where to list my AI tool",
  "agent-skills directories") → `find-ai-directories`. (Several registries list
  MCP servers *and* skills/tools — if the artifact is specifically an MCP
  server, this skill is the right pick.)
- **General SaaS / software / app launch** ("Product Hunt alternatives") →

Credential Access

High
Category
Privilege Escalation
Confidence
78% confidence
Finding

The skill instructs the agent to source .env.local and use SERVICEGRAPH_API_KEY from the local environment. Even though it says not to put the token in LLM context, directing an agent to read local secret files expands the skill's access to credentials and can expose secrets if the wrapper output, command history, error traces, or follow-on actions leak them; in a broader harness, this pattern normalizes credential retrieval from local storage.

Content

Scanner excerpt · SKILL.md (reported line 71)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 188)May include surrounding context.

md
DIY question, not this dataset.
- **`dr` is free and briefs are pre-sorted by it** — rank for zero credits.
- **Gated fields are still filterable** (`organic_traffic>=1000`).
- **Catalog is global, not US-only.** Don't refuse non-US asks.
- **The strict-MCP pool is small (~20).** If the user wants more reach, broaden
  to agent-skill/AI-tool registries (Recipe D) or defer to `find-ai-directories`.
- **Multi-word phrases must be quoted.** `model context protocol` = three AND'd

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 73)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):