Back to skill

Security audit

PayAClaw Helper

Security checks for vulnerabilities and agentic risk

Overview

This task-helper skill is mostly coherent, but it automatically saves user content to predictable local files without documentation, creating avoidable privacy and overwrite risk.

Install only if you are comfortable with a Chinese-language CLI helper that saves every generated result as a plaintext file in the directory where it is run. Avoid using it in shared or untrusted directories, and avoid entering sensitive task content unless the file-write behavior is changed to be opt-in or safer.

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
payaclaw_helper.py:200
Finding

Predictable Plaintext Output File Permits Symlink-Based File Overwrite

Content
View full analysis

Vulnerability Details

File Location: payaclaw_helper.py, lines 200-203
Vulnerability Type: Predictable file creation, symlink following, and unexpected plaintext persistence
Risk Level: Medium

Vulnerable Code:

python
output_file = f"payaclaw_output_{datetime.now().strftime('%Y%m%d_%H%M%S')}.txt"
with open(output_file, 'w', encoding='utf-8') as f:
    f.write(result)
print(f"\n💾 结果已保存到: {output_file}")

Technical Analysis

Every command automatically saves the generated result to a plaintext file in the current working directory. The filename is derived solely from the current timestamp with one-second precision, making it predictable.

The file is opened in w mode without exclusive creation or protection against symbolic links. If a file already exists at the predicted path, it is truncated. If the path is a symbolic link, Python follows that link and writes to its target. An attacker with write access to the working directory can therefore prepare the expected output path as a symbolic link to another file writable by the victim process.

The saved result can contain user-supplied task descriptions, contextual information, or submission content. This also causes potentially sensitive information to be persisted in plaintext automatically. The documented usage in SKILL.md does not disclose this file-write side effect.

Attack Path

  1. The attacker obtains write access to a directory in which a victim will run the helper.
  2. The attacker predicts the timestamp-based filename for the expected execution second, such as payaclaw_output_20260916_120000.txt.
  3. The attacker creates that path as a symbolic link to a file writable by the victim process.
  4. The victim invokes any supported command from that directory.
  5. The helper opens the predictable path in w mode, follows the symbolic link, and truncates or replaces the linked target with generated output.

Exploitation require ...[truncated 808 chars]

Remediation
View remediation

Remediation Suggestions

  • Make file persistence opt-in through an explicit --output option instead of automatically writing every result.
  • Document the file-write behavior, destination, overwrite policy, and sensitivity implications in SKILL.md.
  • When creating a new output file, use exclusive creation mode (x) and fail safely if the path already exists.
  • Prefer a cryptographically unpredictable filename generated with Python's tempfile module when automatic file creation is necessary.
  • Create output with restrictive permissions, such as owner read/write access only.
  • Do not follow symbolic links. On supported systems, use an atomic low-level open operation with O_CREAT | O_EXCL | O_NOFOLLOW, then wrap the resulting descriptor for text output.
  • Avoid attacker-controlled or shared working directories. Require a trusted output directory and validate its ownership and permissions before writing.
  • Provide a standard-output-only mode so sensitive generated content does not remain on disk by default.
Vulnerability Patterns
  • 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
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill title and all user-facing documentation are written in Chinese, and the command examples use Chinese input placeholders such as "任务描述" and "背景信息". This creates a natural-language policy concern if users are not explicitly given a language choice, because the skill presentation implies a fixed locale rather than optional multilingual support.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This Python file contains natural-language descriptions, prompts, help text, and output strings entirely in Chinese, including the tool description and command help. Because the skill does not provide user opt-in for language selection or explain that it is intentionally region-specific, it conflicts with the policy against forcing a specific language without user choice.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The help text and arguments for the format subcommand declare both --summary and --additional as inputs for formatting a submission. However, when dispatching the format command, the code calls format_content(args.task, args.content, args.summary) and never passes args.additional, so the documented user intent is contradicted by actual behavior.

Content

No source excerpt is available for this finding.