Back to skill

Security audit

Find Web Developer

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly coherent, but its REST auth instructions tell the agent to execute a local .env.local file as shell code, which is broader and riskier than needed to read one API key.

Review before installing. Prefer the ServiceGraph MCP/OAuth path or require SERVICEGRAPH_API_KEY from a trusted existing environment. Do not let the agent source .env.local from an untrusted repository or project directory, and confirm paid unlocks 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:69
Finding

Unsafe Execution of Repository-Controlled Environment File

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 69–75
Vulnerability Type: Unsafe shell sourcing of a local configuration file
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/pro_services/fields' )

Technical Analysis

The authentication procedure instructs the Agent to load .env.local with the shell dot command:

bash
. ./.env.local

This command executes the file as shell code rather than parsing it as passive key-value configuration. If the project directory or .env.local is attacker-controlled or compromised, arbitrary shell commands embedded in that file will execute with the privileges of the Agent's shell.

The use of set -a also causes all subsequently assigned variables to be exported. Although the displayed curl command sends only SERVICEGRAPH_API_KEY, exporting every variable from the file unnecessarily broadens the environment inherited by child processes.

Reading one API credential is necessary for the Skill's stated functionality, but executing the entire configuration file is not. This therefore violates least-privilege principles and creates a command-execution boundary where only data parsing is required.

Attack Path

  1. An attacker gains the ability to create or modify .env.local in the working directory, such as through a malicious project archive, compromised repository content, or prior local write access.
  2. The attacker inserts shell commands into that file. These commands could inspect local files, alter project content, or make attacker-controlled network requests.
  3. The user invokes the Skill without a valid preconfigured authentication session.
  4. Following the documented authentication recipe, the Agent runs the provided shell wrapper.
  5. The shell executes all commands in .env.local before invoking curl.
  6. The ma ...[truncated 776 chars]
Remediation
View remediation

Remediation Suggestions

  1. Do not source .env.local or any repository-controlled dotenv file as shell code.
  2. Prefer the documented ServiceGraph MCP integration so OAuth credentials remain within the harness sandbox.
  3. If REST authentication is required, obtain SERVICEGRAPH_API_KEY from an already configured process environment rather than executing a project file.
  4. If dotenv support is necessary, use a parser that treats the file strictly as data and does not perform shell expansion, command substitution, variable interpolation, or evaluation.
  5. Extract only the required variable instead of exporting all entries. Reject duplicate keys and malformed records.
  6. Validate the resulting credential against the expected API-key syntax, such as an anchored allowlist pattern for vk_ keys, before placing it in an HTTP header.
  7. Ensure .env.local has restrictive permissions, is excluded from version control, and is not accepted from untrusted project content.
  8. Keep the token out of command output and model context. Disable verbose HTTP tracing and redact the Authorization header from logs.
  9. Pin outbound requests to the expected HTTPS origin, api.servicegraph.co, and avoid forwarding the authorization header across redirects to other hosts.
  10. Run the HTTP operation in a restricted environment with minimal filesystem access, a narrow outbound-network allowlist, and no unrelated credentials.

A safer approach is to require the key to be present in the existing environment and fail closed when it is absent:

bash
: "${SERVICEGRAPH_API_KEY:?Set SERVICEGRAPH_API_KEY in the trusted process environment}"

case "$SERVICEGRAPH_API_KEY" in
  vk_[A-Za-z0-9_-]*) ;;
  *) printf '%s\n' "Invalid SERVICEGRAPH_API_KEY format" >&2; exit 1 ;;
esac

curl --fail --silent --show-error \
  -H "Authorization: Bearer $SERVICEGRAPH_API_KEY" \
  'https://api.servicegraph.co/v1/datasets/pro_services/fields'
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

  1. Try the call first 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/pro_services/fields' )
    

External Transmission

Medium
Category
Data Exfiltration
Confidence
81% confidence
Finding

The skill is explicitly designed to transmit queries and firm identifiers to an external service at api.servicegraph.co, which is a genuine external data transfer. In context this is expected functionality, but it still matters from a security/privacy perspective because user-supplied search criteria or domain lists may contain sensitive procurement intent or proprietary target lists.

Content

Scanner excerpt · SKILL.md (reported line 74)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/pro_services/fields' )
  1. On 401 prompt the user:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill directs the agent to unlock paid firm details and enrich selected domains through a third-party API, but it does not require an explicit consent step before sending user-provided targets off-platform and spending credits. That creates a real transparency and authorization risk: a user may not realize their selected domains will be transmitted externally or that the action incurs billable usage.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.