Back to skill

Security audit

泉水复活

Security checks for vulnerabilities and agentic risk

Overview

This is a disclosed memory backup and restore skill, but it needs Review because crafted restore snapshots can overwrite files outside the intended workspace and sensitive memory is synced to a cloud folder by default.

Install only if you are comfortable with your QClaw memory, diary, user, identity, and agent-rule files being copied into a cloud-synced folder. Do not restore snapshots from untrusted or shared cloud locations unless the restore code is fixed to validate ZIP paths, authenticate snapshots, preview changes, and require confirmation before overwriting current files.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/memory_backup.py:159
Finding

Arbitrary File Write Through Unsafe CLI Snapshot Restoration

Content
View full analysis
10: print(f" ... 共 {len(names)} 个") return True for name in names: dst = target / name dst.parent.mkdir(parents=True, exist_ok=True) with zf.open(name) as src_f, open(dst, "wb") as dst_f: dst_f.write(src_f.read()) ``` ### Technical Analysis The restoration routine treats every ZIP member name as a safe path relative to `WORKSPACE`. It does not reject absolute paths, parent-directory components such as `../`, or paths whose canonical destination falls outside the workspace. For example, a member named `../../.ssh/authorized_keys` causes `target / name` to traverse outside `~/.qclaw/workspace`. Because the destination parent directories are created and the file is opened in write mode, the routine can overwrite any file writable by the current user. The CLI accepts a caller-provided archive path through: ```python restore_from_snapshot(Path(sys.argv[2])) ``` The archive is not authenticated or checked against a trusted manifest. In addition, each decompressed member is read completely into memory with `src_f.read()`, allowing a malicious archive to cause excessive memory consumption. ### Attack Path 1. An attacker prepares a ZIP archive containing a member such ...[truncated 1655 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/restore_gui.py:74
Finding

Arbitrary File Write Through Unsafe GUI and Cloud Snapshot Restoration

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

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The README explicitly advertises automatic cloud syncing of memory, diary, and user-information files, but it does not warn users that highly sensitive local data will be copied off-device to a third-party sync location. In the context of an AI memory/diary backup skill, this increases the risk of unintended disclosure of personal data, prompts, identities, and behavioral history through cloud compromise, misconfiguration, or shared-device exposure.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The README promotes one-click restore and disaster recovery workflows without clearly warning that restoration can overwrite current workspace files and replace newer data with older snapshots. For a memory-management skill, users may invoke restore under stress and unintentionally destroy current state, causing integrity loss or rollback of important records.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
96% confidence
Finding

The skill describes shell execution and file-writing behavior via Python backup/restore scripts and batch files, but it does not declare any tool scope or permissions boundaries. In a memory-management skill that can overwrite user files, missing explicit permissions increases the risk of unintended or overbroad execution because reviewers and runtime policy layers cannot easily constrain what the skill is allowed to do.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The restore flow instructs users to perform one-click restoration but does not warn that existing memory files may be overwritten or rolled back to an older snapshot. Because this skill targets critical files like MEMORY.md, USER.md, IDENTITY.md, diaries, and workspace rules, an uninformed restore could cause significant data loss, state corruption, or accidental replacement of current user/agent context.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script automatically copies workspace memory files and snapshots into a cloud-synced directory on the Desktop, which can exfiltrate sensitive user and agent memory to third-party storage without any explicit runtime consent, warning, or opt-in. In this skill’s context, the targeted files include diaries, identity, memory, and other persistent state, so the data is likely highly sensitive and the hardcoded sync path increases the chance of silent disclosure.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The non-interactive restore paths (restore latest and direct path restore) overwrite files in the workspace without a confirmation prompt, safety interlock, or backup of the current state. This can destroy or roll back memory data unexpectedly if invoked by mistake, by another script, or with an untrusted snapshot path, especially because the tool manages persistent memory files central to the skill’s operation.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The top-level docstring says this is a '一键还原工具 - 图形界面', which implies a restore-only GUI. However, the implementation includes backup initiation logic and a '立即备份' action, so the documentation understates and mischaracterizes the module's behavior.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The manifest and file documentation frame this component as a one-click restore tool and integrity checker, but this code also launches a separate backup engine using subprocess. Spawning another script is a stronger capability than simple restore GUI logic and is not obviously required for a restore-focused tool, even if backup exists at the overall skill level.

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 · scripts/restore_gui.py (reported line 106)May include surrounding context.

python
if not backup_py.exists():
            log_func("[错误] 备份引擎不存在,请重新安装")
            return False
        result = subprocess.run(
            [sys.executable, str(backup_py), "backup", "manual"],
            capture_output=True, text=True, encoding="utf-8"
        )

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The natural-language instructions, trigger phrases, and operational guidance are entirely in Chinese, which can amount to a forced language constraint if users are not given an opt-in or alternative. The file does not state that the skill is intentionally limited to Chinese-speaking users or provide any language selection.

Content

No source excerpt is available for this finding.