Back to skill

Security audit

What At Home(家里有什么)

Security checks for vulnerabilities and agentic risk

Overview

This is a local home-inventory skill whose file storage, delete, backup, restore, and export behavior is disclosed and purpose-aligned, though users should handle deletes, restores, and exported inventory files carefully.

Install only if you are comfortable keeping a plaintext list of household items and locations in the OpenClaw workspace. Use explicit inventory wording for delete and restore commands, keep backups private, and review exported JSON files before placing them in shared or synced folders.

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/home_storage.py:36
Finding

Household inventory and backup files are created without restrictive permissions

Content
View full analysis

Vulnerability Details

File Location: scripts/home_storage.py:36-39, scripts/home_storage.py:664-680, scripts/home_storage.py:705-709, scripts/home_storage.py:726-729
Vulnerability Type: Sensitive data stored with process-default filesystem permissions
Risk Level: Medium

Vulnerable Code

Main inventory storage at scripts/home_storage.py:36-39:

python
def save_data(data: dict) -> None:
    """保存数据"""
    os.makedirs(os.path.dirname(DATA_FILE), exist_ok=True)
    with open(DATA_FILE, 'w', encoding='utf-8') as f:
        json.dump(data, f, ensure_ascii=False, indent=2)

Backup creation at scripts/home_storage.py:664-680:

python
def cmd_backup() -> str:
    """备份数据"""
    data = load_data()
    if not data.get("suites"):
        return "❌ 当前没有数据,无需备份"
    
    os.makedirs(BACKUP_DIR, exist_ok=True)
    timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
    backup_file = os.path.join(BACKUP_DIR, f"home_storage_{timestamp}.json")
    
    with open(backup_file, 'w', encoding='utf-8') as f:
        json.dump(data, f, ensure_ascii=False, indent=2)
    
    backups = [f for f in os.listdir(BACKUP_DIR) if f.startswith("home_storage_") and f.endswith(".json")]
    return f"✅ 备份成功!\n📁 文件:{backup_file}\n📊 当前共有 {len(backups)} 个备份"

Pre-restore backup creation at scripts/home_storage.py:705-709:

python
current = load_data()
if current.get("suites"):
    pre_backup = os.path.join(BACKUP_DIR, f"pre_restore_{datetime.now().strftime('%Y%m%d_%H%M%S')}.json")
    with open(pre_backup, 'w', encoding='utf-8') as f:
        json.dump(current, f, ensure_ascii=False, indent=2)

JSON export creation at scripts/home_storage.py:726-729:

python
export_file = os.path.join(BACKUP_DIR, f"export_{datetime.now().strftime('%Y%m%d_%H%M%S')}.json")
with open(export_file, 'w', encoding='utf-8') as f:
    json.dump(data, f, ensure_ascii=False, indent
...[truncated 2553 chars]
Remediation
View remediation

Remediation Suggestions

  1. Create the data and backup directories with owner-only permissions and correct existing directory modes:

    python
    DATA_FILE.parent.mkdir(parents=True, exist_ok=True, mode=0o700)
    BACKUP_DIR.mkdir(parents=True, exist_ok=True, mode=0o700)
    os.chmod(DATA_FILE.parent, 0o700)
    os.chmod(BACKUP_DIR, 0o700)
    
  2. Create new files explicitly with mode 0600 rather than relying on the process umask:

    python
    fd = os.open(
        path,
        os.O_WRONLY | os.O_CREAT | os.O_TRUNC,
        0o600,
    )
    with os.fdopen(fd, "w", encoding="utf-8") as f:
        json.dump(data, f, ensure_ascii=False, indent=2)
    
  3. Apply os.chmod(path, 0o600) to existing main, backup, pre-restore, and export files because opening an existing file does not necessarily replace its prior permissions.

  4. Centralize JSON writing in one secure helper and use it for save_data(), cmd_backup(), cmd_restore(), and cmd_export() so every inventory copy receives the same protection.

  5. Prefer atomic writes: write to an owner-only temporary file in the same protected directory, flush and synchronize it, then replace the destination with os.replace().

  6. Add automated tests that run under a permissive umask and verify that all generated directories have mode 0700 and all generated inventory files have mode 0600.

Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (17)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The restore feature is inherently destructive because restoring a backup can overwrite the current inventory state, yet the README gives no warning or safeguard language. Users may invoke restore assuming it is reversible or non-destructive, leading to large-scale loss of newer records.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The keyword list includes broad natural-language phrases such as “找东西”, “家里有什么”, and “东西放在哪”, which are common everyday expressions rather than narrowly scoped invocation triggers. The document does not provide activation constraints or exclusion examples, so these phrases could cause unintended skill invocation in ordinary conversation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The documentation advertises destructive operations such as deleting items without warning users about permanence, confirmation, or recovery. In a home inventory context, accidental or misunderstood deletion can cause data loss and undermine backups or record-keeping, especially if users assume conversational commands are reversible.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The README documents deletion commands without any warning that they permanently remove inventory records. In a skill built around casual natural-language commands, lack of destructive-action warnings makes accidental data loss more likely, especially given the broad delete phrasing elsewhere in the file.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger phrase "Find {keyword}" is extremely generic and overlaps with ordinary assistant usage, which can cause the skill to activate for unrelated user requests. In a natural-language command environment, that ambiguity can misroute user intent and expose or manipulate inventory data when the user did not mean to invoke this skill.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The command "Delete {item}" is broad enough to collide with many normal assistant requests, but here it maps directly to destructive state changes. Because it removes stored inventory records, accidental invocation could cause unintended data loss without the user realizing they are operating inside this skill.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

"Throw away {item}" is common conversational language and can easily be interpreted as a general-life request rather than an inventory command. Since the documented behavior is deletion of stored records, this ambiguity increases the chance of unintended destructive actions and silent inventory inconsistencies.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README documents a restore command but does not warn that restoring from a backup can overwrite current inventory data. In a household inventory skill, users may reasonably expect recovery behavior rather than destructive replacement, which increases the risk of accidental data loss from normal use.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill description and command set expose delete, restore, backup, and export behaviors on a persisted file, but do not clearly warn users that these operations modify or revert durable household data. This increases the risk of unsafe use, user surprise, and accidental rollback or overwrite of inventory state.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The query/search trigger examples are broad natural-language phrases such as “我的XXX在哪?” and “找一下手机”, which closely overlap with ordinary conversation. In an agent setting, this can cause unintended invocation from ambient or unrelated user text and lead to retrieval of persisted household inventory data without clear user intent.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Deletion is triggered by vague phrases like “删除XXX” and especially “把遥控器扔了”, which are easy to say in ordinary conversation but map to destructive state changes. Because the skill persists data, an accidental or injected utterance could remove inventory records with no strong scope checks or confirmation requirement.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The delete command removes the first matching item immediately based on partial-name matching and persists the change without any confirmation or disambiguation. In a stateful storage-management skill, this makes accidental or ambiguous deletion easy, which can corrupt inventory records and be triggered by imprecise input.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The restore command replaces the active data store with backup contents immediately after validating the file path, with no user-facing confirmation, dry-run summary, or safeguard against accidental invocation. In this skill’s context, the data file is the primary state for the household inventory, so an unintended restore can silently roll back or overwrite recent changes and cause integrity loss.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The file presents all instructions and example commands exclusively in Chinese, which may impose a language constraint on users without any opt-in or documented locale requirement. Under the language policy criteria, a forced language without explicit choice or justification can be a natural-language policy issue.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The documentation mentions backup and export features but does not warn that potentially sensitive household inventory data and item locations will be written to files on disk. If those files are stored in shared, synced, or weakly protected locations, they could expose private information about possessions and where they are kept.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The README advertises data export without warning that potentially sensitive household inventory and location data will be written to a file. While this is expected functionality, lack of disclosure can cause users to unknowingly create plaintext artifacts that persist on disk and may be exposed through backups, sharing, or local compromise.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The docstring and all user-facing strings in the file are exclusively in Chinese, which effectively enforces a single language for interaction. The file does not offer any language selection, fallback, or documented justification for restricting the skill to one locale.

Content

No source excerpt is available for this finding.