Back to skill

Security audit

when-clock-skill

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly aligned with controlling a LAN clock, but it needs review because it can change persistent alarms and has an under-disclosed timer behavior that can replace an existing alarm.

Review before installing. Use it only with trusted WHEN/WHEN Voice clocks on a trusted LAN, verify the configured device IPs, avoid letting prompts choose arbitrary config files, and check existing alarms before using timer or delete operations. Be aware that creating a timer on a full device can replace an existing alarm.

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

T09 · Insecure Skill Coding Practices

Warning
Location
when_common.py:44
Finding

Unrestricted HTTP Target Selection Enables SSRF-Style Network Access

Content
View full analysis
dict: req = request.Request(url=url, method="GET") with request.urlopen(req, timeout=timeout) as resp: data = resp.read().decode("utf-8") payload = json.loads(data) if not isinstance(payload, dict): raise ValueError("GET response is not a JSON object") return payload def _http_json_post(url: str, body: dict, timeout: float) -> dict: req = request.Request( url=url, method="POST", data=json.dumps(body, ensure_ascii=False).encode("utf-8"), headers={"Content-Type": "application/json"}, ) with request.urlopen(req, timeout=timeout) as resp: data = resp.read().decode("utf-8") payload = json.loads(data) if not isinstance(payload, dict): raise ValueError("POST response is not a JSON object") return payload ``` ```python def _build_base_url(config: dict) -> str: ip = str(config.get("clock_ip", "")).strip() port = config.get("clock_port", 80) if not ip: raise ValueError("Clock IP is not configured") try: port_int = int(port) except (TypeError, ValueError) as exc: raise ValueError("clock_port must be an integer") from exc if not 1 <= port_int <= 65535: raise ValueError("clock_port must be between 1 and 65535") return f"http://{ip}:{port_int}" ``` ### Technical Analysis The Skill requires LAN network access to control clock devices, so HTTP communication itself is consistent with its declared purpose. However, the configured `clock_ip` is only checked for non-emptiness. It is not verified as an IP literal, restricted to an approved private subnet, or matched against an adminis ...[truncated 2156 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
when.py:362
Finding

Timer Creation Silently Overwrites an Existing Alarm When the Device Is Full

Content
View full analysis
= 10: normalized[9] = new_alarm action = "update_timer" else: normalized.append(new_alarm) action = "add_timer" ``` ### Technical Analysis A clock supports at most ten alarms. When `set_timer` is invoked and ten alarms already exist, the implementation does not reject the request or ask the caller which alarm may be replaced. It unconditionally replaces the tenth alarm with the new single-use timer. This behavior is inconsistent with `set_alarm`, which rejects attempts to add an alarm when the list is full. The user-facing documentation states that the maximum is ten alarms but does not clearly disclose that creating a timer may delete an existing alarm. Because the entire alarm list is subsequently posted back to the clock, the replacement permanently removes the prior tenth alarm from device state. ### Attack Path 1. The target clock already contains ten alarms. 2. A user or attacker with permission to invoke the Skill requests `set_timer`. 3. The Skill reads and normalizes the existing alarm list. 4. Without confirmation, the Skill assigns the timer to `normalized[9]`. 5. The Skill posts the complete modified alarm list to `/set`. 6. The original tenth alarm is lost and replaced by the one-time timer. ### Impact Assessment The issue allows an ordinary timer operation to cause unexpected destructive modification of persistent device state. Consequences include: - Loss of an important wake-up or reminder alarm. - Missed scheduled events. - Silent modification of a setting unrelated to the user's requested timer. - Repeated disruption if an attacker can invoke timer creation whenever the alarm list is full. The impact is limited to alarm configuration ...[truncated 80 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
when_common.py:44
Finding

Clock Control Traffic Uses Plaintext HTTP Without Session Authentication Support

Content
View full analysis
dict: req = request.Request(url=url, method="GET") with request.urlopen(req, timeout=timeout) as resp: data = resp.read().decode("utf-8") ``` ```python def _http_json_post(url: str, body: dict, timeout: float) -> dict: req = request.Request( url=url, method="POST", data=json.dumps(body, ensure_ascii=False).encode("utf-8"), headers={"Content-Type": "application/json"}, ) with request.urlopen(req, timeout=timeout) as resp: data = resp.read().decode("utf-8") ``` ### Technical Analysis All device communication is forced to the `http://` scheme. Requests contain no authentication token or session cookie, and the implementation does not provide a login flow. The bundled protocol documentation describes an optional login mechanism that returns a `Session-Key` cookie and recommends including that cookie in subsequent requests. The Skill does not implement this mechanism. As a result, it depends on unauthenticated plaintext LAN communication and may not work with devices configured to require login. On an untrusted or compromised local network, HTTP provides neither confidentiality nor integrity. A network-positioned attacker may observe alarm schedules, modify responses, spoof device identity, or tamper with control requests. Whether HTTPS is available depends on device firmware; if it is unavailable, the residual risk must be documented and mitigated at the network layer. ### Attack Path 1. The attacker gains access to the same LAN, a compromised access point, router, bridge, or another network position capable of observing or altering traffic. 2. The user invokes a clock operation ...[truncated 1001 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (32)

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

There is a clear description-behavior mismatch. The declared description advertises broader device control, including voice time announcement and weather broadcast, but this code explicitly raises errors for both chime and weather modes. The implemented functionality is limited to alarm CRUD and countdown timer behavior through the device's alarm API. While the description's alarm and timer claims do match the code, the unsupported announcement/weather features are significant advertised capabilities that are absent here.

Content

No source excerpt is available for this finding.

Hidden Instructions

High
Category
Prompt Injection
Confidence
60% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · README_zh.md (reported line 1)May include surrounding context.

md
---
name: when-clock-skill
description: >
  控制 WHEN/WHEN Voice 局域网时钟。支持语音报时、播报天气(仅WHEN Voice)、

Hidden Instructions

High
Category
Prompt Injection
Confidence
60% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · SKILL_zh.md (reported line 1)May include surrounding context.

md
---
name: when-clock-skill
description: >
  控制 WHEN/WHEN Voice 局域网时钟。支持语音报时、播报天气(仅WHEN Voice)、

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest description and triggers advertise voice time announcement and weather broadcast, but this file's documented behavior says those modes are unsupported and both run_announce and run_weather immediately raise errors. This is a direct description-to-behavior mismatch rather than an implementation detail.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

If alarm storage is full, timer creation overwrites an existing alarm without warning, causing destructive remote configuration changes that the user may not expect. In the context of a clock/alarm skill, this is more dangerous because overwritten alarms can correspond to wake-up, medication, or other time-sensitive reminders, creating real-world reliability and safety issues.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This markdown file documents the delete_alarm operation, which removes an alarm from the device, but it provides no warning that the action is destructive or irreversible on the target clock. Under the markdown-specific warning criteria, user-facing documentation should disclose behaviors that can affect user data or device state.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The README documents alarm deletion as a supported action but provides no warning that it is destructive and no guidance to require confirmation before execution. In an agent/voice-control context, ambiguous or misheard user input could cause irreversible removal of alarms, directly impacting reminders or wake-up schedules.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill declares a Python tool but does not constrain tool scope with explicit permissions/allowed-tools, while the documented behavior implies network access and local config file reads/writes. In an agent environment, missing scope boundaries can let the skill exercise broader file or network capabilities than users expect, increasing the blast radius if the script is modified or invoked unsafely.

Content

No source excerpt is available for this finding.

Shadow Command Trigger

Medium
Category
Trigger Abuse
Confidence
87% confidence
Finding

The trigger 'set alarm' overlaps with built-in assistant behavior and can shadow or intercept a common user command. Since this skill can write alarms to a LAN device, command ambiguity may route a generic user request to the wrong execution path and cause unintended state changes on the clock.

Content

No source excerpt is available for this finding.

Shadow Command Trigger

Medium
Category
Trigger Abuse
Confidence
85% confidence
Finding

The trigger 'delete alarm' conflicts with a common built-in command and is more sensitive because deletion is destructive. If matched unintentionally, it could remove alarms from the device without the user meaning to operate this specific skill.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Broad English triggers like 'what time is it', 'set alarm', and 'timer reminder' overlap with normal conversation and common assistant intents. Because this skill can modify device alarms and timers, accidental invocation could change device state or trigger LAN actions without the user intending to use this specific skill.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The trigger list includes broad everyday phrases such as '明天叫我起床' and '每天早上叫我', which can plausibly occur in normal conversation and unintentionally invoke a skill that performs state-changing actions on a LAN device. Because the skill can create or modify alarms, accidental activation can cause unauthorized or unexpected device changes even without explicit malicious input.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger '定时提醒' is especially generic and does not clearly bind to this specific clock skill, increasing the chance of accidental routing from ordinary reminder-related speech. Since this skill writes a one-time alarm to a device, ambiguous invocation can produce unintended reminders or overwrite user expectations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The documentation presents alarm deletion as a direct operation without any warning, confirmation guidance, or mention of irreversibility. In a voice- or agent-driven context, destructive actions on user schedules are more sensitive, and lack of explicit caution increases the risk of accidental or socially engineered deletion.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest uses Chinese-only user-facing descriptions for the mode argument, which imposes a specific language on users. The file does not indicate that the skill is region-specific or provide any opt-in or alternative language, so this is a natural-language locale policy issue.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The documentation explicitly shows that GET /get?type=2 returns the current Wi‑Fi ssid and password, which are highly sensitive credentials. In the context of an agent skill for LAN device control, exposing and normalizing credential retrieval increases the chance the skill or downstream integrations will collect, log, or disclose network secrets, especially if login protection is disabled or weakly enforced on the device.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The documentation includes action endpoints for reboot (type=21) and factory reset (type=83) without prominent safety guidance, confirmation requirements, or access-control caveats. In an automation skill, this makes destructive operations easier to invoke programmatically and could lead to denial of service, loss of configuration, or accidental device takeover/reset if exposed to untrusted prompts or weakly authenticated sessions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The documentation specifies network configuration and credential submission flows, including plaintext Wi-Fi passwords in JSON and device authentication material, without a prominent privacy/security warning near the examples. Because this skill controls LAN devices and may be used by automation agents, the omission can normalize insecure handling, logging, or transmission of sensitive credentials to devices that appear to rely on local HTTP rather than encrypted transport.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The documentation exposes destructive actions such as OTA, reboot, and factory reset, including the reset variant that can erase Wi-Fi settings, but does not place a clear warning adjacent to those operations about service interruption, data loss, or the need for explicit user confirmation. In a skill intended to control LAN clock devices, this increases the chance that an integrator or downstream agent could invoke disruptive actions without understanding their operational impact.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The module docstring states '不支持 chime/weather' and the code enforces that by rejecting those modes, which actively conflicts with the surrounding skill documentation that presents time announcement and weather broadcast as supported behaviors. This is an intent-level contradiction between documented capability and implemented behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

When the alarm list is full, setting a timer silently replaces the 10th existing alarm. In a clock/alarm-control skill, this can cause loss of important reminders or wake-up alarms without user awareness, creating integrity and safety issues in real-world use.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The module’s docstrings, comments, and user-facing error messages are written exclusively in Chinese, indicating a fixed language choice rather than offering the user a locale option. This can violate language/locale policy when no explicit opt-in or region-specific justification is provided.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The delete_alarm path removes an alarm from the device state and immediately sends the modified alarm list back via HTTP POST. Although the function prints a summary after the fact, there is no confirmation prompt, pre-action warning, or inline comment/docstring disclosing that this operation irreversibly changes device configuration.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

The edit_alarm flow changes an existing alarm and posts the updated configuration to the device, affecting persisted device behavior. The file provides only a post-action summary and does not include a pre-action disclosure, confirmation, or documentation warning that user/device data will be modified.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.