Back to skill

Security audit

Sleep Quality Analysis Skill | 睡眠质量分析技能

Security checks for vulnerabilities and agentic risk

Overview

ClawScan rates this sleep quality analysis skill suspicious because scanners report privacy, credential-handling, and purpose-alignment concerns; the evidence is incomplete because one referenced local path was missing.

Consider avoiding installation until the developer clearly explains remote processing and account creation, documents what data and credentials are sent or stored, and addresses the reported URL and environment-only behavior. The overall scan completed, but its analysis was marked partial because a referenced local path was missing, so the evidence is not complete.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
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
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (24)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The supplied chunk contains no sleep-stage classification, movement analysis, awakening detection, apnea detection, or sleep-sensor processing. Its concrete functionality centers on local user-account persistence: initializing a database, migrating the sys_user table, and reading, updating, or deleting records. Database access can be a supporting implementation detail, but this chunk implements account-management capabilities with no visible connection to the declared sleep-analysis purpose. This assessment is limited to the supplied chunk; it does not establish what other skill components do or indicate malicious behavior.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The supplied chunk contains no sleep-stage analysis or monitoring logic. Generic formatting, polling, and filesystem helpers could support the declared skill, and their presence alone would not establish a mismatch. However, this code also implements substantive identity provisioning, credential access and persistence, remote account registration, and billing-related behavior not disclosed by the sleep-monitoring description. The HTTP wrapper also accepts absolute destinations while attaching configured credentials, without a visible destination restriction. These findings concern capabilities present in this chunk; they do not establish that other parts of the skill lack sleep-analysis functionality.

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: "sleep-quality-analysis"
description: "Identifies sleep stages including falling asleep, light sleep, deep sleep, and REM; monitors body movement, nighttime awakenings, and sleep apnea, suitable for sleep monitoring scenarios. | 睡眠质量分析技能,识别入睡、浅睡、深睡、快速眼动阶段,监测体动、夜间觉醒、睡眠呼吸暂停,适用于睡眠监测场景"
version: "1.0.24"
license: "MIT-0"
---

# 😴 Sleep Quality Analysis Skill | 睡眠质量分析技能
> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询

---

## 🧭 技能概览 | Ov

The HTTP helper attaches service credentials and user identity to unrestricted absolute URLs.

High
Category
Excessive Agency
Confidence
99% confidence
Finding

The helper accepts arbitrary absolute HTTP or HTTPS URLs and attaches service tokens, an API key, and user identity without checking the destination. If an untrusted value reaches the URL parameter, credentials and potentially sensitive sleep-related payloads can be sent to an attacker-controlled host; HTTP destinations additionally expose them in transit.

Content

No source excerpt is available for this finding.

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: env, file_read, file_write, network, shell.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

The analysis workflow lacks a privacy warning about remote processing of sensitive sleep recordings.

Medium
Category
Output Handling
Confidence
91% confidence
Finding

The workflow directs analysis of local bedroom recordings without clearly warning that their contents will be transmitted to a remote service. References to API usage and cloud report history do not clearly establish informed authorization to upload potentially intimate video and health data.

Content

No source excerpt is available for this finding.

The documented environment-only mode still executes sleep analysis.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

The parser accepts --export-env-only and explicitly promises not to analyze, but execution never checks that flag. With an input supplied, the program still calls the analysis workflow, potentially transmitting a sensitive sleep recording despite the caller selecting a non-analysis mode.

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 = result_json_common_ai_response

        result_json_health_ai_response = result_json.get("healthAiResponse") if isinstance(result_json,
                                                                                           dict) else result_json
        if result_json_health_ai_response:
            result_json = result_json_health_ai_response

Local input files are passed in full to the analysis API without disclosure that their contents will be transmitted.

Medium
Category
Output Handling
Confidence
94% confidence
Finding

The local-file branch reads the entire recording into memory and passes it as a file payload to the analysis service without an authorization check for remote processing. In a sleep-monitoring context, this creates a material privacy risk because recordings can reveal intimate surroundings, other people, and health information.

Content

No source excerpt is available for this finding.

The --export-env-only option promises not to execute analysis, but does not prevent it.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

The environment-only option is parsed but never used to change control flow. When an input is provided, analysis proceeds despite the explicit promise not to execute it, potentially causing an unintended upload of private video.

Content

No source excerpt is available for this finding.

The documented create operation silently falls back to overwriting existing user records.

Medium
Category
Excessive Agency
Confidence
94% confidence
Finding

save catches every insertion failure and then attempts to overwrite an existing record by ID or username/realname, copying fields that include credentials and identity information. A conflicting supplied model can therefore turn an expected creation into a destructive update; the sleep-monitoring context increases the consequences of associating activity with the wrong account, although external attacker reachability is not established here.

Content

No source excerpt is available for this finding.

ai_chat documents invoking an analysis agent, but its execution path never invokes the agent or returns analysis.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

The docstring at L26–L34 promises a subprocess call to the OpenClaw agent and an analysis result or session ID. However, command construction and subprocess execution are commented out (L48–L66); the replacement empty dictionary at L68 causes the attribute access at L70 to raise an exception, which is caught without returning a result. This contradicts the documented analysis behavior rather than merely omitting an implementation detail.

Content

No source excerpt is available for this finding.

FileUtil.open silently creates or truncates the target file.

Medium
Category
Output Handling
Confidence
96% confidence
Finding

L101 opens the supplied path in write mode, immediately erasing existing contents before any write occurs. The generically named helper has no docstring, comment, confirmation, or action log disclosing this destructive behavior; exception tracing does not disclose successful truncation.

Content

No source excerpt is available for this finding.

Sleep-analysis requests can silently register a remote user and persist account credentials.

Medium
Category
Excessive Agency
Confidence
97% confidence
Finding

An ordinary request can invoke phoneLogin with silent registration enabled, transmit the current identity, and save returned tokens through UserDao without an explicit enrollment step. These hidden account and credential-persistence side effects exceed simple sleep analysis and are particularly sensitive for a health-related service.

Content

No source excerpt is available for this finding.

An ordinary HTTP request can silently trigger remote login or registration using the current identity.

Medium
Category
Output Handling
Confidence
92% confidence
Finding

The HTTP wrapper automatically calls a login endpoint with 'silent': 1 and 'register': 1 when credentials are missing. This couples routine requests to remote account creation and identity disclosure without a separate authorization decision, which is an inappropriate hidden side effect for sleep analysis.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
87% confidence
Finding

This POST transmits the current identity as both openId and mobile to a configured remote login/registration endpoint. External transmission is not inherently malicious, but here it implements the automatic enrollment behavior without a visible consent gate; the source does not establish an attacker-controlled destination or transmission of sleep measurements at this particular call.

Content

Scanner excerpt · skills/smyx_common/scripts/util.py (reported line 561)May include surrounding context.

python
"source": ConstantEnum.DEFAULT__SKILL_HUB_NAME
            }
            try:
                _response = requests.post(_url, json=_data)
                if _response.status_code == 200:
                    _response_json = _response.json()
                    if _response_json and _response_json.get("success"):

Generic report-history phrases automatically trigger sleep-report queries without a sleep-specific context requirement.

Low
Category
Trigger Abuse
Confidence
96% confidence
Finding

Generic requests such as viewing historical reports automatically trigger a sleep-report API query without requiring sleep-specific context. This can retrieve and display sensitive health information when the user intended an unrelated report history.

Content

No source excerpt is available for this finding.

Configuration loading silently creates directories and files, including during module import.

Low
Category
Output Handling
Confidence
91% confidence
Finding

YamlUtil.load creates the parent directory and writes a YAML file when the requested configuration is missing, without a comment, docstring, log, or confirmation disclosing that side effect. BaseEnum.init_subclass invokes this loader during class creation (L044–L058), so importing the module can modify the filesystem even when no save operation was requested.

Content

No source excerpt is available for this finding.

Dynamic attribute access via getattr()

Low
Category
Dangerous Code Execution
Confidence
50% confidence
Finding

Dynamic getattr() with a non-literal attribute name can access arbitrary object attributes, potentially bypassing access controls.

Content

Scanner excerpt · skills/smyx_common/scripts/dao.py (reported line 243)May include surrounding context.

python
username = getattr(model, "username", None)
            if username:
                column_names = self.__model__.__table__.columns.keys()
                update_data = {key: getattr(model, key) for key in column_names if key != "username"}
                return self.update_by_username(username, **update_data)

            return None

Dynamic attribute access via getattr()

Low
Category
Dangerous Code Execution
Confidence
50% confidence
Finding

Dynamic getattr() with a non-literal attribute name can access arbitrary object attributes, potentially bypassing access controls.

Content

Scanner excerpt · skills/smyx_common/scripts/dao.py (reported line 353)May include surrounding context.

python
column_names = self.__model__.__table__.columns.keys()

            for key in column_names:
                value = getattr(model, key)
                setattr(instance, key, value)

            session.commit()

Dynamic attribute access via getattr()

Low
Category
Dangerous Code Execution
Confidence
50% confidence
Finding

Dynamic getattr() with a non-literal attribute name can access arbitrary object attributes, potentially bypassing access controls.

Content

Scanner excerpt · skills/smyx_common/scripts/dao.py (reported line 326)May include surrounding context.

python
if filters:
                for key, value in filters.items():
                    query = query.filter(getattr(self.__model__, key) == value)

            if offset:
                query = query.offset(offset)

Dynamic attribute access via getattr()

Low
Category
Dangerous Code Execution
Confidence
50% confidence
Finding

Dynamic getattr() with a non-literal attribute name can access arbitrary object attributes, potentially bypassing access controls.

Content

Scanner excerpt · skills/smyx_common/scripts/dao.py (reported line 441)May include surrounding context.

python
if filters:
                for key, value in filters.items():
                    query = query.filter(getattr(self.__model__, key) == value)

            return query.scalar()
        finally:

Dynamic attribute access via getattr()

Low
Category
Dangerous Code Execution
Confidence
50% confidence
Finding

Dynamic getattr() with a non-literal attribute name can access arbitrary object attributes, potentially bypassing access controls.

Content

Scanner excerpt · skills/smyx_common/scripts/util.py (reported line 30)May include surrounding context.

python
elif isinstance(cur, dict):
                        cur = cur.get(part, default)
                    else:
                        cur = getattr(cur, part)
                return cur
            except Exception:
                return default