Back to skill

Security audit

Pregnant Prolonged-Standing / Over-Fatigue Detection | 孕妇久站/过度劳累识别

Security checks for vulnerabilities and agentic risk

Overview

This pregnancy video analysis skill sends sensitive media and reports to cloud services while silently reusing or creating shared identities and cached tokens, creating a real cross-user privacy risk.

Treat this as a Review item before installing. Use it only where the pregnant person has given clear consent and where the workspace is single-user or the identity-handling bug is fixed. Expect uploaded videos, network video URLs, report metadata, and cached tokens to interact with the configured cloud services and local workspace data.

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
scripts/smyx_pregnant_posture_fatigue_detection_analysis.py:53
Finding

Workspace-Wide Fallback Identity Can Cause Cross-User Access to Sensitive Reports

Content
View full analysis

Vulnerability Details

File Location: scripts/smyx_pregnant_posture_fatigue_detection_analysis.py:53-61; skills/smyx_common/scripts/util.py:423-469
Vulnerability Type: Shared fallback identity and insufficient user isolation
Risk Level: High

Complete Code Snippet

scripts/smyx_pregnant_posture_fatigue_detection_analysis.py:53-61:

python
try:
    # 初始化内部用户身份;不要求用户输入,也不在帮助信息中展示。
    OpenIdUtil.resolve_current_open_id(args.open_id, use_current=bool(args.open_id))

    # 检查必需参数
    if args.list:
        open_id = ConstantEnum.CURRENT__OPEN_ID
        result = show_analyze_list(open_id)
        print(result)

skills/smyx_common/scripts/util.py:423-469:

python
@classmethod
def get_api_key_file_open_id(cls):
    """读取工作区 data/smyx-api-key.txt 中的内部身份值。"""
    api_key_path = os.path.join(cls.get_workspace_data_dir(), "smyx-api-key.txt")
    try:
        if not os.path.exists(api_key_path):
            return None
        with open(api_key_path, "r", encoding="utf-8") as f:
            value = f.read().strip()
        return value or None
    except Exception as e:
        CommonUtil.trace_exception_stack(e)
    return None

@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

    # Extremely unlikely collisions are retried.
    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,
      
...[truncated 4339 chars]
Remediation
View remediation

Remediation Suggestions

  1. Preserve trusted upstream identity values regardless of whether the hidden CLI argument is present:

    python
    OpenIdUtil.resolve_current_open_id(
        args.open_id,
        use_current=True
    )
    
  2. Define an explicit identity precedence order:

    • authenticated upstream sender identity;
    • explicitly supplied identity from a trusted internal caller;
    • per-principal fallback identity;
    • fail closed for sensitive report queries if no authenticated identity exists.
  3. Do not use a single workspace-wide identity in multi-user environments. Namespace fallback identity and token storage by the authenticated Agent principal.

  4. Require a trusted authenticated identity for --list. Do not silently use a shared default account for access to historical reports.

  5. Pass the resolved identity explicitly through the request chain instead of relying on mutable process-global fields such as CURRENT__OPEN_ID, TOKEN, and OPEN_TOKEN.

  6. Enforce ownership and tenant isolation on the server for both analysis records and report-list endpoints. Client-provided usernames or Open IDs must not be sufficient authorization.

  7. Add multi-user tests covering:

    • two callers sharing one workspace;
    • environments that provide only OPENCLAW_SENDER_OPEN_ID;
    • report creation by one caller followed by --list from another;
    • rejection when no trusted identity is available.
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 Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (52)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This finding combines several undeclared behaviors: user identity creation/resolution, token or account management, outbound requests to remote services, and local workspace/database interaction, all while advertising a narrow pregnancy posture-analysis tool. In a highly sensitive context involving pregnant users and home video, undeclared identity and network operations create serious privacy, consent, and abuse risks.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This finding combines several undeclared behaviors: user identity creation/resolution, token or account management, outbound requests to remote services, and local workspace/database interaction, all while advertising a narrow pregnancy posture-analysis tool. In a highly sensitive context involving pregnant users and home video, undeclared identity and network operations create serious privacy, consent, and abuse risks.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This finding combines several undeclared behaviors: user identity creation/resolution, token or account management, outbound requests to remote services, and local workspace/database interaction, all while advertising a narrow pregnancy posture-analysis tool. In a highly sensitive context involving pregnant users and home video, undeclared identity and network operations create serious privacy, consent, and abuse risks.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This finding combines several undeclared behaviors: user identity creation/resolution, token or account management, outbound requests to remote services, and local workspace/database interaction, all while advertising a narrow pregnancy posture-analysis tool. In a highly sensitive context involving pregnant users and home video, undeclared identity and network operations create serious privacy, consent, and abuse risks.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This finding combines several undeclared behaviors: user identity creation/resolution, token or account management, outbound requests to remote services, and local workspace/database interaction, all while advertising a narrow pregnancy posture-analysis tool. In a highly sensitive context involving pregnant users and home video, undeclared identity and network operations create serious privacy, consent, and abuse risks.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This finding combines several undeclared behaviors: user identity creation/resolution, token or account management, outbound requests to remote services, and local workspace/database interaction, all while advertising a narrow pregnancy posture-analysis tool. In a highly sensitive context involving pregnant users and home video, undeclared identity and network operations create serious privacy, consent, and abuse risks.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding combines several undeclared behaviors: user identity creation/resolution, token or account management, outbound requests to remote services, and local workspace/database interaction, all while advertising a narrow pregnancy posture-analysis tool. In a highly sensitive context involving pregnant users and home video, undeclared identity and network operations create serious privacy, consent, and abuse risks.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding combines several undeclared behaviors: user identity creation/resolution, token or account management, outbound requests to remote services, and local workspace/database interaction, all while advertising a narrow pregnancy posture-analysis tool. In a highly sensitive context involving pregnant users and home video, undeclared identity and network operations create serious privacy, consent, and abuse risks.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding combines several undeclared behaviors: user identity creation/resolution, token or account management, outbound requests to remote services, and local workspace/database interaction, all while advertising a narrow pregnancy posture-analysis tool. In a highly sensitive context involving pregnant users and home video, undeclared identity and network operations create serious privacy, consent, and abuse risks.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This finding combines several undeclared behaviors: user identity creation/resolution, token or account management, outbound requests to remote services, and local workspace/database interaction, all while advertising a narrow pregnancy posture-analysis tool. In a highly sensitive context involving pregnant users and home video, undeclared identity and network operations create serious privacy, consent, and abuse risks.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding combines several undeclared behaviors: user identity creation/resolution, token or account management, outbound requests to remote services, and local workspace/database interaction, all while advertising a narrow pregnancy posture-analysis tool. In a highly sensitive context involving pregnant users and home video, undeclared identity and network operations create serious privacy, consent, and abuse risks.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding combines several undeclared behaviors: user identity creation/resolution, token or account management, outbound requests to remote services, and local workspace/database interaction, all while advertising a narrow pregnancy posture-analysis tool. In a highly sensitive context involving pregnant users and home video, undeclared identity and network operations create serious privacy, consent, and abuse risks.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding combines several undeclared behaviors: user identity creation/resolution, token or account management, outbound requests to remote services, and local workspace/database interaction, all while advertising a narrow pregnancy posture-analysis tool. In a highly sensitive context involving pregnant users and home video, undeclared identity and network operations create serious privacy, consent, and abuse risks.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill silently initializes, reuses, or auto-creates user identity records even though that is not justified by the stated posture-analysis purpose. Implicit identity binding is especially risky in this context because it can connect sensitive pregnancy-monitoring footage and historical reports to persistent user profiles without transparent consent.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

This utility layer automatically provisions remote user identities, requests tokens from external services, and persists those tokens locally, behavior unrelated to a camera-based posture/fatigue skill. In the context of a health-monitoring skill, this materially expands the data-handling surface and can silently bind usage to remote accounts, enabling unintended tracking, credential misuse, or backend account creation without clear user awareness.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill declares broad capabilities in documentation and references scripts that can access files, environment data, shell execution, and the network, but it does not declare any explicit tool scope or permission boundaries. In a skill that handles sensitive home-camera footage and cloud access, missing scope declarations increases the chance of over-privileged execution and abuse of local or remote resources.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The default activation rule is very broad, causing the skill to trigger on any uploaded home-camera media that appears related to the scenario. Over-broad auto-activation can lead to analysis or upload of sensitive household footage when the user may not have specifically requested this skill or understood its behavior.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill includes automatic cloud-based historical report querying and report-link retrieval beyond its primary advertised purpose of current posture/fatigue analysis and reminders. Automatic access to historical reports increases data exposure and may reveal sensitive pregnancy-related behavior patterns without sufficiently explicit user intent or consent.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The trigger phrases for history-report queries are broad enough that generic requests about reports could unintentionally activate cloud history retrieval. In a sensitive health-adjacent skill, accidental triggering can expose prior records or cause unnecessary backend access without the user's clear intent.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill is presented as analyzing a pregnant woman's posture and fatigue risk from a fixed home camera, yet the code accepts a 'pet_type' argument and assigns it to ConstantEnum.DEFAULT__PET_TYPE. This indicates the implementation is repurposed from an animal-analysis skill and does not cleanly match the claimed domain-specific behavior.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The parser description and help text claim the tool is for pregnant fatigue/posture detection, while the exposed option uses pet-oriented choices and naming. That is an active contradiction in the code's own interface documentation, not merely an omitted detail.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The user-facing argument descriptions are all presented only in Chinese, and the script later emits Chinese-only status and error messages. This imposes a specific language on users without any documented opt-in or locale selection, 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

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Several returned user-visible strings are fixed in Chinese, such as the report heading and export-link text. The file does not indicate that the skill is region-specific or provide any user opt-in or language selection, which may violate language/locale policy expectations.

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