Back to skill

Security audit

Living-Alone Sleep Rhythm Anomaly Analysis | 独居者作息规律异常分析

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly coherent for cloud-based sleep-rhythm video analysis, but it handles highly private home footage and persists/reuses internal identity tokens in a way that can mix reports across users in shared workspaces.

Install only in a trusted, single-user workspace unless the identity handling is fixed. Use it only with explicit consent from the monitored person, understand that video/report data is sent to cloud services, and require clear retention, deletion, sharing, and authorization controls before using it for real care workflows.

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_living_alone_rhythm_anomaly_analysis.py:56
Finding
Workspace-Wide Fallback Identity Can Expose Reports Across Users## Vulnerability Details **File Location**: `scripts/smyx_living_alone_rhythm_anomaly_analysis.py:56-62`; supporting identity resolution in `skills/smyx_common/scripts/util.py:458-469` **Vulnerability Type**: Improper user identity isolation and cross-user data access **Risk Level**: High ### Vulnerable Code `scripts/smyx_living_alone_rhythm_anomaly_analysis.py:56-62`: ```python # 初始化内部用户身份;不要求用户输入,也不在帮助信息中展示。 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:458-469`: ```python @classmethod def resolve_current_open_id(cls, open_id=None, use_current=True): """解析并初始化当前 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 ``` ### Technical Analysis The command-line entry point passes `use_current=bool(args.open_id)`. In the normal documented workflow, the hidden `--open-id` argument is omitted, making `use_current` false. As a result, `resolve_current_open_id()` skips the identity already loaded into `ConstantEnum.CURRENT__OPEN_ID` from the authenticated sender environment. The resolver instead reads the workspace-wide `data/smyx-api-key.txt` value or reuses the first generated `User_*` record from the shared SQLite database. When no ...[truncated 2383 chars]
Remediation
## Remediation Suggestions 1. Always prefer the authenticated sender identity when initializing the current user: ```python OpenIdUtil.resolve_current_open_id(args.open_id, use_current=True) ``` 2. In multi-user deployments, reject analysis and history operations when no authenticated sender identity is available instead of silently using a workspace-wide account. 3. If anonymous fallback operation is required, derive and store fallback identities per authenticated sender or tenant rather than selecting the first `User_*` record in a shared database. 4. Bind locally cached tokens to both the authenticated sender and tenant. Do not look up tokens solely through a workspace-global fallback username. 5. Enforce ownership and tenant authorization on the server for every analysis, polling, export, and history-list request. Do not rely only on the client-provided `pnaUserName`. 6. Add multi-user isolation tests covering: - Two different sender open IDs in one workspace. - Missing `--open-id`. - Missing sender username. - History queries after each user uploads a report. - Attempts to retrieve or export another sender's report ID. 7. Migrate existing shared fallback records carefully. Require an administrator or authenticated owner to assign existing reports to the correct account rather than exposing them through the legacy shared identity.
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
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (54)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
Authenticated external API calls, automatic user/open-id generation, local file operations, and token/user persistence represent a substantial identity and data-handling surface not apparent from the top-level description. Because the skill handles bedroom/living-room footage and report history, hidden identity lifecycle and storage behaviors materially raise privacy and misuse risks.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
Authenticated external API calls, automatic user/open-id generation, local file operations, and token/user persistence represent a substantial identity and data-handling surface not apparent from the top-level description. Because the skill handles bedroom/living-room footage and report history, hidden identity lifecycle and storage behaviors materially raise privacy and misuse risks.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
Authenticated external API calls, automatic user/open-id generation, local file operations, and token/user persistence represent a substantial identity and data-handling surface not apparent from the top-level description. Because the skill handles bedroom/living-room footage and report history, hidden identity lifecycle and storage behaviors materially raise privacy and misuse risks.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
Authenticated external API calls, automatic user/open-id generation, local file operations, and token/user persistence represent a substantial identity and data-handling surface not apparent from the top-level description. Because the skill handles bedroom/living-room footage and report history, hidden identity lifecycle and storage behaviors materially raise privacy and misuse risks.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
Authenticated external API calls, automatic user/open-id generation, local file operations, and token/user persistence represent a substantial identity and data-handling surface not apparent from the top-level description. Because the skill handles bedroom/living-room footage and report history, hidden identity lifecycle and storage behaviors materially raise privacy and misuse risks.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
Authenticated external API calls, automatic user/open-id generation, local file operations, and token/user persistence represent a substantial identity and data-handling surface not apparent from the top-level description. Because the skill handles bedroom/living-room footage and report history, hidden identity lifecycle and storage behaviors materially raise privacy and misuse risks.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
Authenticated external API calls, automatic user/open-id generation, local file operations, and token/user persistence represent a substantial identity and data-handling surface not apparent from the top-level description. Because the skill handles bedroom/living-room footage and report history, hidden identity lifecycle and storage behaviors materially raise privacy and misuse risks.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
Authenticated external API calls, automatic user/open-id generation, local file operations, and token/user persistence represent a substantial identity and data-handling surface not apparent from the top-level description. Because the skill handles bedroom/living-room footage and report history, hidden identity lifecycle and storage behaviors materially raise privacy and misuse risks.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
Authenticated external API calls, automatic user/open-id generation, local file operations, and token/user persistence represent a substantial identity and data-handling surface not apparent from the top-level description. Because the skill handles bedroom/living-room footage and report history, hidden identity lifecycle and storage behaviors materially raise privacy and misuse risks.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
Authenticated external API calls, automatic user/open-id generation, local file operations, and token/user persistence represent a substantial identity and data-handling surface not apparent from the top-level description. Because the skill handles bedroom/living-room footage and report history, hidden identity lifecycle and storage behaviors materially raise privacy and misuse risks.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
Authenticated external API calls, automatic user/open-id generation, local file operations, and token/user persistence represent a substantial identity and data-handling surface not apparent from the top-level description. Because the skill handles bedroom/living-room footage and report history, hidden identity lifecycle and storage behaviors materially raise privacy and misuse risks.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
Authenticated external API calls, automatic user/open-id generation, local file operations, and token/user persistence represent a substantial identity and data-handling surface not apparent from the top-level description. Because the skill handles bedroom/living-room footage and report history, hidden identity lifecycle and storage behaviors materially raise privacy and misuse risks.

Missing User Warnings

High
Confidence
92% confidence
Finding
The skill involves continuous bedroom/living-room monitoring and app reminders but does not foreground the privacy implications of analyzing and potentially transmitting highly sensitive night video. Given the intimate setting and health-adjacent inferences, insufficiently prominent warning and consent language increases the risk of uninformed or inappropriate deployment.

Context-Inappropriate Capability

High
Confidence
97% confidence
Finding
Automatic internal identity provisioning and reuse of a default local user are not justified by the stated purpose and can silently bind intimate monitoring data to a persistent account context without explicit consent. This is especially dangerous for a skill processing in-home night video, because misbinding or silent account reuse could expose one person's reports to another session or operator.

Description-Behavior Mismatch

High
Confidence
97% confidence
Finding
The utility layer performs remote account provisioning, token acquisition, token persistence, and authenticated HTTP requests that are unrelated to the declared purpose of local night-video rhythm anomaly detection. In a privacy-sensitive camera skill, hidden identity bootstrapping and network egress materially expand the trust boundary and create risk of unauthorized data transmission, account misuse, and covert backend dependency.

Lp3

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding
The skill documents capabilities that imply shell execution, network access, file reads/writes, and environment access, but it does not declare any explicit tool scope or permission boundaries. In a skill that handles private bedroom/living-room video and cloud report retrieval, this lack of least-privilege constraints increases the risk of overbroad access or misuse if the skill or its backing scripts behave unexpectedly.

Description-Behavior Mismatch

Medium
Confidence
90% confidence
Finding
The manifest presents the skill as visual rhythm-anomaly analysis, but the documented behavior extends into cloud-based history retrieval and app/report-link workflows. This discrepancy is risky because users may not realize their sensitive home-monitoring data participates in broader cloud reporting and distribution flows.

Vague Triggers

Medium
Confidence
90% confidence
Finding
A broad default trigger that activates whenever any night video URL or file is provided can cause the skill to process sensitive media without sufficiently specific user intent. In this context, accidental invocation may upload or analyze private in-home footage unexpectedly.

Vague Triggers

Medium
Confidence
91% confidence
Finding
An overly broad keyword-based auto-trigger for history lookup may retrieve sensitive historical care-monitoring reports when the user did not clearly authorize that action. Because those reports may reveal behavioral patterns and health-adjacent inferences, unintended retrieval is a meaningful privacy risk.

Intent-Code Divergence

Medium
Confidence
84% confidence
Finding
The documentation says local memory/history must not be used for report retrieval, yet it also describes reuse of a default local user and local state for report association. That contradiction can mislead reviewers and users about what local state influences access to sensitive historical reports.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The API includes full report export capabilities and the document describes alerting family members, but it does not define authorization checks, recipient consent, or disclosure rules for sharing sensitive behavioral surveillance results. That creates a real risk of unauthorized disclosure of intimate household activity patterns, especially given the subject is a person living alone and the reports may reveal sleep habits, nighttime movement, and inferred wellbeing changes.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The document specifies continuous overnight monitoring in highly private in-home spaces such as bedrooms and living rooms, including low-light/infrared capture after lights-off, but does not include any explicit user-facing consent, privacy notice, retention limits, or restrictions on secondary use. In this context, the omission is dangerous because the system processes intimate behavioral data about a person living alone, creating significant privacy, surveillance, and misuse risks even if the technical function is legitimate.

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
The method returns a fixed Chinese-language heading (`独居者作息规律异常分析结构化结果`) with no indication that the user can choose or override the language. This creates a natural-language locale policy concern because the skill appears to enforce a specific language in its output.

Description-Behavior Mismatch

Medium
Confidence
92% confidence
Finding
The script exposes a list-retrieval path tied to an internal user identity via `--list` and `show_analyze_list(open_id)`, which is outside the stated single-video analysis purpose. In a surveillance context involving bedroom/living-room nighttime footage, this creates an unnecessary data-access capability that could expose historical analyses for a user and expands the attack surface beyond least privilege.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
This code file processes highly sensitive personal footage, including bedroom/living-room nighttime video and activity-pattern analysis, but the CLI help text only describes functionality and does not disclose privacy implications or how the data may be handled. Under the code-file criteria, safety-relevant operations involving user data should include some user-facing warning or disclosure.

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