Back to skill

Security audit

Daily Mood

Security checks for vulnerabilities and agentic risk

Overview

This mood-message skill is mostly purpose-aligned, but it needs review because it stores sensitive mood/profile data and has unsafe local file access and persistence boundaries.

Review before installing. Use it only where users explicitly opt in to storing mood profiles and scheduled messages, avoid exposing its CLI arguments to untrusted users, and fix the --show path validation before relying on it in a multi-user environment.

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/register.js:37
Finding

Path Traversal in User Profile Lookup

Content
View full analysis
'); process.exit(1); } const filePath = path.join(USERS_DIR, `${userId}.json`); if (!fs.existsSync(filePath)) { console.error(`User "${userId}" not found.`); process.exit(1); } const u = JSON.parse(fs.readFileSync(filePath, 'utf8')); console.log(JSON.stringify(u, null, 2)); process.exit(0); } ``` ### Technical Analysis The `--show` operation directly incorporates the supplied `userId` into a filesystem path without validating its format or confirming that the resolved path remains beneath `data/users`. Node.js normalizes traversal components such as `../` when `path.join()` constructs the path. Consequently, an attacker can escape the intended user-profile directory and select another file accessible to the Node.js process. For example, because `USERS_DIR` resolves to `/data/users`, the following value resolves to the project metadata file: ```text userId = ../../_meta result = /data/users/../../_meta.json = /_meta.json ``` The forced `.json` extension and `JSON.parse()` restrict exploitation to readable files containing valid JSON. They do not prevent traversal or disclosure. This branch is inconsistent with the registration path, which restricts identifiers to alphanumeric characters, underscores, and hyphens. ### Attack Path 1. The attacker obtains the ability to invoke `register.js`, directly or through an application that exposes its arguments. 2. The attacker supplies a traversal sequence as the value of `--show`, for example: ```bash node scripts/register.js --show ../../_meta ``` 3. `path.jo ...[truncated 1152 chars]
Remediation
View remediation
Vulnerability Patterns
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (30)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The declared description emphasizes an automated daily messaging system with scheduled twice-daily delivery, multi-user processing, and personalized push sending. The supplied code does not implement scheduling, cron traversal of users, or any notification delivery. Instead, it is a local CLI helper that accepts a mood, resolves language, optionally updates one user's stored mood in a JSON file, and outputs a structured prompt for message generation. While the mood-aware bilingual behavior is aligned in spirit, the primary implemented behavior is materially narrower and different from the declared end-user capability.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 60)May include surrounding context.

md
| 08:00 每日 | `morning-push.js` | 早晨唤醒寄语:根据用户心情档案定制 |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 93)May include surrounding context.

md
| 08:00 每日 | `morning-push.js` | 早晨唤醒寄语:根据用户心情档案定制 |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 94)May include surrounding context.

md
| 08:00 每日 | `morning-push.js` | 早晨唤醒寄语:根据用户心情档案定制 |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 95)May include surrounding context.

md
| 08:00 每日 | `morning-push.js` | 早晨唤醒寄语:根据用户心情档案定制 |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 117)May include surrounding context.

md
| 08:00 每日 | `morning-push.js` | 早晨唤醒寄语:根据用户心情档案定制 |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 61)May include surrounding context.

md
| 21:00 每日 | `evening-push.js` | 夜间疗愈寄语:温柔收尾,引导好眠 |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 98)May include surrounding context.

md
| 21:00 每日 | `evening-push.js` | 夜间疗愈寄语:温柔收尾,引导好眠 |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 99)May include surrounding context.

md
| 21:00 每日 | `evening-push.js` | 夜间疗愈寄语:温柔收尾,引导好眠 |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 118)May include surrounding context.

md
| 21:00 每日 | `evening-push.js` | 夜间疗愈寄语:温柔收尾,引导好眠 |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 85)May include surrounding context.

md
node scripts/register.js <userId> [--lang zh|en] [--mood calm]

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 86)May include surrounding context.

md
node scripts/register.js <userId> [--lang zh|en] [--mood calm]

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 87)May include surrounding context.

md
node scripts/register.js <userId> [--lang zh|en] [--mood calm]

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 90)May include surrounding context.

md
node scripts/register.js <userId> [--lang zh|en] [--mood calm]

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 102)May include surrounding context.

md
node scripts/mood-response.js <mood> [--lang zh|en] [--userId <id>]

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 103)May include surrounding context.

md
node scripts/mood-response.js <mood> [--lang zh|en] [--userId <id>]

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 104)May include surrounding context.

md
node scripts/mood-response.js <mood> [--lang zh|en] [--userId <id>]

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The trigger list includes very common phrases like '早安', '晚安', 'encourage me', and 'give me a message', which can cause the skill to activate during ordinary conversation without clear user intent. In an agent environment, overly broad triggers can lead to unanticipated execution paths, accidental profile updates, or unwanted scheduling/push-enablement flows, especially because the skill also references registration and recurring delivery behavior.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The usage section mixes low-risk instant mood replies with higher-risk actions like enabling daily push and cron-driven behavior, without clearly separating when user consent is needed. This ambiguity can cause an agent or orchestrator to interpret casual emotional statements as authorization for persistent changes or recurring notifications, resulting in unintended data storage or message delivery.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The manifest description and trigger keywords are broad enough to activate on generic emotional-support or encouragement requests, increasing the chance the skill is invoked outside a clearly understood user intent boundary. In a multi-user push/mood context, overbroad activation can cause unsolicited emotional messaging, accidental collection/use of sensitive mood disclosures, or responses in situations that may warrant safer routing or clearer consent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The script supports a default mode that performs a 'full push' across all users and iterates through every JSON file in the users directory. Although the header documents usage, it does not warn that running the command without flags processes all active users, which is a user-impacting bulk operation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

When a user's language is absent, the code assigns 'zh' as the default and generates Chinese-formatted content unless the value is exactly 'en'. This imposes a specific language choice by default rather than offering a neutral fallback or requiring user preference.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The top-level documentation claims the script returns a matching mood prompt, but the implementation also mutates stored user data. That mismatch is dangerous because operators or other components may treat the script as side-effect free and call it in contexts where persistent storage of sensitive mood data was not intended.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The natural-language behavior forces a specific locale by default rather than offering a neutral choice or using explicit user opt-in. This can violate language/locale policy because users who do not specify --lang are automatically served Chinese output.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script is presented as generating an immediate mood-response prompt, but when a userId is supplied it silently writes the reported mood and timestamp back into that user's profile. This hidden state mutation creates a privacy and integrity issue because invoking a seemingly read-only operation also persists sensitive emotional data without explicit consent or clear documentation.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.