Back to skill

Security audit

Complex Workflow Freezer

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its stated purpose, but it needs review because unsafe path handling can overwrite files outside the intended output directory.

Review before installing. Use only a dedicated output directory, avoid running it with untrusted workflow_id values, and do not enable webchat or Telegram progress forwarding unless that disclosure is acceptable. The package does not show evidence of deception, exfiltration, privilege escalation, or persistence beyond generated spec files, but the file-write validation bug should be fixed before broad use.

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
__init__.py:81
Finding

Path Traversal and Unintended File Overwrite Through Unvalidated Workflow Identifier

Content
View full analysis

Vulnerability Details

File Location: __init__.py, lines 58–59 and 81–83
Vulnerability Type: Path traversal leading to an arbitrary file write
Risk Level: Medium

python
if not (output_path.exists() and output_path.is_dir()):
    raise ValueError(f"输出路径无效:{output_path} 必须是绝对且存在的目录")

# 4. 保存规格(终结一致性)
skill_id = f"skill-{workflow_id.split('-')[1]}-{workflow_id.split('-')[2]}"
saved_specs = output_path / f"{skill_id}_specs.json"
content = {
    "skill_id": skill_id,
    "checksums": {"findings": find_ck, "decisions": dec_ck},
    "locked_thresh": locked_thresh,
    "exec_copy": exec_copy,
    "vlm_layers": multimodal_layers,
    "check_status": check_status
}
saved_specs.write_text(str(content))

Technical Analysis

The documented format of workflow_id is wrk-YYYYMMDD-XXXX, but the implementation does not validate that format. Instead, it splits the caller-controlled value and directly incorporates its second and third components into a filesystem path.

A third component containing path separators and traversal sequences such as ../ can cause the resulting saved_specs path to escape the intended output directory. For example, a value shaped like wrk-a-../../victim produces a path resembling:

text
<output_path>/skill-a-/../../victim_specs.json

Exploitation requires the intermediate skill-a- directory to exist, but this may be feasible when the attacker can write within or otherwise influence the output directory. In addition, Path.write_text() follows symbolic links, so predictable destination names can permit a symlink-based overwrite if the output directory is attacker-writable.

The validation at lines 58–59 only checks that output_path exists and is a directory. Despite the error message stating that the path must be absolute, the implementation does not call output_path.is_absolute(). It also does not resolve the final destination and verify that ...[truncated 1434 chars]

Remediation
View remediation

Remediation Suggestions

  1. Strictly validate workflow_id before using it:

    python
    import re
    
    if not re.fullmatch(r"wrk-\d{8}-[A-Za-z0-9]+", workflow_id):
        raise ValueError("Invalid workflow_id format")
    
  2. Require and normalize an absolute output directory:

    python
    if not output_path.is_absolute():
        raise ValueError("output_path must be absolute")
    
    output_root = output_path.resolve(strict=True)
    if not output_root.is_dir():
        raise ValueError("output_path must be an existing directory")
    
  3. Resolve and constrain the destination before writing:

    python
    destination = (output_root / f"{skill_id}_specs.json").resolve(strict=False)
    if destination.parent != output_root:
        raise ValueError("Destination escapes the approved output directory")
    
  4. Reject symbolic-link destinations and avoid silently overwriting existing files. Use exclusive creation where replacement is not required:

    python
    if destination.is_symlink():
        raise ValueError("Symbolic-link destinations are not allowed")
    
    with destination.open("x", encoding="utf-8") as file:
        file.write(serialized_content)
    
  5. Where stronger protection against symlink races is required, use directory-file-descriptor-based operations and platform facilities such as O_NOFOLLOW and O_EXCL.

  6. Add tests covering malformed identifiers, absolute path components, traversal sequences, existing symlinks, duplicate filenames, relative output paths, and destinations outside the approved output directory.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (12)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 169)May include surrounding context.

md
1. **包结构**:`complex-workflow-freezer/`目录含`SKILL.md`和`__init__.py`

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The file forces a single language presentation throughout the skill documentation and interface description, with no opt-in or alternative locale guidance. Per policy, language constraints should either offer user choice or be explicitly justified as region-specific.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill explicitly writes specification files and describes temporary file deletion, but does not provide a clear warning about filesystem impact or scope. In an agent environment, this can lead to unintended modification or deletion of user or system data, especially because output paths are caller-influenced and cleanup behavior is part of the workflow.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The progress-reporting mechanism can send stage, epoch, progress, and message content over external channels such as webchat or Telegram without any privacy warning or data-minimization guarantee. Operational metadata may leak workflow identifiers, status details, or sensitive processing context to third-party systems or unintended recipients.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The specification requires output_path to be an absolute path, but the implementation only checks that it exists and is a directory. This allows relative paths or unexpected writable directories to be used, which can cause files to be written outside the intended workspace and increase the risk of accidental overwrite or misuse when the caller controls the path.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documented design says decision thresholds should be frozen into a normalized fixed-string representation, but the code instead filters thresholds equal to 0.85 and stores raw values. This breaks the intended consistency guarantee and can lead to incorrect or manipulable workflow behavior if threshold semantics drift between freeze and replay.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The documented fallback for missing multimodal support is text-only processing, but the implementation instead broadens threshold selection to all values >= 0.8. This silent behavioral change alters decision criteria during degradation, which can produce unauthorized or inconsistent outputs and makes failure handling less predictable and potentially exploitable.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

User-visible strings, comments, exception messages, and progress messages are primarily in Chinese, and the code does not offer any language or locale selection mechanism. This can violate language/locale policy where user-facing communication should not force a specific language without opt-in.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill emits workflow progress and message content through logging and, when OPENCLAW_CHANNEL is set to webchat or telegram, sends outbound user-channel messages automatically. Because this behavior is driven by environment-controlled runtime context and not clearly required by the skill’s core freezing function, it creates an unnecessary data exposure path for workflow metadata and operational state.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill transmits workflow stage, progress, and status messages over logging and potentially over external messaging channels without an explicit disclosure or confirmation step. In a workflow-processing skill, even seemingly limited status data can reveal execution state, task existence, and operational context to unintended recipients.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The inline comment labels exec_copy as 'immutable', but list(execution_path) merely creates another mutable list. This is an active contradiction between intent documentation and actual behavior, especially relevant because the surrounding code presents this stage as a locking/freezing step.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The function persists generated workflow specifications to a JSON-like file under the provided output path via write_text. While the operation is commented internally, there is no user-facing notice, confirmation, or explicit warning in this file that data will be written to disk.

Content

No source excerpt is available for this finding.