Back to skill

Security audit

Elderly Sleep Nightmare / Startle Detection | 老年人睡眠中间惊醒/梦魇行为识别

Security checks for vulnerabilities and agentic risk

Overview

This skill handles very sensitive bedroom sleep video/audio and silently uses cloud accounts, stored tokens, and historical report access in ways users should review before installing.

Review this skill carefully before installing. It is meant for highly sensitive bedroom monitoring, sends analysis work to configured cloud services, can query historical reports, and silently creates or reuses an internal account with locally stored tokens. Install only if the monitored person has given informed consent, the cloud provider and retention policy are acceptable, and account identity handling is fixed or clearly controlled by the platform.

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_elderly_nightmare_startle_detect_analysis.py:45
Finding

Caller-Controlled Identity Can Be Exchanged for Account Access Tokens

Content
View full analysis

Vulnerability Details

File Location: scripts/smyx_elderly_nightmare_startle_detect_analysis.py:45-60; skills/smyx_common/scripts/util.py:458-471, 548-612
Vulnerability Type: Authentication and account impersonation flaw
Risk Level: High

Vulnerable Code

The command-line entry point accepts a hidden identity argument and passes it directly into the identity resolver:

python
parser.add_argument("--open-id", required=False, help=argparse.SUPPRESS)
python
# Initialize the internal user identity.
OpenIdUtil.resolve_current_open_id(args.open_id, use_current=bool(args.open_id))

The resolver accepts the supplied value without authenticating its ownership:

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

The resulting identity is then submitted to a silent login or registration endpoint:

python
def _get_or_create_user(username):
    _url = ApiEnum.BASE_URL_HEALTH + "/sys/phoneLogin"
    open_id = username
    _data = {
        "silent": 1,
        "register": 1,
        "openId": open_id,
        "mobile": username,
        "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
...[truncated 3786 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove --open-id from all caller-accessible command-line interfaces. Hiding it with argparse.SUPPRESS is not an access control.
  2. Obtain the current identity exclusively from an authenticated platform context rather than from command-line input, content extracted from a user request, or a mutable local file.
  3. Require a server-issued, signed identity assertion that binds the account identifier to the authenticated caller, intended Skill, and current session.
  4. Change the login API so that possession of an openId or username alone can never produce account credentials. Require an established authenticated session, signed platform token, or explicit ownership challenge.
  5. Disable automatic silent registration when accessing existing accounts. Account creation and account login should use separate endpoints and authorization policies.
  6. On the server, derive report ownership from the validated access token rather than accepting client-selected usernames or identity fields as authorization inputs.
  7. Reject requests when the identity from the trusted platform context conflicts with any identity supplied by the client.
  8. Do not persist returned tokens until identity ownership and token scope have been verified. Store necessary credentials using operating-system-protected secret storage and restrictive file permissions.
  9. Revoke tokens previously created through identifier-only silent login and review access logs for requests that switched among unrelated identities.
  10. Add security tests proving that supplying another user’s identifier cannot obtain tokens, list reports, retrieve export links, or create analysis records for that user.
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 (59)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This is the clearest mismatch: the skill claims specific bedroom video/audio event detection, but the detected behaviors include undeclared external network communication, identity resolution/creation, token handling, and local workspace/database access unrelated to the stated monitoring task. Because the subject matter involves highly sensitive in-home surveillance of elderly people, those extra capabilities substantially increase privacy and abuse risk if granted under misleading pretenses.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This is the clearest mismatch: the skill claims specific bedroom video/audio event detection, but the detected behaviors include undeclared external network communication, identity resolution/creation, token handling, and local workspace/database access unrelated to the stated monitoring task. Because the subject matter involves highly sensitive in-home surveillance of elderly people, those extra capabilities substantially increase privacy and abuse risk if granted under misleading pretenses.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This is the clearest mismatch: the skill claims specific bedroom video/audio event detection, but the detected behaviors include undeclared external network communication, identity resolution/creation, token handling, and local workspace/database access unrelated to the stated monitoring task. Because the subject matter involves highly sensitive in-home surveillance of elderly people, those extra capabilities substantially increase privacy and abuse risk if granted under misleading pretenses.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This is the clearest mismatch: the skill claims specific bedroom video/audio event detection, but the detected behaviors include undeclared external network communication, identity resolution/creation, token handling, and local workspace/database access unrelated to the stated monitoring task. Because the subject matter involves highly sensitive in-home surveillance of elderly people, those extra capabilities substantially increase privacy and abuse risk if granted under misleading pretenses.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This is the clearest mismatch: the skill claims specific bedroom video/audio event detection, but the detected behaviors include undeclared external network communication, identity resolution/creation, token handling, and local workspace/database access unrelated to the stated monitoring task. Because the subject matter involves highly sensitive in-home surveillance of elderly people, those extra capabilities substantially increase privacy and abuse risk if granted under misleading pretenses.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This is the clearest mismatch: the skill claims specific bedroom video/audio event detection, but the detected behaviors include undeclared external network communication, identity resolution/creation, token handling, and local workspace/database access unrelated to the stated monitoring task. Because the subject matter involves highly sensitive in-home surveillance of elderly people, those extra capabilities substantially increase privacy and abuse risk if granted under misleading pretenses.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This is the clearest mismatch: the skill claims specific bedroom video/audio event detection, but the detected behaviors include undeclared external network communication, identity resolution/creation, token handling, and local workspace/database access unrelated to the stated monitoring task. Because the subject matter involves highly sensitive in-home surveillance of elderly people, those extra capabilities substantially increase privacy and abuse risk if granted under misleading pretenses.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This is the clearest mismatch: the skill claims specific bedroom video/audio event detection, but the detected behaviors include undeclared external network communication, identity resolution/creation, token handling, and local workspace/database access unrelated to the stated monitoring task. Because the subject matter involves highly sensitive in-home surveillance of elderly people, those extra capabilities substantially increase privacy and abuse risk if granted under misleading pretenses.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This is the clearest mismatch: the skill claims specific bedroom video/audio event detection, but the detected behaviors include undeclared external network communication, identity resolution/creation, token handling, and local workspace/database access unrelated to the stated monitoring task. Because the subject matter involves highly sensitive in-home surveillance of elderly people, those extra capabilities substantially increase privacy and abuse risk if granted under misleading pretenses.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This is the clearest mismatch: the skill claims specific bedroom video/audio event detection, but the detected behaviors include undeclared external network communication, identity resolution/creation, token handling, and local workspace/database access unrelated to the stated monitoring task. Because the subject matter involves highly sensitive in-home surveillance of elderly people, those extra capabilities substantially increase privacy and abuse risk if granted under misleading pretenses.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This is the clearest mismatch: the skill claims specific bedroom video/audio event detection, but the detected behaviors include undeclared external network communication, identity resolution/creation, token handling, and local workspace/database access unrelated to the stated monitoring task. Because the subject matter involves highly sensitive in-home surveillance of elderly people, those extra capabilities substantially increase privacy and abuse risk if granted under misleading pretenses.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This is the clearest mismatch: the skill claims specific bedroom video/audio event detection, but the detected behaviors include undeclared external network communication, identity resolution/creation, token handling, and local workspace/database access unrelated to the stated monitoring task. Because the subject matter involves highly sensitive in-home surveillance of elderly people, those extra capabilities substantially increase privacy and abuse risk if granted under misleading pretenses.

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-elderly-nightmare-startle-detect-analysis"
description: "Using a fixed bedroom camera (infrared night vision + microphone), the system analyzes elderly nighttime sleep video and detects abnormal events such as sudden sitting-up (quick lying-to-sitting transition), screams (high-pitched short cries), and arm-thrashing (purposeless rapid arm movements), and records the occurrence time, frequency and duration of each event. | 通过卧室固定摄像头(红外夜视),分析老年人夜间睡眠视频,检测突然坐起(快速从躺卧变为坐立)、惊叫声音(高频短促叫声)以及挥舞手臂(无目的性的快速

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill handles highly sensitive bedroom night-vision video and microphone audio of elderly individuals, yet the description does not clearly warn that this data may be transmitted to remote/cloud services. That omission is especially dangerous because users may unknowingly expose intimate in-home surveillance data, with serious privacy, consent, and regulatory consequences if the service is breached or misused.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

This file exposes a generic API wrapper with broad request capabilities that go well beyond the skill’s declared purpose of passive sleep-event detection. In a skill intended only to analyze bedroom video/audio and report events, arbitrary outbound API access materially expands the attack surface and could enable unauthorized data exfiltration, remote command-and-control style integrations, or misuse of the skill as a general network client.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
93% confidence
Finding

The add, edit, and delete methods provide remote state-changing capabilities that are not justified by the manifest’s passive monitoring function. In the context of a system handling sensitive elderly bedroom monitoring data, unnecessary write/delete actions increase the risk of tampering with records, destroying evidence of incidents, or using the skill to alter unrelated remote resources.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

This code reads a local identity file, generates default platform identities, and persists user records/tokens even when the caller did not explicitly provide an identity. For a sleep-monitoring skill, automatic identity creation and persistence is unnecessary and dangerous because it can silently enroll users into external services and create long-lived access artifacts without informed consent.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The utility layer performs authenticated outbound API requests, automatic token handling, and user/account bootstrap behavior that are unrelated to the declared purpose of local elderly sleep-event detection. In this context, hidden external communication materially increases privacy and supply-chain risk because sensitive user/event metadata may be transmitted off-device without clear necessity or disclosure.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill declares no explicit tool/permission scope while the documented behavior includes shell execution, local file handling, environment access, network access, and file writes. In an agent setting, this broad undeclared capability weakens reviewability and least-privilege controls, making it easier for a seemingly narrow healthcare skill to perform unrelated or risky actions.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation expands a media-analysis skill into cloud history-report querying and report-link retrieval, which broadens access from current-input processing to historical sensitive records. In a sleep-monitoring context, this increases confidentiality risk because prior reports may reveal longitudinal health-adjacent patterns and timestamps.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

Overly broad trigger phrases for history-report retrieval can cause unintended automatic invocation of access to prior sensitive records. In this context, even accidental retrieval is harmful because historical bedroom-monitoring reports are privacy-sensitive and may expose health-adjacent behavioral patterns.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The documentation is internally inconsistent: it prohibits long-term storage of raw nighttime video while also instructing automatic local saving of uploaded files. Contradictory storage guidance around highly sensitive bedroom recordings often leads to accidental over-retention and weak operational controls.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Automatic creation or reuse of an internal default user identity is not justified by the stated analysis purpose and can silently bind sensitive reports to the wrong account or a shared fallback identity. In a healthcare-adjacent monitoring scenario, that can lead to cross-user data exposure, unauthorized access to historical reports, or poor auditability.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The returned user-facing string is hard-coded in Chinese: "📊 老年人睡眠中间惊醒/梦魇行为识别结构化结果". This imposes a specific language/locale in the skill output without any visible opt-in, language selection, or documented region-specific justification, which matches the natural-language locale policy violation criteria.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script exposes a --pet-type parameter and mutates ConstantEnum.DEFAULT__PET_TYPE even though the stated skill is for elderly sleep-event detection, not pet analysis. This kind of cross-domain capability mismatch is dangerous because it indicates code reuse from another skill, increasing the risk of unintended behavior, misrouting data, or invoking backend logic not appropriate for sensitive human bedroom-monitoring data.

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