Back to skill

Security audit

masterchef

Security checks for vulnerabilities and agentic risk

Overview

This recipe skill is coherent, but it needs review because it pre-authorizes unrestricted Bash for simple API lookups and uses broad activation rules.

Install only if you are comfortable with recipe queries being sent to api.yummy.chat and with this skill having Bash available. A safer version would narrow activation to explicit recipe requests and use a scoped HTTP/JSON mechanism instead of pre-authorized shell commands.

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

Shell Command Injection Through Unescaped Recipe and Ingredient Input

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 5, 112–122, 130–141, and 224–226
Vulnerability Type: Shell command injection caused by unsafe interpolation of user-controlled data
Risk Level: High

Vulnerable Code

The Skill grants access to the general-purpose Bash tool:

yaml
allowed-tools: [Bash]

It then provides shell templates in which ingredient and dish values are expected to be populated from user input:

bash
curl -s -X POST https://api.yummy.chat/ingredients \
  -H "Content-Type: application/json" \
  -d '{"ingredients": ["食材1", "食材2"]}'
bash
curl -s -X POST https://api.yummy.chat/howtocook \
  -H "Content-Type: application/json" \
  -d '{"dish_name": "菜名"}'

The elevated exposure is reinforced by the tool configuration:

text
- Uses `Bash` tool to execute `curl` commands
- Pre-authorized in `allowed-tools` to reduce permission prompts

Technical Analysis

Ingredient and dish names are derived from user-controlled requests. The documented Bash commands place those values inside a single-quoted shell argument without requiring shell escaping, JSON serialization, input validation, or positional parameter handling.

A single quote in an input value can terminate the shell string containing the JSON request body. Subsequent shell metacharacters can then be interpreted as command syntax rather than recipe data. JSON escaping alone would not prevent this issue because JSON and shell quoting are separate parsing layers.

The Skill also instructs the Agent to pass Chinese input directly to the API. Therefore, there is no guaranteed normalization stage that would remove quotes or shell control characters. Because unrestricted Bash is pre-authorized, exploitation could lead directly to local command execution under the Agent process identity.

Attack Path

  1. An attacker submits a recipe or ingredient name containing a single quote followed ...[truncated 1473 chars]
Remediation
View remediation

Remediation Suggestions

  1. Replace unrestricted Bash with a narrowly scoped HTTP request tool that accepts structured JSON parameters and does not invoke a shell.

  2. Remove Bash from allowed-tools if it is not strictly necessary. Do not pre-authorize a general-purpose command execution tool for a simple API client.

  3. If Bash is unavoidable, serialize request bodies with a trusted JSON encoder and pass user values as data rather than source code. For example:

    bash
    payload="$(jq -n --arg dish_name "$1" '{"dish_name": $dish_name}')"
    curl --fail-with-body --silent --show-error \
      -X POST 'https://api.yummy.chat/howtocook' \
      -H 'Content-Type: application/json' \
      --data-binary "$payload"
    

    The user-controlled value must be supplied as a positional argument by a non-shell caller, not concatenated into the command text.

  4. Apply the same safe serialization approach to ingredient arrays, such as using jq --args or constructing the JSON in the Agent's HTTP client.

  5. Validate inputs by enforcing documented length and item-count limits. Reject control characters and unexpected binary data, while treating validation only as defense in depth rather than a replacement for safe argument handling.

  6. Add explicit instructions prohibiting direct interpolation of user-controlled strings into Bash commands.

  7. Use curl --fail-with-body --silent --show-error and enforce connection and total timeouts so HTTP failures are handled safely and visibly.

  8. Add regression tests with quotation marks, backslashes, command separators, substitutions, and newline characters to verify that all values remain inert request data.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (7)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill description uses very broad triggers such as any mention of cooking, food preparation, meals, cuisine, or common Chinese cooking keywords. This can cause unintended activation on casual conversation, increasing the chance that user content is unnecessarily routed into this skill and then sent to the external recipe API.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The activation guidance contains ambiguous conditions like 'expressing cooking intent' and broad keyword matching without clear boundaries. In a skill that transmits user queries to a third-party service, ambiguous activation increases the risk of accidental data disclosure and inappropriate tool use.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
78% confidence
Finding

The skill is explicitly designed to call an external service at api.yummy.chat, creating a third-party data flow. While expected for functionality, it remains a real security and privacy concern because user queries and inferred food preferences are transmitted outside the local system.

Content

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

md
### 1. Ingredient Search API

**Endpoint**: `POST https://api.yummy.chat/ingredients`

**Purpose**: Query dishes that can be made with 1-3 ingredients

External Transmission

Medium
Category
Data Exfiltration
Confidence
78% confidence
Finding

The recipe lookup endpoint sends dish names derived from user input to an external service. This is a genuine external transmission path, and if extraction is over-broad or includes surrounding user text, unnecessary information could be disclosed.

Content

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

md
### 2. Recipe Lookup API

**Endpoint**: `POST https://api.yummy.chat/howtocook`

**Purpose**: Query detailed recipe by dish name (ingredients, steps, tips)

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

The embedded curl example operationalizes outbound transmission using Bash, which increases the likelihood that the skill will send data externally during normal use. In context this is functionally intended, but still risky because the skill's broad activation and text extraction steps could send unintended user content.

Content

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

  1. Call API:
bash
curl -s -X POST https://api.yummy.chat/ingredients \
  -H "Content-Type: application/json" \
  -d '{"ingredients": ["食材1", "食材2"]}'

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

The embedded curl example operationalizes outbound transmission using Bash, which increases the likelihood that the skill will send data externally during normal use. In context this is functionally intended, but still risky because the skill's broad activation and text extraction steps could send unintended user content.

Content

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

  1. Call API:
bash
curl -s -X POST https://api.yummy.chat/ingredients \
  -H "Content-Type: application/json" \
  -d '{"ingredients": ["食材1", "食材2"]}'

External Transmission

Medium
Category
Data Exfiltration
Confidence
81% confidence
Finding

This command sends dish names to the external howtocook endpoint using Bash/curl. The transmission itself is intentional, but it is still a true vulnerability class because third-party exfiltration can occur if the skill misidentifies the user's intent or includes excess text in the request.

Content

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

  1. Call API:
bash
curl -s -X POST https://api.yummy.chat/howtocook \
  -H "Content-Type: application/json" \
  -d '{"dish_name": "菜名"}'

Static analysis

No suspicious patterns detected.