Back to skill

Security audit

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

Security checks for vulnerabilities and agentic risk

Overview

ClawScan marks this sleep-analysis skill suspicious because scanners report privacy, credential-handling, and purpose-scope concerns; the scan is partial, so its evidence is incomplete.

Treat this as a review-required skill, not as a confirmed malicious one. Before installing, consider whether you are comfortable with the reported account creation, token storage, and possible external transfer of sensitive sleep media; the scan is partial because it reports a missing local reference.

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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/sleep_quality_analysis.py
Finding

Trusted sender identity is discarded in favor of a workspace-shared account

Content
View full analysis

Impact

Under the stated shared-workspace configuration, one sender can receive another sender's sleep-analysis history. New analyses are also attributed to the shared account. This account-selection flaw does not require bypassing remote API authorization.

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 (25)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

Generic formatting, polling, and API helpers could support a sleep-monitoring skill and are not independently mismatches. However, this code also implements substantial, undeclared account provisioning and credential-handling behavior. RequestUtil can silently register or log in an identity at /sys/phoneLogin, save returned user information and tokens, and send authentication headers to supplied absolute URLs. Those capabilities go materially beyond the stated sleep-analysis purpose. This finding concerns the supplied chunk; it does not establish whether other files implement sleep monitoring or whether these methods are invoked.

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 classification, physiological-signal processing, movement analysis, awakening detection, or apnea monitoring. Its concrete functionality centers on managing user records in a local database. Database access can support a sleep-monitoring skill, but this chunk exposes user and token management without any demonstrated connection to the declared sleep functions. The mismatch applies to the supplied code; it does not establish that the full skill lacks sleep-analysis functionality or that the database operations are malicious.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The supplied chunk does not implement the declared sleep-analysis purpose. Its only substantive method is an incomplete generic agent-chat helper; it does not actually execute an agent command. Imported base classes and services could provide additional behavior, but their implementations are not supplied, so they cannot establish the claimed sleep-monitoring capabilities.

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.25"
license: "MIT-0"
---

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

---

## 🧭 技能概览 | Ov

The analysis workflow lacks a privacy warning before sending sensitive sleep-monitoring input to an external API.

High
Category
Output Handling
Confidence
94% confidence
Finding

The workflow directs automatic analysis of local monitoring videos without a clear pre-upload disclosure or consent step for external processing. Although API use is mentioned elsewhere, bedroom footage and inferred health information warrant explicit notice before crossing that trust boundary.

Content

No source excerpt is available for this finding.

The generic request helper attaches service credentials to arbitrary absolute URLs.

High
Category
Excessive Agency
Confidence
99% confidence
Finding

The helper accepts arbitrary absolute HTTP or HTTPS URLs and then adds service tokens and the API key without validating the destination. If a caller can influence the URL, credentials and added identity metadata can be sent to an attacker-controlled host; allowing HTTP also exposes them to interception.

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.

Generic report-history phrases automatically trigger sleep-report retrieval without requiring sleep-specific context.

Medium
Category
Trigger Abuse
Confidence
94% confidence
Finding

Generic requests such as viewing historical reports automatically trigger retrieval and display of sleep-health records without establishing sleep-specific intent. In an unrelated conversation or shared interface, this can unnecessarily expose sensitive health information.

Content

No source excerpt is available for this finding.

The --export-env-only option promises not to perform analysis, but execution ignores it and still invokes analysis.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

The parser accepts --export-env-only and promises not to analyze, but execution never checks the flag. When combined with valid input, it still initializes identity and invokes analysis, potentially transmitting sensitive sleep footage despite the caller's explicit no-analysis choice.

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 to the analysis API without disclosure that their contents will be transmitted.

Medium
Category
Output Handling
Confidence
96% confidence
Finding

The method reads the entire local input into a multipart payload and passes it to the analysis API without any visible disclosure or consent gate. Sleep-monitoring videos can reveal intimate surroundings, identities, and health information, making an unexpected external upload particularly consequential.

Content

No source excerpt is available for this finding.

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

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

The --export-env-only flag is parsed but never consulted, so supplying it with valid input still reaches the video-analysis call. This violates the explicit no-analysis promise and can cause an unintended external transfer of sensitive monitoring footage.

Content

No source excerpt is available for this finding.

The save() method is documented as creating a new record, but can silently overwrite an existing user instead.

Medium
Category
Excessive Agency
Confidence
96% confidence
Finding

Any insertion exception triggers updates by ID and then by username or realname, copying fields that include identity and authentication tokens. A conflicting incoming model can therefore overwrite another record rather than fail creation; ambiguous realname matching further increases the risk of identity corruption in a health-data workflow.

Content

No source excerpt is available for this finding.

ai_chat documents an OpenClaw agent invocation, but the implementation never invokes the agent or returns an analysis result.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

The docstring at L26 claims this method calls openclaw agent through subprocess, but the entire invocation is commented out at L61–L66. Instead, L68 creates an empty dictionary and L70 accesses its nonexistent stderr attribute; the resulting exception is caught, so the method returns None without performing the documented analysis.

Content

No source excerpt is available for this finding.

FileUtil.open silently truncates existing files without disclosing its write-only behavior.

Medium
Category
Output Handling
Confidence
97% confidence
Finding

Opening a path with mode 'w' immediately truncates an existing file, even before any content is written. This generic open helper has no docstring, comment, confirmation, or operation-specific log explaining that destructive behavior; exception reporting does not disclose successful truncation.

Content

No source excerpt is available for this finding.

Sleep-analysis requests can silently register a remote account and persist its identity and tokens.

Medium
Category
Excessive Agency
Confidence
94% confidence
Finding

The generic request path can invoke phoneLogin with silent registration enabled, transmit the resolved identity, and persist returned identity details and tokens without a separate enrollment step. Remote account creation and durable credential storage are consequential side effects, particularly for a sleep-monitoring skill handling sensitive personal information.

Content

No source excerpt is available for this finding.

HTTP requests can silently register a remote user and persist returned authentication tokens locally.

Medium
Category
Output Handling
Confidence
94% confidence
Finding

An ordinary HTTP helper can silently register a remote user and save returned authentication tokens locally. This duplicates the SDI-1 issue: hidden enrollment and credential persistence exceed the expected scope of a request operation and create privacy and credential-retention risks.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
90% confidence
Finding

This POST transmits the resolved username as both openId and mobile to a remote login endpoint and requests silent registration. External networking is not inherently unsafe, but this automatic identity transmission is part of the undisclosed enrollment issue; the payload shown contains identity metadata, not sleep measurements.

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"):

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

Low
Category
Output Handling
Confidence
96% confidence
Finding

YamlUtil.load creates parent directories and writes a configuration file when the requested path is absent, without a comment, docstring, prompt, or log disclosing this side effect. BaseEnum.init_subclass invokes this loader during class definition (L052–L058), so merely importing the module can modify the filesystem.

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 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/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/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