Back to skill

Security audit

AI营养师

Security checks for vulnerabilities and agentic risk

Overview

The skill is a legitimate nutrition assistant, but it stores personal health profile data locally and generates HTML reports without safely escaping dynamic input.

Install only if you are comfortable with a Chinese-focused nutrition assistant that may store profile details on disk. Avoid loading profile JSON from untrusted sources, review or delete user_data/profile.json when done, and treat generated HTML reports as local files that could be unsafe if their input data came from someone else.

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/html_report.py:120
Finding

Unescaped Profile Data Permits Active-Content Injection in Generated HTML Reports

Content
View full analysis

🥗 个性化饮食方案

Based on the Chinese Dietary Guidelines 2022 and AI recommendations | {profile.get('goal', 'Healthy diet')} plan

``` The resulting document is then written directly to the selected output file: ```python with open(output_path, "w", encoding="utf-8") as f: f.write(html) return output_path ``` A profile can be loaded from a caller-controlled JSON file: ```python if args.profile and os.path.exists(args.profile): with open(args.profile, "r", encoding="utf-8") as f: profile = json.load(f) else: profile = engine.build_profile({ "age": 30, "gender": "Male", "height": 175, "weight": 70, "goal": args.goal, "activity_level": "Moderate activity" }) plan = engine.generate_meal_plan(profile, days=7) path = generate_meal_plan_report(profile, plan, output) ``` Other report fields are interpolated using the same unsafe pattern: ```python items_str = "、".join(s["items"]) meals_html += f"""
🍪 {s['name']}
{items_str}
{s['estimated_kcal']}kcal | Protein {s['protein_g']}g
""" items_str = "、".join(meal["items"]) meals_html += f"""
{emoji} {label} ({meal['name']})
{items_str}
{meal['estimated_kcal']}kcal | Protein {meal['protein_g']}g | ⏱{meal['prep_time_min']}min | {meal['target_pct']}
""" ``` ### Technical Analysis Dynamic values are inserted into HTML text ...[truncated 2458 chars]
Remediation
View remediation
``` This provides defense in depth but does not replace output encoding. 6. Add regression tests using payloads containing `

T09 · Insecure Skill Coding Practices

Note
Location
scripts/nutrition_engine.py:29
Finding

Personal and Health Profile Data Is Persisted in Plaintext

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (10)

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

YARA rule 'agent_skill_mcp_tool_poisoning_metadata': MCP/tool metadata poisoning indicators in tool schemas or skill manifests [agent_skills]

High
Category
YARA Match
Confidence
80% confidence
Finding

YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Content

Scanner excerpt · scripts/html_report.py (reported line 143)May include surrounding context.

python
</div><div class="stat-label">BMI</div></div>
    </div>

    <div class="macro-bar">
        <h3>📊 三大营养素配比</h3>
        {_macro_bar_html(macros)}
    </div>

    <h2 class="section-title">📋 {len(week)}天饮食方案</h2>
    {week_html}

    <h2 class="section-title">🛒 购物清单</h2>
    <div class="shop-section">{shopping_html}</div>

    <h2 class="section-title">👨‍🍳 备餐技巧</h2>
    <div class="prep-section"><ul>{tips_html}</ul></div>

    <div class="disclaimer">
        ⚠️ <strong>免责声明:</strong>本饮食方案为AI基于通用营养学知识生成的参考建议,不构成专业医疗意见。
        如有特殊健康状况,请咨询医生或注册营养师。食物份量可根据个人饱腹感适度调整。
    </div>
</div>
</body>
</html>"""

    with open(output_path, "w", encoding="utf-8") as f:
        f.write(html)
    return output_path


def _macro_bar_html(macros):
    """生成营养素柱状条HTML"""
    pr

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file uses Chinese throughout the title, capability descriptions, commands, and disclaimer, and does not indicate that the skill is region-specific or provide an opt-in language selection. Per the policy, forcing a specific language without user choice is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger phrases are extremely broad, including common expressions like '怎么吃', '吃什么', and generic health-related terms. This can cause the skill to activate in many ordinary conversations, increasing unintended invocation, unnecessary data collection, and the chance that users receive domain-specific advice when they did not explicitly request this skill.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill states that user profile data is stored in 'user_data/profile.json' with sensitive personal and health-adjacent attributes such as age, weight, allergies, activity level, and goals, but it does not clearly tell users that retention is persistent or obtain explicit consent. In a nutrition and chronic-disease context, silent persistence increases privacy risk and could expose personal data across sessions or to other local processes depending on platform isolation.

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 description and all generated user-facing reports are written in Chinese, and the HTML templates explicitly set lang="zh-CN", indicating a fixed locale. There is no natural-language indication that users may choose another language or that the tool is intentionally limited to a China-specific audience.

Content

No source excerpt is available for this finding.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding

Suspicious Unicode normalization or mixed-script content

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This file’s title, documentation, and embedded natural-language content are all Chinese-specific, and there is no indication that users can opt into another language or that the skill is intentionally restricted to a Chinese-only audience. That creates a natural-language locale policy concern because the skill effectively forces one language by default.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The code writes a user nutrition profile to a fixed JSON file on disk without any consent flow, retention policy, access control, or minimization. Because the profile can contain sensitive health-related data such as age, weight, allergies, activity level, and health conditions, local persistence increases privacy risk if the host environment is shared, backed up, or otherwise exposed.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The module title and user-facing descriptions are entirely in Chinese, and the skill's interface strings throughout the file are Chinese-only. This can violate a language/locale policy when a skill implicitly enforces a specific language without giving the user a choice or documenting a justified locale restriction.

Content

No source excerpt is available for this finding.