Back to skill

Security audit

chat2workflow

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly coherent, but its optional converter can write files outside the intended output folder if given an unsafe workflow name.

Review generated workflows before importing them into Dify or Coze, especially Code, HTTP Request, search, and plugin/tool nodes. Do not embed real API keys or passwords in generated JSON. If using the optional converter, run it only on trusted workflow JSON, use simple workflow names containing only letters, digits, underscores, and hyphens, choose a disposable output directory, and consider pinning dependencies before installation.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
converter.py:82
Finding

Unvalidated Workflow Name Allows Path Traversal and Arbitrary File Overwrite

Content
View full analysis

Vulnerability Details

File Location: converter.py:82-84, with the affected argument defined at converter.py:570
Vulnerability Type: Path traversal and arbitrary file write
Risk Level: Medium

Vulnerable Code

python
output_file = os.path.join(yaml_dir, app_name + ".yaml")

node_list = []

The resulting path is subsequently opened for writing at converter.py:283-284:

python
with open(output_file, 'w', encoding='utf-8') as yaml_file:
    yaml.dump(general_template, yaml_file, allow_unicode=True, default_flow_style=False)

The workflow name is accepted without validation at converter.py:570:

python
parser.add_argument('--name', type=str, required=True, help='Workflow name')

The shell wrapper also forwards this value unchanged at bash_converter.sh:24-34:

bash
NAME="${2:-workflow}"
OUTPUT_PATH="${3:-${DEFAULT_OUTPUT_PATH}}"
TYPE="${4:-dify}"

python "${SCRIPT_DIR}/converter.py" \
    --json_path "${JSON_PATH}" \
    --name "${NAME}" \
    --output_path "${OUTPUT_PATH}" \
    --type "${TYPE}"

Technical Analysis

resolve_safe_output_path() validates only the user-supplied output directory. It does not validate the workflow name used to construct the final filename.

Because app_name can contain absolute paths, .. components, or path separators, os.path.join(yaml_dir, app_name + ".yaml") does not guarantee that the result remains beneath yaml_dir. An absolute app_name causes Python to discard the preceding directory. A relative name containing traversal components can resolve outside the approved output directory.

The Dify conversion path then opens the constructed path using write mode. If the destination exists and is writable, it is truncated and replaced with generated YAML. If the necessary parent directories already exist, a new file can also be created outside the configured output directory.

...[truncated 2059 chars]

Remediation
View remediation

Remediation Suggestions

  1. Restrict workflow names to a conservative basename format:

    python
    import re
    
    WORKFLOW_NAME_RE = re.compile(r"^[A-Za-z0-9_-]+$")
    
    def validate_workflow_name(name: str) -> str:
        if not WORKFLOW_NAME_RE.fullmatch(name):
            raise ValueError(
                "Workflow name may contain only ASCII letters, digits, "
                "underscores, and hyphens."
            )
        return name
    
  2. Explicitly reject absolute paths, . and .., path separators, NUL characters, and platform-specific alternate separators.

  3. Validate every complete destination after combining its directory and filename:

    python
    def safe_child_path(parent: str, filename: str) -> str:
        parent_real = os.path.realpath(parent)
        candidate = os.path.realpath(os.path.join(parent_real, filename))
        if os.path.commonpath([parent_real, candidate]) != parent_real:
            raise ValueError("Output path escapes its approved directory")
        return candidate
    
  4. Apply the containment check independently to:

    • Dify YAML output.
    • Coze temporary YAML output.
    • Coze workflow staging directories.
    • Final Coze ZIP output.
  5. Avoid silently rewriting unsafe input. Reject it with a clear error so callers cannot mistakenly believe their requested path was used.

  6. Add regression tests covering absolute paths, ../, nested traversal, Windows separators, drive-qualified paths, UNC paths, symlinked directories, and ordinary valid names.

  7. Correct CONVERTER_USAGE.md so its output-containment claims match the behavior actually enforced by the implementation.

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Open-Ended and Unhashed Third-Party Dependencies Produce Non-Reproducible Installations

Content
View full analysis

Vulnerability Details

File Location: requirements.txt:1-2
Vulnerability Type: Dependency supply-chain hardening weakness
Risk Level: Low

Vulnerable Configuration

text
PyYAML>=6.0
json_repair>=0.30.0

Technical Analysis

Both third-party dependencies use open-ended minimum-version constraints. An installation can therefore select any later release satisfying the constraint, including releases that were not reviewed with this project.

The requirements also lack package hashes. Consequently, the repository does not provide an integrity-bound, reproducible dependency set. Different installations performed at different times may resolve to different code.

No evidence was found that either package name is typo-squatted, loaded from an untrusted custom index, or currently malicious. This finding concerns future supply-chain and reproducibility exposure rather than a confirmed malicious dependency.

Attack Path

  1. A user follows the converter documentation and installs dependencies from requirements.txt.
  2. The package resolver selects the latest releases satisfying the open-ended constraints.
  3. A future compromised, malicious, or incompatible release is selected without any project source change.
  4. Package installation or later import executes code from that unreviewed release in the user’s Python environment.
  5. The compromised dependency receives the privileges and data access of the process importing it.

Impact Assessment

If an accepted future package release is compromised, it could execute with the privileges of the installing or converter process. Potential scope could include access to local workflow inputs, generated artifacts, environment-accessible data, and files available to that process.

This repository itself does not automatically invoke a package manager, and the utilities are documented as optional. Those factors reduce likelihood, but ...[truncated 90 chars]

Remediation
View remediation

Remediation Suggestions

  1. Pin reviewed dependency versions exactly instead of using open-ended minimum versions:

    text
    PyYAML==<reviewed-version>
    json_repair==<reviewed-version>
    
  2. Generate and distribute a lock or constraints file containing cryptographic hashes, for example with pip-compile --generate-hashes.

  3. Install with hash enforcement:

    bash
    python -m pip install --require-hashes -r requirements.lock
    
  4. Separate direct dependencies from the fully resolved lock file so transitive versions are also fixed.

  5. Use automated dependency scanning and update dependencies through reviewed pull requests.

  6. Document the supported Python version and tested dependency versions to reduce resolver variance.

  7. Prefer trusted package indexes and avoid dependency installation with elevated privileges.

Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (67)

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SAFETY_AUDIT.md (reported line 58)May include surrounding context.

2.3 No environment-variable or credential access

bash
grep -RInE '\b(os\.environ|os\.getenv|getenv|getpass|keyring|secrets\.|dotenv|load_dotenv|API_KEY|TOKEN|SECRET|PASSWORD)\b' \
    converter.py tools.py autofix.py bash_converter.sh
# expected: (no matches)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

While most mismatch findings overstate direct skill execution, this aggregate finding surfaces a real security concern: the skill is positioned as harmless 'design-only' output, yet it actively guides users to generate workflow JSON containing executable code nodes, HTTP requests, search, and tool invocations. That can cause users to under-trust-boundary review generated artifacts and later deploy workflows with network access, code execution, or secret-bearing parameters they did not fully assess.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

While most mismatch findings overstate direct skill execution, this aggregate finding surfaces a real security concern: the skill is positioned as harmless 'design-only' output, yet it actively guides users to generate workflow JSON containing executable code nodes, HTTP requests, search, and tool invocations. That can cause users to under-trust-boundary review generated artifacts and later deploy workflows with network access, code execution, or secret-bearing parameters they did not fully assess.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

While most mismatch findings overstate direct skill execution, this aggregate finding surfaces a real security concern: the skill is positioned as harmless 'design-only' output, yet it actively guides users to generate workflow JSON containing executable code nodes, HTTP requests, search, and tool invocations. That can cause users to under-trust-boundary review generated artifacts and later deploy workflows with network access, code execution, or secret-bearing parameters they did not fully assess.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

While most mismatch findings overstate direct skill execution, this aggregate finding surfaces a real security concern: the skill is positioned as harmless 'design-only' output, yet it actively guides users to generate workflow JSON containing executable code nodes, HTTP requests, search, and tool invocations. That can cause users to under-trust-boundary review generated artifacts and later deploy workflows with network access, code execution, or secret-bearing parameters they did not fully assess.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

While most mismatch findings overstate direct skill execution, this aggregate finding surfaces a real security concern: the skill is positioned as harmless 'design-only' output, yet it actively guides users to generate workflow JSON containing executable code nodes, HTTP requests, search, and tool invocations. That can cause users to under-trust-boundary review generated artifacts and later deploy workflows with network access, code execution, or secret-bearing parameters they did not fully assess.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

While most mismatch findings overstate direct skill execution, this aggregate finding surfaces a real security concern: the skill is positioned as harmless 'design-only' output, yet it actively guides users to generate workflow JSON containing executable code nodes, HTTP requests, search, and tool invocations. That can cause users to under-trust-boundary review generated artifacts and later deploy workflows with network access, code execution, or secret-bearing parameters they did not fully assess.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

While most mismatch findings overstate direct skill execution, this aggregate finding surfaces a real security concern: the skill is positioned as harmless 'design-only' output, yet it actively guides users to generate workflow JSON containing executable code nodes, HTTP requests, search, and tool invocations. That can cause users to under-trust-boundary review generated artifacts and later deploy workflows with network access, code execution, or secret-bearing parameters they did not fully assess.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

While most mismatch findings overstate direct skill execution, this aggregate finding surfaces a real security concern: the skill is positioned as harmless 'design-only' output, yet it actively guides users to generate workflow JSON containing executable code nodes, HTTP requests, search, and tool invocations. That can cause users to under-trust-boundary review generated artifacts and later deploy workflows with network access, code execution, or secret-bearing parameters they did not fully assess.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

While most mismatch findings overstate direct skill execution, this aggregate finding surfaces a real security concern: the skill is positioned as harmless 'design-only' output, yet it actively guides users to generate workflow JSON containing executable code nodes, HTTP requests, search, and tool invocations. That can cause users to under-trust-boundary review generated artifacts and later deploy workflows with network access, code execution, or secret-bearing parameters they did not fully assess.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

While most mismatch findings overstate direct skill execution, this aggregate finding surfaces a real security concern: the skill is positioned as harmless 'design-only' output, yet it actively guides users to generate workflow JSON containing executable code nodes, HTTP requests, search, and tool invocations. That can cause users to under-trust-boundary review generated artifacts and later deploy workflows with network access, code execution, or secret-bearing parameters they did not fully assess.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

While most mismatch findings overstate direct skill execution, this aggregate finding surfaces a real security concern: the skill is positioned as harmless 'design-only' output, yet it actively guides users to generate workflow JSON containing executable code nodes, HTTP requests, search, and tool invocations. That can cause users to under-trust-boundary review generated artifacts and later deploy workflows with network access, code execution, or secret-bearing parameters they did not fully assess.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

While most mismatch findings overstate direct skill execution, this aggregate finding surfaces a real security concern: the skill is positioned as harmless 'design-only' output, yet it actively guides users to generate workflow JSON containing executable code nodes, HTTP requests, search, and tool invocations. That can cause users to under-trust-boundary review generated artifacts and later deploy workflows with network access, code execution, or secret-bearing parameters they did not fully assess.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

While most mismatch findings overstate direct skill execution, this aggregate finding surfaces a real security concern: the skill is positioned as harmless 'design-only' output, yet it actively guides users to generate workflow JSON containing executable code nodes, HTTP requests, search, and tool invocations. That can cause users to under-trust-boundary review generated artifacts and later deploy workflows with network access, code execution, or secret-bearing parameters they did not fully assess.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

While most mismatch findings overstate direct skill execution, this aggregate finding surfaces a real security concern: the skill is positioned as harmless 'design-only' output, yet it actively guides users to generate workflow JSON containing executable code nodes, HTTP requests, search, and tool invocations. That can cause users to under-trust-boundary review generated artifacts and later deploy workflows with network access, code execution, or secret-bearing parameters they did not fully assess.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

While most mismatch findings overstate direct skill execution, this aggregate finding surfaces a real security concern: the skill is positioned as harmless 'design-only' output, yet it actively guides users to generate workflow JSON containing executable code nodes, HTTP requests, search, and tool invocations. That can cause users to under-trust-boundary review generated artifacts and later deploy workflows with network access, code execution, or secret-bearing parameters they did not fully assess.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

While most mismatch findings overstate direct skill execution, this aggregate finding surfaces a real security concern: the skill is positioned as harmless 'design-only' output, yet it actively guides users to generate workflow JSON containing executable code nodes, HTTP requests, search, and tool invocations. That can cause users to under-trust-boundary review generated artifacts and later deploy workflows with network access, code execution, or secret-bearing parameters they did not fully assess.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

While most mismatch findings overstate direct skill execution, this aggregate finding surfaces a real security concern: the skill is positioned as harmless 'design-only' output, yet it actively guides users to generate workflow JSON containing executable code nodes, HTTP requests, search, and tool invocations. That can cause users to under-trust-boundary review generated artifacts and later deploy workflows with network access, code execution, or secret-bearing parameters they did not fully assess.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

While most mismatch findings overstate direct skill execution, this aggregate finding surfaces a real security concern: the skill is positioned as harmless 'design-only' output, yet it actively guides users to generate workflow JSON containing executable code nodes, HTTP requests, search, and tool invocations. That can cause users to under-trust-boundary review generated artifacts and later deploy workflows with network access, code execution, or secret-bearing parameters they did not fully assess.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

While most mismatch findings overstate direct skill execution, this aggregate finding surfaces a real security concern: the skill is positioned as harmless 'design-only' output, yet it actively guides users to generate workflow JSON containing executable code nodes, HTTP requests, search, and tool invocations. That can cause users to under-trust-boundary review generated artifacts and later deploy workflows with network access, code execution, or secret-bearing parameters they did not fully assess.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

A shell wrapper is present even though the stated purpose is only conversational workflow design and text generation. Shell-accessible orchestration expands the attack surface because it enables execution of local tooling and persistent file creation from user-influenced inputs, which is more dangerous in a skill that users would reasonably expect to be non-executing and text-only.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill metadata says the skill is design-only and produces text output, but this script invokes a Python converter that generates platform-native files on disk. That creates an execution and file-write capability beyond the declared scope, which can mislead reviewers and users about the trust boundary and enable unsafe downstream effects if untrusted workflow JSON is converted and materialized.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The code materially exceeds the stated skill boundary by reading JSON from disk or command-line input, generating YAML files, copying and modifying a manifest, creating directories, and packaging a ZIP archive. In a skill advertised as design-only and text-only, this hidden file-generation behavior is dangerous because it can write persistent artifacts to the local filesystem and produce deployable workflow packages that a user or downstream system may trust under false assumptions.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The documentation explicitly supports emitting workflow JSON for a Code node that runs arbitrary Python and an HTTP Request node that performs outbound network access. That materially exceeds the advertised 'design-only, text-only, never runs scripts' scope because the generated artifact is intended to cause runtime code execution and network effects when imported into Coze, creating a capability-smuggling risk through deceptively scoped documentation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest says the skill is a design-only workflow designer that produces workflow JSON as text and never runs scripts. This file constructs a workflow node explicitly described as "Code execution" and stores transformed source code into the node parameters, enabling generated workflows to contain executable code rather than purely declarative structure.

Content

No source excerpt is available for this finding.