Back to skill

Security audit

Qclaw Result Checker

Security checks for vulnerabilities and agentic risk

Overview

This skill is meant to check WorkBuddy task results, but it needs review because it can expose prior task details and paths, and it gives an unsafe shell command pattern for user-supplied task IDs.

Install only if you are comfortable with this skill revealing prior WorkBuddy task content in the current chat. Prefer narrowing triggers to explicit QClaw/WorkBuddy requests, requiring a task ID or confirmation before showing full results, redacting file paths by default, and validating task IDs before running the local queue command.

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

Error
Location
SKILL.md:28
Finding

Command Injection Through an Unsanitized Task Identifier

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, line 28; duplicated at line 47
Vulnerability Type: OS command injection
Risk Level: High

Vulnerable Code

bash
python3 ~/.workbuddy/skills/qclaw-workbuddy-bridge/scripts/qclaw_queue.py result <task_id>

Technical Analysis

The skill instructs the agent to insert a task identifier supplied by the user directly into a shell command. It does not require validation, quoting, escaping, or execution through an argument-array API.

If the agent performs textual substitution and invokes the resulting command through a shell, shell metacharacters contained in the task identifier can be interpreted as command syntax rather than as part of a single argument. Relevant metacharacters include command separators, command substitutions, redirections, and pipelines.

The issue appears in both the core command documentation at line 28 and the task-ID-specific workflow at line 47. The external qclaw_queue.py implementation is outside the audited project and was not available for review; therefore, this finding concerns the unsafe command construction prescribed by the skill documentation.

Attack Path

  1. An attacker asks the agent to retrieve the result for a crafted task identifier containing shell syntax, such as a valid-looking identifier followed by a command separator and an additional command.
  2. Following the skill instructions, the agent substitutes the supplied value for <task_id>.
  3. The agent executes the constructed string using a shell-capable command tool.
  4. The shell parses the injected syntax and executes the attacker's additional command.
  5. The injected command runs with the same operating-system identity, filesystem permissions, environment access, and network access as the agent process.

Impact Assessment

Successful exploitation can permit arbitrary local command execution under the agent's account. Depending on that ...[truncated 648 chars]

Remediation
View remediation

Remediation Suggestions

  1. Require task identifiers to match a strict allowlist appropriate to the queue format, for example ^[A-Za-z0-9_-]+$, and reject all nonconforming values.
  2. Execute the utility without a shell by passing each argument separately, equivalent to:
    python
    subprocess.run(
        [
            "python3",
            os.path.expanduser("~/.workbuddy/skills/qclaw-workbuddy-bridge/scripts/qclaw_queue.py"),
            "result",
            task_id,
        ],
        check=True,
        shell=False,
    )
    
  3. Explicitly state in the skill instructions that user-provided task identifiers must never be concatenated into shell command strings.
  4. If a shell is unavoidable, validate the identifier first and apply robust platform-appropriate argument quoting. Quoting alone should not replace allowlist validation.
  5. Apply the same correction to both occurrences of the command at lines 28 and 47.
  6. Add negative tests using identifiers containing separators, substitutions, whitespace, redirections, and newline characters to verify that they are rejected or passed as one literal argument.
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)

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.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The trigger phrases include very broad everyday language such as '结果出来了吗' and '工作做完了吗', which can cause the skill to activate in ambiguous conversations and disclose prior WorkBuddy task results without sufficiently specific user intent. Because the skill returns task descriptions, execution results, and file paths, over-broad activation increases the chance of unintended data exposure to the wrong context or user.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The result display template explicitly includes task descriptions, detailed execution output, and attachment file paths, but the skill does not warn that querying results may expose contents from prior tasks. In a shared or ambiguous chat context, this can leak sensitive business data or local filesystem paths to someone who did not intend to retrieve or view that information.

Content

No source excerpt is available for this finding.