Back to skill

Security audit

QClaw Restart

Security checks for vulnerabilities and agentic risk

Overview

This skill is meant to restart QClaw, but it can run a PowerShell script from the workspace without verifying that the script is the intended one.

Review this skill before installing. It is not trying to hide its restart behavior, but you should only use it in workspaces you trust, expect the current QClaw session to be interrupted, and prefer a version that regenerates or verifies the restart script before every run instead of reusing any existing workspace file.

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
SKILL.md:24
Finding

Unverified Workspace Script Execution with PowerShell Policy Bypass

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 24-30
Vulnerability Type: Execution of an unverified workspace script
Risk Level: Medium

Vulnerable Code

powershell
powershell -ExecutionPolicy Bypass -File "<workspace>\restart-qclaw.ps1"

The surrounding instructions specify that the script is created only if it does not already exist. Consequently, an existing restart-qclaw.ps1 is executed without validating its origin, contents, ownership, or integrity.

Technical Analysis

The workspace is treated as a trusted code source even though workspace files may be writable or replaceable by other users, processes, downloaded project content, or previously invoked tools. If an attacker places or modifies restart-qclaw.ps1, the Skill will execute that content when an approved restart is performed.

The use of -ExecutionPolicy Bypass removes a PowerShell policy safeguard that might otherwise warn about or block certain scripts. It does not itself grant administrative privileges or bypass operating-system access controls, but it increases the reliability of executing attacker-controlled PowerShell content.

User confirmation mitigates accidental execution but does not address script integrity because the user is asked to approve a QClaw restart, not arbitrary commands contained in the workspace script.

Attack Path

  1. An attacker or compromised process obtains write access to the configured workspace.
  2. The attacker creates or replaces restart-qclaw.ps1 with malicious PowerShell commands.
  3. A QClaw restart is requested after a configuration change or through ordinary user interaction.
  4. The user confirms the apparently legitimate restart request.
  5. Because the script already exists, the Skill does not regenerate it from the documented trusted template.
  6. PowerShell executes the attacker-controlled script with execution policy bypassed.
  7. The payload runs with the permis ...[truncated 715 chars]
Remediation
View remediation

Remediation Suggestions

  1. Do not execute an existing workspace script merely because it has the expected filename.
  2. Generate the restart script from fixed, trusted content immediately before each execution, using an atomic write operation.
  3. Alternatively, store the script in a protected application directory and verify its cryptographic hash or digital signature before execution.
  4. Refuse execution if the script is a symbolic link, reparse point, or file owned or writable by an unexpected principal.
  5. Avoid -ExecutionPolicy Bypass. Use an appropriately signed script and a restrictive execution policy where operationally possible.
  6. Keep the user confirmation requirement, but disclose the exact validated script path and integrity status before execution.
  7. Apply least-privilege permissions to the script and its parent directory, and execute the restart without administrative elevation unless explicitly required.
  8. Record integrity-check failures and abort rather than falling back to unverified workspace content.
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (3)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill instructions and user-facing confirmation text are entirely in Chinese, which effectively forces a specific language experience. There is no indication that the user can choose another language or that the language restriction is a documented, justified locale requirement.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger phrases include broad natural-language inputs such as '重启一下' and especially '重启你自己', which can overlap with ordinary conversation and be interpreted ambiguously by an agent. This increases the chance of accidental invocation of a disruptive restart action, causing avoidable interruption of the application or user session.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill states that user confirmation is mandatory before restarting, but the operational instructions immediately provide an executable restart command and auto-create script logic without any enforced confirmation gate. In an agent setting, this mismatch can lead to unintended application restarts, session interruption, and possible data loss if the agent follows the executable instructions instead of the prose requirement.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.