Back to skill

Security audit

Mealie API skill

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward Mealie API helper, but users should verify the destination URL and understand that recipe and meal-plan actions write to their Mealie account.

Install only if you trust the Mealie URL you configure. Use HTTPS, avoid tokens with broad permissions where possible, and treat add-recipe and create-plan as account-changing actions. Because the package only includes the markdown instructions and not the claimed helper script, review or create any script yourself before running it.

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:21
Finding
Bearer Token Can Be Transmitted Over an Unencrypted or Untrusted Connection<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 21–52 **Vulnerability Type**: Missing transport and destination validation for sensitive credentials **Risk Level**: Medium ### Vulnerable Code ```bash #!/usr/bin/env bash # mealie.sh – simple wrapper for Mealie REST API # Requires MEALIE_URL and MEALIE_TOKEN env vars set -euo pipefail cmd=$1; shift case "$cmd" in add-recipe) # Usage: mealie.sh add-recipe <path‑to‑json> curl -s -X POST "$MEALIE_URL/api/recipes" \ -H "Authorization: Bearer $MEALIE_TOKEN" \ -H "Content-Type: application/json" \ --data @${1} ;; get-recipe) # Usage: mealie.sh get-recipe <recipe‑id> curl -s "$MEALIE_URL/api/recipes/${1}" \ -H "Authorization: Bearer $MEALIE_TOKEN" | jq '.' ;; create-plan) # Usage: mealie.sh create-plan <json‑payload> curl -s -X POST "$MEALIE_URL/api/mealplan" \ -H "Authorization: Bearer $MEALIE_TOKEN" \ -H "Content-Type: application/json" \ --data @${1} ;; get-shopping) # Usage: mealie.sh get-shopping <plan‑id> curl -s "$MEALIE_URL/api/mealplan/${1}/shopping-list" \ -H "Authorization: Bearer $MEALIE_TOKEN" | jq '.' ;; *) echo "Unknown command: $cmd" >&2 exit 1 ;; esac ``` ### Technical Analysis The documented helper sends `MEALIE_TOKEN` in an HTTP `Authorization` header to the host specified by the externally controlled `MEALIE_URL` environment variable. Sending a bearer token to the configured Mealie API is necessary for the declared functionality. However, the implementation does not validate the URL scheme, hostname, or presence of embedded credentials before transmitting the token. Although the documented example uses HTTPS, the helper accepts an `http://` URL. In that configuration, the bearer token and API data travel without transport encryption and can be intercepted by systems with visibility into the network path. An incorrectly configured or attacker-influenced UR ...[truncated 1783 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Validate `MEALIE_URL` before issuing any authenticated request and reject all schemes other than HTTPS: ```bash case "${MEALIE_URL:-}" in https://*) ;; *) echo "MEALIE_URL must use HTTPS" >&2 exit 1 ;; esac ``` 2. Parse and validate the destination hostname. Where practical, compare it against an explicitly configured allowlist or require user confirmation before sending credentials to a new host. 3. Reject malformed URLs, embedded user information, fragments, and unexpected query components. Normalize trailing slashes before appending API paths. 4. Preserve TLS certificate verification. Do not add `curl --insecure` or otherwise disable certificate checks. 5. Use safer error handling so failed requests are visible: ```bash curl --fail --show-error --silent ... ``` 6. Use a narrowly scoped Mealie API token where the server supports restricted permissions. Rotate the token immediately if it may have been exposed. 7. Add the claimed `scripts/mealie.sh` file to the package so its actual implementation can be reviewed and tested, or revise `SKILL.md` to make clear that the code is only an example. 8. Document that credentials must never be sent to plaintext HTTP endpoints, including internal network addresses, unless equivalent authenticated encryption is provided by a separately verified transport layer. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

External Transmission

Medium
Category
Data Exfiltration
Content
case "$cmd" in
  add-recipe)
    # Usage: mealie.sh add-recipe <path‑to‑json>
    curl -s -X POST "$MEALIE_URL/api/recipes" \
      -H "Authorization: Bearer $MEALIE_TOKEN" \
      -H "Content-Type: application/json" \
      --data @${1}
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
;;
  create-plan)
    # Usage: mealie.sh create-plan <json‑payload>
    curl -s -X POST "$MEALIE_URL/api/mealplan" \
      -H "Authorization: Bearer $MEALIE_TOKEN" \
      -H "Content-Type: application/json" \
      --data @${1}
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Low
Confidence
89% confidence
Finding
This markdown file instructs the agent to add recipes and create meal plans through authenticated API calls, which can change user data on a remote service. While the operations are described functionally, there is no clear user-facing warning in the usage section that these actions will perform writes against the user's Mealie instance.

Intent-Code Divergence

Low
Confidence
97% confidence
Finding
L69 states the skill will query `GET /api/recipes?search=...` to search for recipes, but the only implemented commands in the documented `mealie.sh` wrapper are `add-recipe`, `get-recipe`, `create-plan`, and `get-shopping` (L29-L58). This is an active documentation-to-code mismatch about available behavior, not just an omitted detail.

Static analysis

No suspicious patterns detected.