Back to skill

Security audit

Sleep Tracker

Security checks for vulnerabilities and agentic risk

Overview

This skill is health-related and mostly user-directed, but it has inconsistent scope and stores sensitive sleep journal data in an under-disclosed shared temporary file.

Install only if you are comfortable with plaintext local wellness logs. Avoid recording sensitive medical details, and be especially cautious with scripts/sleep.sh because its journal uses /tmp/sleep_journal.txt rather than a private per-user directory.

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/sleep.sh:9
Finding

Predictable Shared Temporary File Permits Journal Disclosure and Symlink Attacks

Content
View full analysis
> "$JOURNAL_FILE" echo "╔══════════════════════════════════════════════════════════╗" echo "║ 📓 睡眠日记" echo "╚══════════════════════════════════════════════════════════╝" echo "" echo " ✅ 已记录 ${date} 的睡眠数据" echo "" echo "📋 最近7天记录:" echo "────────────────────────────────────────" printf " %-12s %-14s %-10s %-8s %s\n" "日期" "时间" "时长" "质量" "备注" echo " ─────────────────────────────────────────────────" if [ -f "$JOURNAL_FILE" ]; then tail -7 "$JOURNAL_FILE" | while IFS='|' read -r d t dur q n; do ``` ### Technical Analysis The script stores health-related journal records at the fixed, globally predictable path `/tmp/sleep_journal.txt`. It does not securely create the file, enforce restrictive permissions, verify ownership, or reject symbolic links before appending data. The shell append operator follows symbolic links. Consequently, an attacker who can prepare the path before the victim's first use may create a file or symbolic link at that location. Successful symbolic-link exploitation depends on operating-system protections such as Linux `fs.protected_symlinks`, but the underlying code remains unsafe and may be exploitable on systems without equivalent protections. The fixed path also causes all users and concurrent instances to target the same journal. Depending on the resulting file permissions, this can expose private sleep records or mix records belonging to different users. The script subsequently reads and displays the last seven lines from the same attacker-influenced file. ### Attack Path 1. The attacker predicts the hardcoded path `/tmp/sleep_journal.t ...[truncated 1419 chars]
Remediation
View remediation
&2 exit 1 fi if [ ! -e "$JOURNAL_FILE" ]; then (umask 077 && : > "$JOURNAL_FILE") fi if [ ! -f "$JOURNAL_FILE" ] || [ ! -O "$JOURNAL_FILE" ]; then printf 'Journal must be a regular file owned by the current user.\n' >&2 exit 1 fi chmod 600 -- "$JOURNAL_FILE" ``` 3. If temporary storage is genuinely required, create a private temporary directory with `mktemp -d`, install a cleanup trap, and place the journal inside that directory. Do not use a fixed name directly under `/tmp`. 4. Keep `umask 077` active while creating files containing health information so newly created files are accessible only to their owner. 5. For stronger resistance to race conditions, use a helper or implementation capable of opening the destination with exclusive creation and no-symbolic-link-following semantics, rather than performing a separate check followed by a shell redirection. ]]>
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 (9)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The manifest and description present this as a sleep-focused analysis and improvement skill, but the documented behavior is a generic health logger with export capability. This can mislead users and host systems about the skill’s actual scope, including the collection and disclosure of broader health data than expected, which is especially sensitive in a wellness context.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill is advertised as a sleep tracker, but the documentation describes a broad habit and health tracker covering meals, exercise, hydration, and general wellness. This scope mismatch can cause users to provide more sensitive health information than intended and can bypass expectation-based safety reviews that would classify the skill differently.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The metadata promises sleep analysis, improvement suggestions, schedule planning, environment optimization, nap guidance, and journaling, but the actual documented functions are basic logging, reminders, goals, and generic health tips. In a health context, overstating analytic or advisory capability can mislead users into relying on functionality that does not exist, reducing trust and potentially affecting wellness decisions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill stores health and sleep entries in local plaintext logs and supports exporting them, but the description does not prominently warn users about this privacy exposure. Because the data involves potentially sensitive wellness information, omission of storage and export disclosures increases the risk of accidental disclosure through shared machines, backups, redirection, or casual file access.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest describes a sleep-improvement tool with sleep analysis, schedule planning, environment optimization, nap guidance, and sleep journaling. In contrast, the script presents itself as a generic "Health and wellness tracker" and its commands/logging model record arbitrary entries, generic health tips, and goals without any sleep-specific analysis or sleep-environment functionality.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The help text advertises commands like "streak", "reminder", "goal", "export", and especially "reset" as functional tracker features. However, some commands only print messages or echo parameters without implementing the implied action—for example, "reset" never clears data, "reminder" does not schedule anything, and "streak" does not compute a streak.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script’s title, help text, command descriptions, usage errors, and most user-facing output are written in Chinese, which effectively constrains the skill to a specific language/locale. The file does not indicate any opt-in, fallback, or user-selectable language behavior that would satisfy a language-choice policy.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The description begins in Chinese and then switches to English, which imposes a language presentation choice without stating whether multilingual output is intentional or user-selectable. Under the language/locale policy rule, natural-language content should not force a language choice without opt-in or clear justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The skill content is written entirely in Chinese, including all substantive instructions, with no indication that the user opted into that language or that the skill is intended only for a Chinese-speaking audience. This can violate language/locale policy when a skill implicitly forces a specific language rather than offering a choice or documenting the locale constraint.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.