Back to skill

Security audit

Allergy

Security checks for vulnerabilities and agentic risk

Overview

This allergy skill is not malicious, but it needs review because it handles sensitive health-style notes with broad local plaintext logging and a misleading or broken export interface.

Install only if you are comfortable with allergy or wellness notes being kept as plaintext files under ~/.local/share/allergy. Treat it as a simple local logger, not a medical or allergy-analysis tool, and review file permissions and the broken export behavior before entering sensitive information.

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

Sensitive Health Records Created Without Enforced Access Restrictions

Content
View full analysis

Vulnerability Details

File Location: scripts/script.sh, lines 6-9 and representative record-writing logic at lines 133-145
Vulnerability Type: Plaintext sensitive-data storage with ambient filesystem permissions
Risk Level: Medium

Vulnerable Code

bash
DATA_DIR="${HOME}/.local/share/allergy"
mkdir -p "$DATA_DIR"

_log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; }

Representative health-record creation:

bash
log)
    shift
    if [ $# -eq 0 ]; then
        echo "Recent log entries:"
        tail -20 "$DATA_DIR/log.log" 2>/dev/null || echo "  No entries yet. Use: allergy log <input>"
    else
        local input="$*"
        local ts=$(date '+%Y-%m-%d %H:%M')
        echo "$ts|$input" >> "$DATA_DIR/log.log"
        local total=$(wc -l < "$DATA_DIR/log.log")
        echo "  [Allergy] log: $input"
        echo "  Saved. Total log entries: $total"
        _log "log" "$input"
    fi

Technical Analysis

The application stores allergy details, symptoms, goals, reminders, and activity history as plaintext files beneath ~/.local/share/allergy. It creates the storage directory using mkdir -p and creates files through shell redirection, but it does not establish a restrictive umask, request mode 0700 for the directory, or enforce mode 0600 for record and export files.

Consequently, effective permissions depend on the environment from which the script is launched. Under a permissive umask, the directory can be traversable and the health-record files readable by other local users. Existing files with overly broad permissions also remain uncorrected.

The same data is duplicated in history.log, increasing the number of files through which sensitive information can be exposed.

Attack Path

  1. A user runs a record command and supplies sensitive allergy or symptom information.
  2. The script creates `~/.loc ...[truncated 1176 chars]
Remediation
View remediation

Remediation Suggestions

  1. Set a restrictive process umask before creating any storage:

    bash
    umask 077
    
  2. Create and verify the data directory with owner-only permissions:

    bash
    install -d -m 700 -- "$DATA_DIR"
    
  3. Create record, history, and export files with mode 0600. Correct permissions on existing files after confirming that they are regular files owned by the current user:

    bash
    find "$DATA_DIR" -maxdepth 1 -type f -user "$(id -u)" -exec chmod 600 {} +
    
  4. Validate that $HOME and $DATA_DIR are owned by the expected user and reject unsafe ownership or unexpected symbolic links before writing sensitive records.

  5. Clearly document that records are stored as plaintext. If the threat model includes administrators, device theft, backup disclosure, or compromise of the user's account, offer encryption at rest using an established operating-system key store or a vetted encryption tool.

  6. Apply the same permission controls to every generated JSON, CSV, and text export because those files aggregate sensitive records.

Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (8)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill presents itself as an allergy-specific wellness tool, but the documented behavior is mostly a generic local note/logging utility with extra export, search, stats, and filesystem-related status capabilities. This mismatch is risky because users may entrust sensitive health data to a tool that lacks the promised domain-specific safeguards, analysis features, and clear disclosure of what is actually stored and logged.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest description uses broad invocation language such as logging, tracking, charting, preparing reports, and setting reminders without clear constraints on when the skill should be invoked. In an agent ecosystem, this can cause over-broad activation around sensitive health contexts, increasing the chance of collecting or storing personal medical information when the user did not intend that level of handling.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill handles health-related information and advertises automatic history/activity logging, but it does not prominently warn users that sensitive medical-style data will be stored locally and retained in logs. Because allergy and symptom data can be highly sensitive, inadequate disclosure can lead to unintended persistence, exposure to other local users/processes, and unsafe exports or backups.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This skill stores health-related entries in plaintext log files under the user's home directory without an upfront privacy warning, retention notice, or access protections. Because the skill context is allergy and symptom tracking, the data is likely sensitive medical information, making silent persistence materially more dangerous than ordinary note-taking.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The help text exposes a broader 'health toolkit' rather than a narrowly scoped allergy tracker. Commands like goal, streak, and milestone are not obviously required for identifying allergy triggers, preparing reports, or setting reminders, so the implemented behavior exceeds the manifest's stated purpose.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The help text advertises formatted export, but the first export) case only logs arbitrary input and shadows the real _export implementation later in the case statement. In a health-data tool, this misleading behavior can cause users to believe they are exporting records while instead appending sensitive data to local logs, undermining data handling expectations and auditability.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script persistently stores arbitrary free-form user input under multiple generic commands that are unrelated to the stated allergy purpose. In a health-tracking context, users may enter sensitive medical or personal information they do not expect to be retained under broad categories, increasing privacy and data-minimization risk.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
75% confidence
Finding

The script presents itself as a coherent CLI with utility commands, yet the duplicated export label shows the command dispatch does not faithfully implement the documented interface. This is an intent/code mismatch because the user-facing command contract is not what the code actually executes.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.