Back to skill

Security audit

Mealplan

Security checks for vulnerabilities and agentic risk

Overview

This skill is mostly a local meal logger, but it over-promises key features and has a shell argument flaw that can expose arbitrary local files readable by the user account.

Review this skill before installing. Its local data storage is disclosed and there is no network or persistence backdoor evidence, but the current script is not a reliable meal planner and should not be run on untrusted meal/date input until the argument handling and quoting issues are fixed.

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
scripts/script.sh:92
Finding

Unquoted grep Arguments Permit Arbitrary Local File Disclosure

Content
View full analysis
" grep ${2:-$(date +%Y-%m-%d)} $DATA_DIR/meals.jsonl 2>/dev/null || echo 'No meals planned' } ``` The relevant command dispatcher is: ```bash list) shift; cmd_list "$@" ;; ``` ### Technical Analysis The command dispatcher removes the `list` argument with `shift`, but `cmd_list` incorrectly reads the requested day from `$2` instead of `$1`. The value of `$2` is then expanded without quotation marks in the `grep` command: ```bash grep ${2:-$(date +%Y-%m-%d)} $DATA_DIR/meals.jsonl ``` Because this expansion is unquoted, shell word splitting converts a single attacker-controlled argument containing spaces into multiple `grep` operands. The first resulting word is treated as the search pattern, while subsequent words are treated as file paths. The absence of the `--` option terminator also allows values beginning with a hyphen to be interpreted as `grep` options. For example, the following invocation supplies a second post-shift argument containing both a pattern and a file path: ```bash scripts/script.sh list ignored '.* /etc/passwd' ``` After dispatch and shell word splitting, the effective operation is equivalent to: ```bash grep '.*' /etc/passwd "$HOME/.local/share/mealplan/meals.jsonl" ``` This causes `grep` to read and print matching content from the attacker-selected file. ### Attack Path 1. An attacker provides crafted input that is passed to the Skill's `list` command. 2. The invocation includes an arbitrary first argument and a malicious second argument, such as: ```bash scripts/script.sh list ignored '.* /etc/passwd' ``` 3. The dispatcher executes `shift`, making `ignored` becom ...[truncated 1149 chars]
Remediation
View remediation
" if [[ ! "$day" =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ ]]; then die "Invalid day: expected YYYY-MM-DD" fi grep --fixed-strings -- "$day" "$DATA_DIR/meals.jsonl" 2>/dev/null || echo 'No meals planned' } ``` The same positional-argument mismatch should also be corrected in the other command handlers because the dispatcher calls `shift` before invoking them. Shell-focused automated tests and a static analyzer such as ShellCheck should be added to detect unquoted expansions and incorrect argument handling. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • 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
Findings (4)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The description promises a functional meal-planning tool with calorie tracking and shopping lists for organizing weekly meals. The code does create a local data directory and lets a user add meal records and list them by date, which partially aligns. However, the core advertised capabilities are largely unimplemented: plan, nutrition, and shopping merely print static placeholder text, and even use single quotes so variable interpolation does not occur. There is no actual generation of meal plans, no calculation or aggregation of calories, and no shopping list creation. There are no obvious undeclared sensitive capabilities or external resource access, but the implemented behavior materially falls short of the declared primary purpose.

Content

No source excerpt is available for this finding.

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
80% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · scripts/script.sh (reported line 9)May include surrounding context.

sh
DATA_DIR="$HOME/.local/share/mealplan"
mkdir -p "$DATA_DIR"

#
#
#
#

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The documented interfaces imply commands accept arguments after the subcommand, for example add <meal calories type> and list <day>, but each handler reads from positional parameters 2, 3, and 4 even though main already shifts once before invoking them. As a result, the documented command formats do not match what the code actually consumes, causing the implementation to reject or mis-handle inputs despite the stated usage.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest says the skill plans meals with calorie tracking and shopping lists, but the code only truly records meals and lists saved entries. The plan, nutrition, shopping, and random commands merely print placeholder text without performing the described meal-planning, calorie-tracking, or shopping-list functionality.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.