Back to skill

Security audit

Child Drowsiness / Fatigue Detection | 儿童打瞌睡/疲劳检测

Security checks for vulnerabilities and agentic risk

Overview

This skill appears intended for child fatigue analysis, but it handles highly sensitive child video through a cloud service while silently creating or reusing persistent identities and tokens.

Install only after reviewing the cloud provider, retention terms, and consent requirements for minors. Avoid shared workspaces unless identity fallback and token storage are fixed; require explicit user-controlled account linkage and history retrieval before use.

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_child_drowsiness_fatigue_detection_analysis.py:58
Finding

Shared fallback identity allows cross-user access to sensitive analysis reports

Content
View full analysis

Vulnerability Details

File Location: scripts/smyx_child_drowsiness_fatigue_detection_analysis.py:58-65; skills/smyx_common/scripts/util.py:457-469, 576-603; skills/smyx_common/scripts/dao.py:474-497
Vulnerability Type: Improper user identity isolation and authorization context confusion
Risk Level: High

Vulnerable Code

scripts/smyx_child_drowsiness_fatigue_detection_analysis.py:58-65:

python
# Initialize the internal user identity.
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)
    exit(0)

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

python
@classmethod
def resolve_current_open_id(cls, open_id=None, use_current=True):
    """Resolve and initialize the current open-id."""
    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()

    ConstantEnum.CURRENT__OPEN_ID = resolved_open_id
    if not ConstantEnum.CURRENT__USER_NAME:
        ConstantEnum.CURRENT__USER_NAME = resolved_open_id
    return resolved_open_id

skills/smyx_common/scripts/util.py:576-603:

python
if not (ApiEnum.API_SECRET_KEY or ConstantEnum.CURRENT__USER_NAME or ConstantEnum.CURRENT__OPEN_ID):
    OpenIdUtil.resolve_current_open_id(use_current=False)

current__user_name = (
    ApiEnum.API_SECRET_KEY
    or ConstantEnum.CURRENT__USER_NAME
    or ConstantEnum.CURRENT__OPEN_ID
)

found_user = None
if (not ApiEnum.TOKEN or not ApiEnum.OPEN_TOKEN) and current__user_name:
    from .dao import UserDao, User
    user_dao = UserDao()
    found_user = use
...[truncated 4063 chars]
Remediation
View remediation

Remediation Suggestions

  1. Always prefer the trusted upstream identity when resolving the current user:
python
OpenIdUtil.resolve_current_open_id(
    args.open_id,
    use_current=True
)
  1. Remove workspace-global fallback identities from multi-user deployments. If anonymous operation is necessary, generate an identity scoped to the authenticated user or isolated session rather than reusing the first default database user.

  2. Store tokens in per-user storage keyed by a trusted, authenticated upstream principal. Do not use a shared SQLite record or plaintext workspace identity file as the authorization context for unrelated users.

  3. Pass the resolved principal explicitly through analysis and history methods instead of relying on mutable process-global fields such as ConstantEnum.CURRENT__OPEN_ID and ApiEnum.TOKEN.

  4. Enforce ownership on the server for all history, polling, and report-export operations. Report IDs must be checked against the authenticated account rather than accepted as sufficient authorization.

  5. Ensure that hidden arguments such as --open-id cannot override a trusted upstream identity unless the caller is explicitly authorized to impersonate that identity.

  6. Add isolation tests that create two upstream sender identities in the same workspace and verify that:

    • Each identity receives separate cloud tokens.
    • Each identity sees only its own analysis history.
    • Report identifiers from one identity cannot be exported by the other.
    • Omitting --open-id preserves the trusted environment-derived sender identity.
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 Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (54)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill is presented as child fatigue detection from video, but the described underlying behavior includes identity resolution, history listing, generic API submission, storage, and other unrelated capabilities while lacking visible implementation of the claimed analytics. This kind of description-behavior mismatch is dangerous because it can mislead users into granting sensitive child video and identity-related data to a tool performing different or broader operations than advertised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill is presented as child fatigue detection from video, but the described underlying behavior includes identity resolution, history listing, generic API submission, storage, and other unrelated capabilities while lacking visible implementation of the claimed analytics. This kind of description-behavior mismatch is dangerous because it can mislead users into granting sensitive child video and identity-related data to a tool performing different or broader operations than advertised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill is presented as child fatigue detection from video, but the described underlying behavior includes identity resolution, history listing, generic API submission, storage, and other unrelated capabilities while lacking visible implementation of the claimed analytics. This kind of description-behavior mismatch is dangerous because it can mislead users into granting sensitive child video and identity-related data to a tool performing different or broader operations than advertised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill is presented as child fatigue detection from video, but the described underlying behavior includes identity resolution, history listing, generic API submission, storage, and other unrelated capabilities while lacking visible implementation of the claimed analytics. This kind of description-behavior mismatch is dangerous because it can mislead users into granting sensitive child video and identity-related data to a tool performing different or broader operations than advertised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill is presented as child fatigue detection from video, but the described underlying behavior includes identity resolution, history listing, generic API submission, storage, and other unrelated capabilities while lacking visible implementation of the claimed analytics. This kind of description-behavior mismatch is dangerous because it can mislead users into granting sensitive child video and identity-related data to a tool performing different or broader operations than advertised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill is presented as child fatigue detection from video, but the described underlying behavior includes identity resolution, history listing, generic API submission, storage, and other unrelated capabilities while lacking visible implementation of the claimed analytics. This kind of description-behavior mismatch is dangerous because it can mislead users into granting sensitive child video and identity-related data to a tool performing different or broader operations than advertised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill is presented as child fatigue detection from video, but the described underlying behavior includes identity resolution, history listing, generic API submission, storage, and other unrelated capabilities while lacking visible implementation of the claimed analytics. This kind of description-behavior mismatch is dangerous because it can mislead users into granting sensitive child video and identity-related data to a tool performing different or broader operations than advertised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as child fatigue detection from video, but the described underlying behavior includes identity resolution, history listing, generic API submission, storage, and other unrelated capabilities while lacking visible implementation of the claimed analytics. This kind of description-behavior mismatch is dangerous because it can mislead users into granting sensitive child video and identity-related data to a tool performing different or broader operations than advertised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as child fatigue detection from video, but the described underlying behavior includes identity resolution, history listing, generic API submission, storage, and other unrelated capabilities while lacking visible implementation of the claimed analytics. This kind of description-behavior mismatch is dangerous because it can mislead users into granting sensitive child video and identity-related data to a tool performing different or broader operations than advertised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as child fatigue detection from video, but the described underlying behavior includes identity resolution, history listing, generic API submission, storage, and other unrelated capabilities while lacking visible implementation of the claimed analytics. This kind of description-behavior mismatch is dangerous because it can mislead users into granting sensitive child video and identity-related data to a tool performing different or broader operations than advertised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as child fatigue detection from video, but the described underlying behavior includes identity resolution, history listing, generic API submission, storage, and other unrelated capabilities while lacking visible implementation of the claimed analytics. This kind of description-behavior mismatch is dangerous because it can mislead users into granting sensitive child video and identity-related data to a tool performing different or broader operations than advertised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as child fatigue detection from video, but the described underlying behavior includes identity resolution, history listing, generic API submission, storage, and other unrelated capabilities while lacking visible implementation of the claimed analytics. This kind of description-behavior mismatch is dangerous because it can mislead users into granting sensitive child video and identity-related data to a tool performing different or broader operations than advertised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as child fatigue detection from video, but the described underlying behavior includes identity resolution, history listing, generic API submission, storage, and other unrelated capabilities while lacking visible implementation of the claimed analytics. This kind of description-behavior mismatch is dangerous because it can mislead users into granting sensitive child video and identity-related data to a tool performing different or broader operations than advertised.

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: "smyx-child-drowsiness-fatigue-detection-analysis"
description: "Using a fixed camera in the classroom or above the home desk, the system analyzes the child's (student's) facial video in real time, detecting eye closure ratio (PERCLOS — the proportion of time eyes are closed more than 80% within a unit time), head-nodding frequency (rapid downward nod followed by lift), and changes in eye-region glossiness, and computes a comprehensive fatigue index (0-100). | 通过教室或家庭书桌的固定摄像头,实时分析儿童(学生)的面部视频,检测眼部闭合比例(PERCLOS,单位时间内眼睛闭合超过80%的时间占比

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill specifies automatic identity initialization, reuse, or creation behind the scenes for a child-monitoring workflow. Hidden identity provisioning is risky because it can silently link uploaded child video, analysis results, and history to persistent accounts without transparent consent or user awareness.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The model stores authentication-like tokens together with personally identifying user data such as username, real name, email, birthday, age, and sex, yet the stated purpose is classroom/home fatigue analysis for children. This creates a significant privacy and security risk because compromise of the local database would expose highly sensitive identity and token material unrelated to the claimed functionality.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

This shared utility performs remote login, token acquisition, token persistence, and authenticated HTTP requests, which is materially unrelated to the manifest's stated purpose of local child fatigue analysis from a fixed camera. That mismatch increases the likelihood of covert data flow, account coupling, and unauthorized outbound communication from a skill operating in a sensitive children's monitoring context.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The helper silently calls a remote /sys/phoneLogin endpoint with register=1 and uses openId/mobile values derived from the current username, meaning the code can auto-create or bind remote identities without clear user action. For a classroom/home drowsiness detection skill, this is unjustified and dangerous because it can enroll users into a backend system and establish persistent accounts unexpectedly.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill declares capabilities that imply shell, filesystem, environment, and network access, but it does not declare any explicit tool/permission scope. This creates an unsafe trust boundary: a reviewer or runtime may underestimate what the skill can do, while the documented workflow instructs execution of local scripts and remote API access.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest frames the skill as real-time visual fatigue analysis, but the documentation adds cloud history querying and report-link retrieval features. This scope expansion matters because it introduces access to stored records and potentially sensitive historical data about children without making that data-access behavior central and explicit in the primary description.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The history-report trigger phrases are broad enough that ordinary user requests about reports could automatically invoke cloud history retrieval. In a child-monitoring context, that increases the chance of overbroad disclosure of prior reports or account-linked records without a sufficiently explicit, scoped user request.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill states that uploaded files are automatically saved locally, but it does not pair this with a clear, prominent warning about local retention and handling of sensitive child video/images. Silent local storage of minors' biometric and behavioral data raises privacy and leakage risk, especially on shared or insufficiently secured systems.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The document describes continuous camera-based analysis of a child’s face and eye/head behaviors, which involves highly sensitive visual and biometric-like data from minors, but it provides no privacy warning, consent requirements, retention limits, or handling constraints. In the context of children in classrooms or homes, this omission is dangerous because integrators may deploy the API without adequate notice, parental authorization, minimization, or safeguards, increasing the risk of unlawful collection, surveillance misuse, and exposure of sensitive child data.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The string returned on L17 is hard-coded in Chinese ("儿童打瞌睡/疲劳检测结构化结果") with no indication that the user can choose a language or that the skill is intentionally limited to a Chinese-speaking context. This is a natural-language locale policy concern because the skill appears to impose a specific language by default.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script includes a listing function for prior analyses via show_analyze_list(open_id) and wires it to a hidden --list capability, even though the skill is presented as a real-time fatigue-analysis tool. This creates an undisclosed access path to historical analysis data, which may expose prior user activity or sensitive results if authorization checks are weak or inherited identity is misused.

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