Back to skill

Security audit

Mental Health Analysis Tool | 心理健康分析工具

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its mental-health video analysis purpose, but it silently creates or reuses persistent cloud identities and stores authentication tokens while processing highly sensitive media and report history.

Review before installing, especially in shared or multi-user workspaces. Use it only if users knowingly consent to sending video or URL content to the remote service and understand that reports may be tied to a persistent local/cloud identity with locally stored tokens. Avoid using the history-report feature unless per-user identity isolation is guaranteed.

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

T05 · Unauthorized Access and Privilege Escalation

Error
Location
skills/smyx_common/scripts/util.py:426
Finding

Shared Fallback Identity Enables Cross-User Access to Sensitive Psychological Reports

Content
View full analysis

Vulnerability Details

File Location: skills/smyx_common/scripts/util.py:426-455
Vulnerability Type: Improper user isolation through a workspace-wide fallback identity
Risk Level: High

Relevant supporting locations:

  • skills/smyx_common/scripts/util.py:389-400
  • scripts/psychology_analysis.py:175-181
  • skills/smyx_analysis/scripts/skill.py:140-166
  • skills/smyx_common/scripts/dao.py:482-498

Vulnerable code:

python
@classmethod
def get_or_create_default_open_id(cls):
    from .dao import UserDao, User
    import uuid

    user_dao = UserDao()
    user = user_dao.get_first_default_user(
        cls.DEFAULT_PREFIX,
        cls.DEFAULT_USERNAME_LENGTH
    )
    if user and user.username:
        return user.username

    for _ in range(10):
        username = cls.generate_default_open_id()
        if user_dao.get_by_username(username):
            continue
        now = datetime.now()
        user = User(
            id=uuid.uuid4().hex,
            username=username,
            realname=username,
            source=ConstantEnum.APP__SOURCE,
            del_flag=0,
            create_time=now,
            update_time=now
        )
        user_dao.add(user)
        return username

    raise RuntimeError("Failed to generate a default open-id")
python
@classmethod
def resolve_current_open_id(cls, open_id=None, use_current=True):
    resolved_open_id = (
        (open_id or "").strip()
        if isinstance(open_id, str)
        else open_id
    )
    if not resolved_open_id and use_current:
        resolved_open_id = (
            ConstantEnum.CURRENT__OPEN_ID
            or ConstantEnum.CURRENT__USER_NAME
        )
    if not resolved_open_id:
        resolved_open_id = cls.get_api_key_file_open_id()
    if not resolved_open_id:
        resolved_open_id = cls.get_or_create_default_open_id()

    ConstantEnu
...[truncated 3999 chars]
Remediation
View remediation

Remediation Suggestions

  1. Require a verified, per-request upstream sender identity for all analysis and historical-report operations in multi-user deployments.
  2. Fail closed when a trustworthy sender identity is unavailable instead of silently selecting the first fallback database account.
  3. Scope fallback identities to a single authenticated user or isolated single-user installation; never share one fallback identity across unrelated callers.
  4. Bind cached API tokens to both the authenticated sender and tenant. Do not retrieve tokens solely by a workspace-global default username.
  5. Pass the authenticated identity through the entire call chain and enforce report ownership on the server for listing, result retrieval, and export endpoints.
  6. Do not rely on hidden CLI arguments as an authorization mechanism. Accept identity only from a trusted integration channel and reject user-controlled identity overrides.
  7. Add explicit tests covering two different users in the same workspace and verify that neither can list, retrieve, or export the other user’s reports.
  8. Migrate existing shared fallback data into separately owned accounts or require affected users to reauthenticate before historical reports can be accessed.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
Findings (48)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The reported use of authenticated HTTP clients, automatic remote account creation, local identity/open-id generation and persistence, reading credential-like local files, and filesystem discovery is far broader than the declared purpose. For a mental-health skill, undisclosed identity linkage and credential handling are particularly dangerous because they can tie sensitive psychological reports to persistent accounts and local secrets.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The reported use of authenticated HTTP clients, automatic remote account creation, local identity/open-id generation and persistence, reading credential-like local files, and filesystem discovery is far broader than the declared purpose. For a mental-health skill, undisclosed identity linkage and credential handling are particularly dangerous because they can tie sensitive psychological reports to persistent accounts and local secrets.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The reported use of authenticated HTTP clients, automatic remote account creation, local identity/open-id generation and persistence, reading credential-like local files, and filesystem discovery is far broader than the declared purpose. For a mental-health skill, undisclosed identity linkage and credential handling are particularly dangerous because they can tie sensitive psychological reports to persistent accounts and local secrets.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The reported use of authenticated HTTP clients, automatic remote account creation, local identity/open-id generation and persistence, reading credential-like local files, and filesystem discovery is far broader than the declared purpose. For a mental-health skill, undisclosed identity linkage and credential handling are particularly dangerous because they can tie sensitive psychological reports to persistent accounts and local secrets.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The reported use of authenticated HTTP clients, automatic remote account creation, local identity/open-id generation and persistence, reading credential-like local files, and filesystem discovery is far broader than the declared purpose. For a mental-health skill, undisclosed identity linkage and credential handling are particularly dangerous because they can tie sensitive psychological reports to persistent accounts and local secrets.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The reported use of authenticated HTTP clients, automatic remote account creation, local identity/open-id generation and persistence, reading credential-like local files, and filesystem discovery is far broader than the declared purpose. For a mental-health skill, undisclosed identity linkage and credential handling are particularly dangerous because they can tie sensitive psychological reports to persistent accounts and local secrets.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The reported use of authenticated HTTP clients, automatic remote account creation, local identity/open-id generation and persistence, reading credential-like local files, and filesystem discovery is far broader than the declared purpose. For a mental-health skill, undisclosed identity linkage and credential handling are particularly dangerous because they can tie sensitive psychological reports to persistent accounts and local secrets.

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 · SKILL.md (reported line 3)May include surrounding context.

md
---
name: "psychology-analysis"
description: "Analyzes human mental health and psychological behavior, supports identifying common psychological problem tendencies through video analysis, and provides structured mental health analysis reports and improvement suggestions. | 心理健康分析工具,针对人的心理健康和心理行为进行分析,支持通过视频分析识别常见心理问题倾向,提供结构化心理健康分析报告和改善建议"
version: "1.0.18"
license: "MIT-0"
---

# 🧠 Mental Health Analysis Tool | 心理健康分析工具
> **智能分析中枢** · 图片/视频智能分析 · 结�

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill sends user media and report queries to cloud/API services but omits a clear privacy warning and consent flow. In a mental-health setting, transmitting videos, inferred conditions, and report metadata off-device without explicit disclosure creates significant confidentiality, regulatory, and trust risks.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The tool sends highly sensitive video content for psychological analysis and also ties processing to a resolved user identity, but provides no explicit privacy notice, consent prompt, or data-handling disclosure before transmission. In a mental-health context, undisclosed transfer of biometric and psychological data is especially dangerous because it can expose intimate personal information and create compliance, confidentiality, and trust risks.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

This file exposes a generic API client that can issue arbitrary GET/POST/PUT/DELETE requests and perform broad CRUD-style operations unrelated to the declared psychology/video-analysis purpose. In a skill context, this significantly expands the attack surface: any higher-level prompt flow or compromised caller could repurpose the skill as a general network-capable proxy to access or modify remote resources beyond the intended domain.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill includes unjustified remote modification capabilities via add, edit, delete, POST, PUT, and DELETE helpers without any visible limitation to mental-health analysis workflows. Because the manifest describes an analysis/reporting tool, enabling arbitrary state-changing network actions is dangerous: it could allow unauthorized data alteration, destructive operations, or abuse of connected backend systems if invoked by an attacker or misused by the agent.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

This utility silently derives, creates, and persists user identities unrelated to the stated psychology-analysis purpose, including reading an identity from a local file and creating fallback local accounts. In a mental-health skill context, hidden identity initialization is especially sensitive because users may reasonably expect analysis functions, not undisclosed account binding and persistent identifier management.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The HTTP helper performs login/registration behavior, fetches tokens, and stores them locally as part of ordinary request handling, which exceeds the apparent scope of a psychology-analysis skill utility. Because this occurs automatically and can transmit identifiers and tokens to external services, it creates a significant privacy and account-security risk, especially for sensitive mental-health workflows.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill advertises and instructs use of shell, file, network, and environment-dependent capabilities but does not declare any explicit tool scope or permissions boundary. That creates an over-privileged integration risk: an agent may grant broad execution/file/network access to satisfy the workflow, increasing blast radius if the skill or its companion scripts behave unexpectedly or maliciously.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The default trigger rule activates on broadly phrased requests involving uploaded media and psychological analysis, which can cause the skill to run in situations the user did not clearly consent to. Because the skill handles sensitive media and mental-health inference, ambiguous activation increases the risk of inappropriate processing and data transfer.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The history-report trigger uses broad everyday phrases that can inadvertently expose a user's mental-health report list when they intended something else. In this domain, accidental retrieval of linked historical reports is privacy-sensitive and may reveal highly confidential information.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill states that uploaded files are automatically saved locally, but it does not clearly warn the user about local retention, storage location, duration, or access controls. For sensitive video/images used for mental-health inference, undisclosed local persistence increases privacy exposure and forensic residue risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

User-facing strings throughout the script, including errors, prompts, and reports, are written in Chinese with no option to select another language. This creates a natural-language locale policy issue because the skill imposes a specific language without user opt-in or an explicit documented justification for being China/Chinese-only.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script initializes and uses a hidden internal identity via OpenIdUtil.resolve_current_open_id and then relies on ConstantEnum.CURRENT__OPEN_ID for listing prior analyses, despite this behavior not being part of the user-facing psychological analysis purpose. Hidden identity resolution increases the risk of unauthorized access to another user's analysis history or silent linkage of sensitive mental-health processing to an internal account context.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The script writes sensitive psychological analysis results to an arbitrary output path without warning about persistence, overwriting, or the confidentiality of the saved data. Mental-health assessments are highly sensitive, so silently storing them can lead to unintended exposure through shared machines, backups, weak file permissions, or accidental overwrite of important files.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The returned user-facing string is hard-coded as Chinese ('心理健康分析结构化结果'). This imposes a specific language on all users without any opt-in, fallback, or documented region-specific justification, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · skills/smyx_analysis/scripts/skill.py (reported line 28)May include surrounding context.

python
result_json = JsonUtil.parse(result_json_pure_text, result_json_pure_text)

        result_json_common_ai_response = result_json.get("commonAiResponse") if isinstance(result_json,
                                                                                           dict) else result_json
        if result_json_common_ai_response:
            result_json = result_json_common_ai_response

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · skills/smyx_analysis/scripts/skill.py (reported line 33)May include surrounding context.

python
result_json = JsonUtil.parse(result_json_pure_text, result_json_pure_text)

        result_json_common_ai_response = result_json.get("commonAiResponse") if isinstance(result_json,
                                                                                           dict) else result_json
        if result_json_common_ai_response:
            result_json = result_json_common_ai_response

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill accepts either a local file path or a remote video URL and then forwards the full video content or external URL to an analysis service without any user-facing notice, consent prompt, or data-handling disclosure in this code path. Because the skill processes highly sensitive mental-health video data, silent transmission to a backend materially increases privacy and compliance risk, especially if users may not realize biometric, behavioral, or psychological inferences are being sent off-device.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.install_untrusted_source

Install source points to URL shortener or raw IP.

Warn
Code
suspicious.install_untrusted_source
Location
skills/smyx_common/scripts/config-dev.yaml:2