Back to skill

Security audit

Menstrual Health Tracker

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent menstrual health tracker, but it needs Review because it handles very sensitive reproductive health data with weak dashboard and local-file protections.

Install only if you are comfortable keeping menstrual and reproductive-health records in local plaintext files. Use it on a private device, avoid sharing generated dashboard HTML files, avoid importing untrusted records or notes before the dashboard escaping issue is fixed, and prefer a version that vendors Chart.js locally, safely embeds JSON, minimizes exported data, and writes files with restrictive permissions.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (3)

T08 · Insecure Dependencies

Error
Location
assets/dashboard.html:316
Finding

Third-Party CDN Script Executes Alongside Embedded Reproductive Health Data

Content
View full analysis
``` The dashboard generator embeds the complete user dataset into the same document: ```python injection = f""" """ # Insert before html = template.replace("", injection + "") Path(output_path).write_text(html, encoding="utf-8") ``` ### Technical Analysis The generated dashboard loads Chart.js from a third-party CDN without a Subresource Integrity (`integrity`) hash. The remotely served script executes with the same document privileges as the application's own JavaScript. At the same time, the dashboard contains a plaintext JavaScript representation of the complete health dataset. This can include menstrual dates, pregnancy or postpartum state, medical conditions, medications, symptoms, mood scores, events, and free-form notes. Pinning the URL to a package version does not provide cryptographic verification of the returned content. A compromise of the CDN, package distribution process, origin account, DNS path, or HTTPS termination infrastructure could cause modified JavaScript to execute when the dashboard is opened. Such code could directly read `userData`, `analysisResult`, and `recommendations`. This des ...[truncated 1587 chars]
Remediation
View remediation
``` 3. Deploy a restrictive Content Security Policy that limits script and connection destinations. Prefer a policy that does not permit arbitrary inline scripts. 4. Minimize the data placed in the dashboard. Embed only the aggregate values required to render charts, rather than the complete user profile and raw notes. 5. Generate dashboards that function fully offline so opening sensitive reports never requires contacting third parties. 6. Document that exported dashboards contain sensitive information and should not be shared or opened in untrusted environments. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/analyze.py:413
Finding

Stored Script Injection Through Unsafe JSON Embedding in Generated Dashboard

Content
View full analysis
(function() {{ var userData = {json.dumps(data, ensure_ascii=False, indent=2)}; var analysisResult = {json.dumps(analysis, ensure_ascii=False, indent=2)}; var recommendations = {json.dumps(recommendations, ensure_ascii=False, indent=2)}; document.addEventListener('DOMContentLoaded', function() {{ if (window.menstrualDashboard) {{ window.menstrualDashboard.loadData(userData, analysisResult, recommendations); }} }}); }})(); """ # Insert before html = template.replace("", injection + "") Path(output_path).write_text(html, encoding="utf-8") ``` ### Technical Analysis The generator inserts `json.dumps()` output directly inside an executable ``. If any user-controlled string contains that sequence, the browser terminates the original script element before the JavaScript parser processes the JSON. Remaining content is then interpreted as HTML. For example, a stored note containing the following value would break out of the generated data block: ```html ``` Potential input sources include cycle notes, event values, profile fields, imported historical records, symptom names, and other free-form data. Because the payload is saved and later included in an exported dashboard, this is a stored injection vulnerability rather than a transient rendering issue. The dashboard also uses `innerHTML` for recommendation titles and text in `assets/dashboard.html:811-816`. Recommendations are currently generated from internal constants, but if that interface later accepts ...[truncated 1695 chars]
Remediation
View remediation
SAFE_JSON_DATA ``` ```javascript const data = JSON.parse( document.getElementById('dashboard-data').textContent ); ``` 3. Before inserting JSON into HTML, escape at least: - `<` as `\u003c` - `>` as `\u003e` - `&` as `\u0026` - U+2028 as `\u2028` - U+2029 as `\u2029` 4. Prefer a well-tested HTML-safe JSON serializer rather than implementing context-sensitive escaping ad hoc. 5. Replace `innerHTML` assignments for dynamic text with DOM construction and `textContent`. 6. Add a restrictive Content Security Policy that disallows injected inline scripts. Nonce- or hash-based scripts may be used for the trusted bootstrap code. 7. Add regression tests using payloads such as: ```text ``` The generated page must treat the entire payload as inert text. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/analyze.py:537
Finding

Sensitive Health Records and Dashboard Exports Are Written Without Explicitly Restrictive Permissions

Content
View full analysis
dict: p = Path(path) if path else DEFAULT_DATA_PATH if not p.exists(): return {"user_profile": {"life_stage": "menstruating"}, "cycles": [], "daily_logs": [], "events": []} return json.loads(p.read_text(encoding="utf-8")) def save_data(data: dict, path: str = None): p = Path(path) if path else DEFAULT_DATA_PATH p.parent.mkdir(parents=True, exist_ok=True) p.write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8") ``` Dashboard exports containing the complete dataset are written in the same manner: ```python Path(output_path).write_text(html, encoding="utf-8") ``` ### Technical Analysis The application stores highly sensitive reproductive-health data as plaintext but does not explicitly set restrictive directory or file permissions. `Path.mkdir()` and `Path.write_text()` rely on the process umask and existing filesystem state. On a shared system with a permissive umask, newly created files may be readable by other local accounts. Existing files may also retain overly broad permissions after being overwritten. The generated HTML dashboard presents an additional exposure because it contains a second plaintext copy of the complete dataset. The output location is user-controlled and may be a shared directory, synchronized folder, web-served directory, or removable volume. No encryption, permission validation, symlink protection, or warning is applied by the executable code before sensitive data is written. ### Attack Path 1. The skill or another caller invokes `save_data()` on a multi-user system. 2. The parent directory or process umask allows group or world ...[truncated 1088 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (27)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
使用 `assets/dashboard.html` 模板生成可视化仪表盘。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
使用 `assets/dashboard.html` 模板生成可视化仪表盘。

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · assets/dashboard.html (reported line 240)May include surrounding context.

html
</header>

<div class="container" id="dashboard">
  <!-- Empty state - shown when no data -->
  <div class="empty-state" id="emptyState">
    <div class="empty-icon">📋</div>
    <div class="empty-title">开始记录你的经期旅程</div>

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The file solicits sensitive health and reproductive information such as pregnancy status, menstrual history, medical conditions, medications, and body metrics without any accompanying privacy notice, consent language, or explanation of how the data will be used and protected. Users may disclose highly sensitive information without understanding storage, retention, sharing, or risk, which is especially dangerous in a medical/fertility context.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill is designed to collect highly sensitive reproductive and health data, including pregnancy status, menstrual history, medications, age, and medical conditions, but the file shows no visible notice about why the data is collected, how it will be stored, who can access it, retention limits, or whether providing it is optional. In a health-related context, this materially increases privacy, consent, and misuse risk because users may disclose intimate data before understanding the consequences.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill advertises automatic Chinese/English language detection and in-conversation switching without any mention of user consent or controls. In a health-tracking context, automatic inference over user messages can expand the amount of sensitive data processed and may surprise users by adapting behavior based on detected language rather than explicit preference.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The README states the skill will automatically trigger whenever menstruation-related topics are mentioned, which is an overly broad activation condition for a highly sensitive health domain. This can cause unsolicited processing of intimate health information and accidental activation in ordinary conversation, increasing privacy risk and the chance of inappropriate medical-style responses without explicit user intent.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The manifest description uses very broad trigger phrases covering common reproductive and health-related terms, which can activate the skill in conversations that are informational, ambiguous, or outside the user's intent to use a tracking tool. In a skill that collects and stores highly sensitive health data, over-broad activation increases the risk of unnecessary prompting, unintended data intake, and privacy-invasive behavior.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill handles highly sensitive reproductive health data yet allows later sessions to proceed based solely on local file existence, treating prior consent as implicitly perpetual. On shared devices or after context changes, this can result in continued processing and exposure of sensitive data without fresh, explicit user confirmation, undermining the stated consent model.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The dashboard presents next-period, ovulation, and fertile-window predictions as concrete dates without a visible disclaimer that these are estimates and not medical advice. In a reproductive-health context, users may rely on these outputs for contraception, conception timing, or health decisions, so overconfidence in approximate calculations can cause harm.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The insights section emits medical-style alerts such as possible PCOS, thyroid/endocrine concerns, uterine issues, or advice to seek care, but no clinical disclaimer or uncertainty framing is shown with those warnings. This can mislead users into self-diagnosing or reacting to heuristic output as if it were validated medical assessment.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
81% confidence
Finding

The file path references-en/ together with the document content indicates this skill guidance is specifically constrained to English. Under the stated policy, forcing a specific language without offering user choice or documenting a justified locale restriction is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The file resides under an English-specific path and all user-facing prompts are written only in English, with no indication that users may choose another language or that English is a documented, justified requirement. This can constitute a language or locale policy violation when a skill forces a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill defines broad collection of highly sensitive reproductive, health, medication, and lifestyle data and makes that profile the 'highest-priority context' for the entire skill, but it does not clearly state a bounded purpose, necessity limits, minimization rules, or handling constraints. In a health-related context, this creates substantial privacy and misuse risk because the system is instructed to continuously personalize behavior using intimate data far beyond what is obviously required for a narrowly scoped function.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This markdown guidance mandates a single language/locale in its natural-language instructions and examples, but does not indicate that users may opt into another language or that the skill is limited to a Chinese-speaking context. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This file's natural-language instructions are exclusively in Chinese, which effectively forces a specific language for users and downstream agent behavior. The policy requires either user opt-in/choice or a clearly documented justification for the locale constraint, neither of which appears in this file.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The document explicitly says life stage must not be inferred from age alone, but later uses '年龄>40 + 周期波动增大' as a transition-detection signal for perimenopause. In a health-related skill, this inconsistency can cause the agent to apply age-based assumptions and steer users toward a sensitive reproductive status classification without clear user confirmation, creating misclassification and potentially inappropriate guidance.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

This markdown file is entirely written in Chinese and does not indicate that the language is optional, configurable, or limited to a specifically Chinese-speaking context. Under the policy rule, forcing a specific language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

All user-facing prompts, examples, and templates in the file are written only in Chinese, and the instructions indicate these prompts should drive the interaction. There is no indication that the user can choose another language or that the skill is intentionally limited to a Chinese-speaking region or audience.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring and user-facing reporting strings are written in Chinese, indicating the skill is designed to present its interface and results in a single language. There is no visible opt-in, locale selection, or justification for restricting output language, which can violate language/locale policy requirements.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The surrounding comments describe step 3 as '通用健康建议' and later claim personalization checks in a '3-round pressure test', but L382-L388 unconditionally append generic recommendations and use for c in [] as a placeholder, guaranteeing the BBT recommendation is always added regardless of actual data. This actively diverges from the documented intent that recommendations are validated against user-specific information.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The dashboard generator embeds the full menstrual-health dataset, analysis results, and recommendations directly into a local HTML file as JavaScript variables. Because this is highly sensitive health data, saving it in cleartext HTML without an explicit privacy warning, minimization, or protective controls increases the risk of accidental disclosure through shared files, backups, sync services, or local compromise.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The language routing table specifies that all Chinese user-facing output must be in '简体中文' once Chinese is detected. This imposes a specific script/locale variant automatically rather than offering user choice, which can violate language/locale preference expectations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
98% confidence
Finding

The document sets lang="zh-CN" and all visible interface text is in Simplified Chinese, with no mechanism for user language selection. Under the policy, forcing a specific language without user opt-in is a natural-language locale violation unless clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

This JSON file contains natural-language note content in Chinese (for example at L026), and similar Chinese-language strings recur in later note and description fields. Because SQP-3 applies to all file types and flags language/locale constraints without user opt-in or justification, embedding only one language in user-facing sample content can be a mild locale-policy concern when no choice or scope is documented in the file.

Content

No source excerpt is available for this finding.