Back to skill

Security audit

medication-clock

Security checks for vulnerabilities and agentic risk

Overview

This medication reminder skill is mostly local and purpose-aligned, but it needs Review because its tests can alter real medication records and its metadata grants broad command execution authority.

Before installing, review or remove execute_command permission, avoid running test_system.py or test_system.py --cleanup against your real profile, and treat all records and CSV exports as sensitive health data stored under ~/.openclaw/medication_data. Expect to configure reminders manually unless the OpenClaw cron integration is completed and scoped.

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
test_system.py:146
Finding

Test Suite Modifies and Can Erase Production Medication Records

Content
View full analysis
Remediation
View remediation
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
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (30)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The code generally matches the medication-tracking, statistics, and data-export aspects of the description. It stores records, computes adherence metrics, generates reports, and exports CSV data. However, the key advertised capability—automatic daily 6:30 reminders—is not actually implemented in this code chunk. There is no scheduler, cron integration, background loop, system notification call, or messaging trigger; only a function that generates reminder text. This is a material description-to-behavior mismatch because the primary reminder behavior is presented as active/automatic, while the code is mainly a local record/report CLI tool with configurable reminder settings but no execution mechanism for reminders.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

总体上代码与“优甲乐服药提醒、统计、数据导出”这一核心用途大体相关,但声明并不完全准确。代码不仅做每日提醒,还实现了完整的命令驱动型交互系统,包括启停提醒、手动/当前时间记录服药、状态查询、报告生成、记录浏览、设置查看、测试提醒,以及命令行入口 __main__ 与外部命令处理函数 handle_medication_command。此外,帮助文本明确说明数据会存储在本地目录 ~/.openclaw/medication_data/,这属于持久化能力,声明中未提及。最明显的不一致是声明的触发器为空,而代码实际围绕命令触发运行。因此应判定为存在描述与行为不完全匹配。

Content

No source excerpt is available for this finding.

File System Enumeration

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.

Content

Scanner excerpt · README.md (reported line 173)May include surrounding context.

tail -f /tmp/openclaw/openclaw-*.log

查看数据目录

ls -la ~/.openclaw/medication_data/

text

## 📈 统计指标说明

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill declares capabilities that imply file read/write and shell-backed behavior, but it does not explicitly scope or constrain those tools in the manifest. In a health-related skill that persists medication data, missing tool/permission declarations weakens the trust boundary and can allow broader-than-expected local file or command access if the runtime grants defaults.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill handles sensitive health and medication-adherence data and states that it automatically creates persistent local data files, but it does not present a clear warning or consent-oriented disclosure to users. In a medical context, silent local persistence increases privacy risk because users may not realize protected health information is being stored and retained on disk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The guide encourages exporting medication records and sharing them with a doctor, but it does not warn that these records are sensitive health data. Users may export files to insecure locations or transmit them through unencrypted channels, increasing the chance of unintended disclosure of personal medical information.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The trigger word "甲状腺" is a broad medical topic rather than a specific invocation phrase. Mentioning thyroid-related issues in ordinary health discussion could unintentionally match this skill without clearly signaling a reminder or medication-tracking intent.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest grants execute_command to a medication reminder and record-tracking skill even though the stated functionality only requires reminders, file I/O, and report generation. Unnecessary shell access materially expands the attack surface: if any downstream prompt, file content, or user-controlled data reaches command execution, the skill could run arbitrary OS commands, exposing or altering local data.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The module docstring and function docstring indicate the skill generates reminder messages in Chinese, and the fallback reminder strings are also only in Chinese. For an all-file-types policy check, this is a natural-language locale restriction with no user opt-in or documented justification that the skill is region- or language-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file-level description and all user-facing strings are written exclusively in Chinese, indicating the skill is designed to operate in a single language without any user opt-in or language selection mechanism. This matches a natural-language policy concern because the skill implicitly forces a locale/language choice rather than offering flexibility or documenting a justified regional constraint.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest describes '每日6:30提醒' and an intelligent reminder system, which implies the skill itself performs reminder delivery at that time. In code, the closest implementation only formats reminder messages as strings, while the CLI offers recording, status, reporting, and export functions but no scheduler, timer, or outbound notification mechanism.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module title and descriptions are entirely in Chinese and present the skill as a general-purpose reminder generator, with no indication that Chinese is optional or that the skill is limited to a Chinese-speaking or region-specific context. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The Feishu message explicitly tells users to reply with the Chinese phrase "服药了" alongside one command variant, making Chinese the default interaction language. Because the skill does not offer a user language preference or explain a justified locale limitation, this violates the language/locale policy.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

These user-facing instructions tell the recipient how to confirm medication intake entirely in Chinese except for one command token. The file presents no mechanism for selecting another language and no justification that the skill is region- or language-specific, so this is a policy violation.

Content

No source excerpt is available for this finding.

Dynamic import via __import__()

Medium
Category
Dangerous Code Execution
Confidence
75% confidence
Finding

Dynamic import() can load arbitrary modules at runtime, bypassing static analysis and potentially importing malicious code.

Content

Scanner excerpt · mobile_reminder.py (reported line 195)May include surrounding context.

python
"message": message,
            "reminder_count": args.count,
            "channel": args.channel,
            "timestamp": __import__("datetime").datetime.now().isoformat()
        }
        print(json.dumps(info, ensure_ascii=False), file=sys.stderr)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest’s natural-language fields, including the top-level description, command description, examples, and reminder message, are all Chinese-only. Under the policy rule, forcing a specific language without user opt-in or a documented regional justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The module docstring and all user-facing strings are written exclusively in Chinese, indicating the skill is designed to operate in a fixed language. The file does not provide any user opt-in, locale selection, or justification that this is a region-specific tool, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The inline help states that reminders repeat every 15 minutes until the user confirms, which describes active reminder delivery behavior. In this file, scheduling is explicitly noted as unimplemented and the code only toggles a setting and generates sample/reminder text, so the documentation overstates what the code does.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The documentation asserts support for two notification channels, implying external delivery integrations. However, the code in this file only returns text response dictionaries and contains no Feishu or WeChat API calls or adapters, so the comment materially misrepresents implemented capabilities.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This Python file contains user-facing descriptions and console instructions in Chinese from the module docstring onward, and all later prompts/messages are likewise fixed to that language. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is clearly documented and justified, which it is not here.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · setup.py (reported line 15)May include surrounding context.

python
def check_openclaw_installed():
    """检查 OpenClaw 是否已安装"""
    try:
        result = subprocess.run(
            ["openclaw", "--version"],
            capture_output=True,
            text=True,

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This Python file contains user-facing natural-language text entirely in Chinese, beginning with the module description. Under the policy rule, forcing a specific language without opt-in is a locale-policy violation unless the file documents that the skill is region-specific or offers a language choice, which it does not.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The cleanup routine operates on the real user data directory under ~/.openclaw/medication_data, backs it up, then overwrites medication-records.json and stats.json with empty/reset contents. In a medication adherence skill, altering historical dosing and adherence data is security-relevant because it can destroy integrity of health records, mislead users about missed or taken doses, and affect downstream reporting.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

Natural-language policy violations include forcing a specific language without user opt-in. Here, the description, title, and operating instructions are all presented only in Chinese, with no indication that the user can select another language or that the skill is intentionally limited to a Chinese-speaking audience.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The entire user guide forces a single language/locale presentation without any indication of user choice or a justified region-specific constraint. This matches the policy category for language or locale restrictions that are not opt-in or documented as necessary.

Content

No source excerpt is available for this finding.