Back to skill

Security audit

nutricoach 营养专家

Security checks for vulnerabilities and agentic risk

Overview

NutriCoach appears to be a legitimate nutrition tracker, but its dashboard can expose and let others change sensitive health data on the local network.

Install only if you are comfortable handling sensitive health data locally. Do not run the dashboard on an untrusted network unless it is fixed to bind to 127.0.0.1 and protected with authentication; avoid cloud OCR for private images unless you trust the provider; use simple usernames only; and keep exported or backup database files secured.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (4)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/web_server.py:44
Finding

Unauthenticated Dashboard Exposes Sensitive Health Data and Mutation APIs on All Network Interfaces

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/web/static/app.js:235
Finding

Persistent Cross-Site Scripting Through Unsafely Rendered Pantry Fields

Content
View full analysis
${item.food_name}
${item.remaining_g}${unit}
``` Additional values are embedded into an inline event handler: ```javascript ``` The generated string is then parsed as HTML: ```javascript document.getElementById('pantry-content').innerHTML = html; ``` ### Technical Analysis Pantry values originate from the database and can include user-supplied food names and related attributes. These values are inserted into HTML text, HTML attributes, CSS properties, and inline JavaScript without context-appropriate encoding. The attempted escaping of `food_name` only replaces single and double quotation marks with backslash-prefixed characters. Backslashes do not safely escape HTML attributes, and this operation does not encode `<`, `>`, `&`, line terminators, backticks, or JavaScript escape sequences. More importantly, the unescaped `item.food_name` is placed directly into both a `title` attribute and an element body before the complete string is assigned to `innerHTML`. A malicious value can terminate the expected element and inject a new event-bearing element. Because pantry values are ...[truncated 1478 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/backup_db.py:15
Finding

Unsanitized Usernames Permit Path Traversal During Database and Backup Operations

Content
View full analysis
str: """Get database file path for a user.""" skill_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) data_dir = os.path.join(skill_dir, 'data') return os.path.join(data_dir, f"{username}.db") ``` The restore command accepts an arbitrary existing source path and copies it to the calculated database path: ```python def restore(username: str, backup_file: str, force: bool = False) -> Dict[str, Any]: """Restore database from backup.""" db_path = get_db_path(username) # Check if backup exists if not os.path.exists(backup_file): # Try relative to backup dir backup_dir = get_backup_dir() backup_file = os.path.join(backup_dir, backup_file) if not os.path.exists(backup_file): return {"status": "error", "error": "backup_not_found", "message": f"Backup not found: {backup_file}"} # Check if current db exists if os.path.exists(db_path) and not force: return { "status": "error", "error": "database_exists", "message": f"Database exists. Use --force to overwrite." } try: # Backup current before restore if os.path.exists(db_path): backup(username) shutil.copy2(backup_file, db_path) return { "status": "success", "restored_from": backup_file, "database_path": db_path } ``` A username restriction exists only in `scripts/init_db.py:255-262`: ```python if not re.match(r'^[a-zA-Z0-9_-]+$', args.user): print(json.dumps({ "status": "error", "error": "inva ...[truncated 2543 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
requirements.txt:6
Finding

Unpinned Dependencies and Unversioned Remote JavaScript Create Supply-Chain Exposure

Content
View full analysis
=5.4.0 # Web Dashboard (Optional) flask>=2.0.0 ``` The dashboard retrieves executable JavaScript from a third-party CDN without a fixed version or integrity hash: ```html ``` ### Technical Analysis The Python requirements permit any future package release satisfying the minimum version. This makes installations non-reproducible and allows unreviewed future versions to enter the execution environment. The Chart.js URL does not specify a package version. Its effective content can therefore change after the Skill has been reviewed. The element also lacks a Subresource Integrity hash, so the browser has no cryptographic mechanism to verify that the downloaded script matches an audited artifact. The remote script executes in the dashboard origin and can access the page and same-origin API responses available to browser JavaScript. Because the dashboard handles personal health information, compromise or unexpected mutation of this third-party resource has a sensitive data impact. No evidence was found that the current named dependencies are malicious. The finding concerns unsafe dependency resolution and mutable remote executable content. ### Attack Path 1. A user installs the Skill dependencies at a later date. 2. The package resolver selects versions newer than those originally reviewed because only minimum versions are specified. 3. A compromised, malicious, or incompatible future release executes within the Python application environment. For the browser-side path: 1. A user opens the dashboard. 2. The browser requests the unver ...[truncated 794 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (86)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The supplied code chunk does not implement a health data management system. Its actual purpose is much narrower: it provides a static nutrition reference database for Chinese foods and basic lookup utilities. While this partially supports the declared capability of querying food nutrition information and could be a supporting component of a larger diet system, it does not perform the majority of the declared functions such as recording user data, tracking time series, generating recommendations, OCR/photo recognition, pantry management, exports, backups, multi-user isolation, or dashboard visualization. Therefore the description materially overstates what this code chunk actually does.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The username is interpolated directly into the SQLite filename with no validation or canonicalization, so path traversal sequences such as '../' can escape the intended data directory. In this skill, that can let an attacker point the code at arbitrary files the process can access, causing unauthorized reads, database probing, or creation/use of attacker-chosen SQLite files outside the per-user isolation boundary.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The entire skill document is written in Chinese and presents the design guidance exclusively in that language, with no indication that users may choose another language or that the locale restriction is intentional for a region-specific audience. Under the policy, natural-language content that imposes a language without opt-in can be a locale-policy violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README presents Kimi Vision as the default OCR engine and notes only that it requires an API key, but does not warn that uploaded food/package images may be transmitted to a third-party service. In a health-tracking skill, images can contain sensitive dietary, medical, or incidental personal information, so omission of this disclosure can lead users to unknowingly exfiltrate personal data off-device.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The README documents export, backup, and restore workflows for personal health databases without warning that these operations duplicate sensitive user data and that restore may overwrite current records. Because the skill manages body metrics, diet logs, and other health-related data, users may mishandle exported files or unintentionally replace data without understanding the privacy and integrity risks.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This markdown file contains user-facing natural language only in Chinese, and nowhere indicates that the skill is region-specific or that users may choose another language. Under the policy, forcing a specific language without opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill advertises capabilities that imply shell, filesystem, environment, and network access, but the manifest does not declare any explicit tool scope or permissions. This weakens security review and least-privilege enforcement, making it easier for a host agent to grant broader access than users expect, especially given the skill handles sensitive health data and backups.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

This section switches to Chinese for core setup and usage instructions, including the recommended AI assistant workflow and command examples, while the rest of the document is primarily in English. That creates an implicit language constraint for users without stating that the skill is Chinese-language or offering an opt-in or alternative language path.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation describes cloud OCR configuration and use but does not clearly warn that food packaging images and extracted text may be sent to third-party providers. Because the skill processes personal health and diet data, users may unknowingly transmit sensitive information off-device without informed consent.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

The skill explicitly supports sending OCR requests to an external API endpoint, which creates a real data exfiltration path for uploaded images, extracted nutrition text, and possibly related user context. In a health-oriented skill, this is more sensitive because packaging images or associated metadata can reveal dietary habits, medical preferences, or household information.

Content

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

yaml
vision:
  api_key: "your-api-key"
  base_url: "https://api.moonshot.cn/v1"  # 或其他兼容 OpenAI 的 API
  model: "kimi-k2.5"

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The metadata describes tracking body metrics, meals, OCR from food packaging photos, and intelligent recommendations, all of which involve privacy-sensitive health and lifestyle data, but it provides no user-facing privacy warning or handling summary. This omission is more concerning in this context because the skill is explicitly health-focused and multi-user, increasing the sensitivity of collected data and the risk of users sharing information without informed consent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The meal logging flow indicates that food photos may be sent to a Vision API for identification, but the architecture does not warn that user-uploaded images and related metadata may leave the local environment. Meal photos can reveal health conditions, routines, locations, or other sensitive context, so undisclosed third-party transmission creates a meaningful privacy and compliance risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The architecture explicitly stores highly sensitive health data in per-user local SQLite files under a predictable workspace path, but provides no mention of encryption, OS-level access controls, consent, or privacy warnings. In a health-coaching skill, weight, body fat, meal history, and related metrics are sensitive personal data, so local plaintext storage can expose users to privacy breaches from other local users, malware, backups, or accidental file sharing.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
78% confidence
Finding

The configuration includes a third-party API endpoint for vision/OCR, confirming that user data may be transmitted to an external service. While using an HTTPS endpoint is not inherently malicious, in this skill context the transmitted content may include sensitive dietary and health-related images, making external transfer security- and privacy-relevant if not tightly controlled and disclosed.

Content

Scanner excerpt · references/ARCHITECTURE.md (reported line 146)May include surrounding context.

Vision OCR Configuration (Optional)

vision: api_key: "your-api-key" base_url: "https://api.moonshot.cn/v1" model: "kimi-k2.5"

text

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This markdown file contains core schema descriptions in Chinese after starting in English, which effectively forces a specific language for important documentation content. The file does not state that it is intentionally Chinese-only or provide any user opt-in or alternative language path, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The pantry and pantry_usage sections switch to Chinese for table descriptions and metadata, and later operational guidance remains Chinese-only. Because these are substantive instructions rather than incidental labels, the file imposes a locale choice without opt-in or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This section contains important behavioral guidance for units and calculation rules, but it is only available in Chinese. Since no language selection, opt-in, or justification is provided, this is a natural-language locale policy issue under the stated rules.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The documentation states that custom_foods.unit and food_items.unit are supported and describes behavior for recording meal quantities by unit. However, the actual CREATE TABLE for custom_foods contains no unit column (L416-L443), and the food_items table also has no unit column (L388-L410). This is an active contradiction between documentation and implemented schema, not merely an omission.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

该 markdown 文件说明了 init_db.py --force 会覆盖现有数据库,但仅作为参数说明出现,没有明确提醒用户这可能导致现有数据被覆盖。同样,这类会影响用户数据完整性的操作按规则应有显式警告。

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

backup_db.py restore --file <backup> 是会直接影响现有用户数据状态的恢复操作,但文档仅给出命令示例,没有提示恢复可能覆盖当前数据或建议先执行备份。根据 markdown 文件的告警要求,这属于缺少用户警示。

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The guide documents a cloud OCR mode that sends food-package images and extracted nutrition data to third-party vision APIs, but it does not clearly warn users about external data transmission, retention, or privacy implications. Because the product manages personal health and dietary data, uploaded images may contain sensitive information and metadata, making silent off-device processing a meaningful privacy risk.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

The documented cloud OCR configuration includes a third-party API endpoint, confirming that user-supplied image data can be transmitted externally. In the context of a nutrition and health management tool, this expands the privacy and compliance surface because food labels, purchase details, and potentially embedded metadata leave the local environment.

Content

Scanner excerpt · references/FEATURE_GUIDE.md (reported line 189)May include surrounding context.

yaml
vision:
  api_key: "your-api-key"
  base_url: "https://api.moonshot.cn/v1"
  model: "kimi-k2.5"

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

This second configuration example again advertises a live external OCR endpoint and API key usage, reinforcing that the feature depends on off-device processing by a third party. Repeating such examples without adjacent privacy notice or handling guidance can normalize sensitive data transmission without informed user awareness.

Content

Scanner excerpt · references/FEATURE_GUIDE.md (reported line 234)May include surrounding context.

yaml
vision:
  api_key: "sk-xxxxx"
  base_url: "https://api.moonshot.cn/v1"
  model: "kimi-k2.5"

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The backup and restore commands are presented without warning that restore operations may overwrite current user data or cause irreversible rollback if the wrong file is chosen. In a multi-user health-data application, unclear restore semantics increase the risk of accidental data loss, integrity issues, or restoring another user's snapshot.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The daily plan returns suggested_foods exclusively as Chinese-language strings, which imposes a specific language on all users. This is a natural-language locale policy issue because the file provides no opt-in, fallback, or documented justification for restricting output language.

Content

No source excerpt is available for this finding.