Back to skill

Security audit

Habithero

Security checks for vulnerabilities and agentic risk

Overview

HabitHero looks like a local productivity logger, but its listing overstates habit-tracker features and under-discloses persistent local logs, exports, and data-handling risks.

Review this skill before installing. It does not appear to exfiltrate data or run remote code, but it keeps personal entries locally, can export them into portable files, and exposes more commands than its listing advertises. Avoid entering sensitive health, schedule, or private notes unless you are comfortable with files stored under ~/.local/share/habithero, and restrict or inspect file permissions before regular use.

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 (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/script.sh:6
Finding
Personal habit data may be created with permissive filesystem permissions<![CDATA[ ## Vulnerability Details **File Location**: `scripts/script.sh`, lines 6-9 **Vulnerability Type**: Insecure local data permissions **Risk Level**: Medium ### Vulnerable Code ```bash DATA_DIR="${HOME}/.local/share/habithero" mkdir -p "$DATA_DIR" _log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; } ``` ### Technical Analysis The application stores personal habit, health, routine, and productivity records under `~/.local/share/habithero`. It creates the data directory and log files without setting a restrictive `umask` or explicitly enforcing filesystem permissions. Consequently, the effective permissions depend on the environment in which the script runs. With a common `022` umask, the directory can be created as mode `755` and log files as mode `644`, making the records readable by other local users who can traverse the user's home directory. This issue applies not only to `history.log`, but also to the command-specific logs and generated export files created elsewhere in the script. ### Attack Path 1. A user runs HabitHero in an environment with a permissive umask, such as `022`. 2. The script creates `~/.local/share/habithero` and its log files without restrictive modes. 3. The user records potentially sensitive habits, health activities, routines, reminders, or reviews. 4. Another account on the same system enumerates the user's accessible home directories. 5. The local account reads the HabitHero logs or exports and obtains the recorded personal information. The attack requires local filesystem access under another account and sufficient permission to traverse the affected user's home directory. ### Impact Assessment The vulnerability can disclose all HabitHero records and exports to unauthorized local users. Exposed information may include personal routines, health-related habits, schedules, reminders, and historical activity. The issue affects confidentiality within the current user's account data. It does not ...[truncated 118 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Establish a restrictive process umask before creating any application data: ```bash umask 077 ``` 2. Create and validate the directory with owner-only permissions: ```bash mkdir -p -m 700 "$DATA_DIR" chmod 700 "$DATA_DIR" ``` 3. Create log and export files with mode `600`. Existing files should also be corrected: ```bash find "$DATA_DIR" -type f -exec chmod 600 {} + ``` 4. Refuse to use the data directory if it is a symbolic link or is owned by another account. 5. Document that HabitHero stores potentially sensitive personal information locally and identify the exact storage location. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/script.sh:66
Finding
Unescaped export fields permit malformed output and spreadsheet formula injection<![CDATA[ ## Vulnerability Details **File Location**: `scripts/script.sh`, lines 66-86 **Vulnerability Type**: Unsafe JSON and CSV generation **Risk Level**: Medium ### Vulnerable Code ```bash printf ' {"type":"%s","time":"%s","value":"%s"}' "$name" "$ts" "$val" >> "$out" done < "$f" echo "" >> "$out" echo "]" >> "$out" ;; csv) echo "type,time,value" > "$out" for f in "$DATA_DIR"/*.log; do [ -f "$f" ] || continue local name=$(basename "$f" .log) while IFS='|' read -r ts val; do echo "$name,$ts,$val" >> "$out" done < "$f" done ;; ``` ### Technical Analysis The export implementation inserts log content directly into JSON and CSV output without format-specific encoding. For JSON exports, special characters in `$name`, `$ts`, or `$val`, including quotation marks, backslashes, carriage returns, and control characters, are not escaped. A user-controlled value can therefore produce invalid JSON or modify the apparent structure of the exported document. For CSV exports, fields are concatenated with commas without RFC 4180 quoting. Values containing commas, quotation marks, or embedded line breaks can create additional columns or rows. Values beginning with spreadsheet formula indicators such as `=`, `+`, `-`, or `@` can be interpreted as formulas when the CSV file is opened in spreadsheet software. Formula behavior depends on the spreadsheet product and its security configuration. Potential consequences include unexpected external requests, disclosure through formula-based URL access, or dangerous command invocation in legacy or insecure spreadsheet environments. ### Attack Path 1. An attacker supplies or persuades the user to record a value containing CSV or JSON metacharacters, for example a formula-prefixed habit value. 2. The script writes the value unchanged into a `.log` file. 3. The user runs `habithero export csv` or `habithero export json`. 4. The export routine copies the unescaped value d ...[truncated 983 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Generate JSON through a serializer rather than string interpolation. For example, use `jq` with arguments passed through `--arg` so quotation marks, backslashes, and control characters are encoded correctly. 2. Apply RFC 4180 CSV encoding to every field: - Enclose fields in double quotes. - Replace each embedded double quote with two double quotes. - Preserve commas and line breaks only inside quoted fields. 3. Neutralize spreadsheet formulas in exported text fields. For untrusted values beginning with `=`, `+`, `-`, or `@`, prepend an apostrophe or apply another mitigation appropriate to the intended spreadsheet consumers. 4. Add tests covering quotation marks, commas, backslashes, Unicode, CR/LF characters, formula prefixes, and empty values. 5. Validate generated JSON with a standards-compliant parser before reporting that export succeeded. ]]>
Vulnerability Patterns
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (5)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The declared description is too narrow and partly inaccurate. While the tool name and one command ('streak') suggest habit tracking, the code is actually a broader CLI productivity toolkit for recording arbitrary entries in multiple log files under ~/.local/share/habithero. It does not implement visual calendars, and it does not compute streaks; it merely appends user input to streak.log like any other category. It also provides undeclared capabilities such as exporting data, searching logs, viewing recent activity, and reporting status/statistics. This is a material description-behavior mismatch, though the code appears limited to local file storage and does not access suspicious external resources.

Description-Behavior Mismatch

Medium
Confidence
96% confidence
Finding
The help text presents the tool as a 'productivity toolkit' and exposes commands such as plan, review, prioritize, archive, timeline, report, and weekly-review, which go beyond a habit tracker focused on streak counting and visual calendars. The code also lacks any implementation of visual calendar rendering, so the actual behavior does not match the manifest's claimed scope.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The export feature aggregates all recorded activity into json/csv/txt files on disk, increasing the concentration and portability of sensitive user data without any warning or confirmation. In a habit/productivity context this can include detailed personal timelines and notes, making accidental sharing, backup leakage, or local compromise more damaging than the original per-log storage.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
User-provided content is persistently written to local files under ~/.local/share/habithero without any explicit notice, consent, retention policy, or sensitivity warning. In this skill context, users may enter personal plans, habits, reviews, or reminders, so silent persistence can expose private behavioral data to other local users, backups, endpoint collection tools, or later unintended disclosure.

Intent-Code Divergence

Low
Confidence
85% confidence
Finding
The header comment identifies the script as 'Habithero — productivity tool', which implies purpose-built habit/productivity features. In practice, the command handlers just append arbitrary user input to separate log files, and there is no concrete streak calculation or calendar visualization logic to support the documented identity.

Static analysis

No suspicious patterns detected.