Back to skill

Security audit

Flux 2 Klein — Pro Pack on RunComfy

Security checks for vulnerabilities and agentic risk

Overview

The skill has a coherent image-generation purpose, but its shell examples handle user prompts unsafely and its global CLI installation guidance adds supply-chain risk.

Review before installing. Use this only with trusted prompts or ensure the agent constructs --input with a JSON serializer and passes arguments safely, not by raw string substitution into a shell command. Prefer a pinned, project-local RunComfy CLI install and keep the RunComfy token scoped to the generation process. The artifact does not show deception, exfiltration, destructive behavior, or hidden persistence, so this is a Review verdict rather than malicious.

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

Error
Location
SKILL.md:87
Finding

Shell Command Injection Through Unsafe Prompt Interpolation

Content
View full analysis
"}' \ --output-dir ``` The same construction appears in the wide-format example: ```bash runcomfy run blackforestlabs/flux-2-klein/9b/text-to-image \ --input '{"prompt": "", "width": 1536, "height": 864}' \ --output-dir ``` The Skill also makes the following security claim: ```markdown - **Input boundary**: the user prompt is passed as a JSON string to the CLI via `--input`. The CLI does NOT shell-expand the prompt; it transmits the JSON body directly to the Model API over HTTPS. No shell injection surface from prompt content. ``` ### Technical Analysis The examples place an untrusted user prompt inside a single-quoted shell argument. Although the RunComfy CLI may treat a safely received JSON argument as data, the shell processes quoting and metacharacters before the CLI starts. If an implementation replaces `` directly with user-controlled text, a single quote in that text terminates the quoted argument. The attacker can then introduce shell operators and commands. Consequently, the assertion that there is no shell-injection surface is only true if JSON is serialized independently and passed to the process without unsafe textual shell interpolation. For example, a prompt containing a payload shaped like the following could escape the intended argument when inserted verbatim: ```text '; attacker_command; # ``` This is an exploitable documentation-level coding flaw because the Skill explicitly instructs an Agent to construct commands from user input using this pattern. ### Attack Path 1. An attacker supplies an image-generation prompt containing a single quote followed by shell sy ...[truncated 1061 chars]
Remediation
View remediation
` in shell command strings. 2. Validate and constrain the output directory independently. 3. Update the security statement to explain that safety depends on serialization and argument-safe process invocation. 4. Add tests using prompts containing single quotes, double quotes, command substitutions, newlines, and shell separators. ]]>

T08 · Insecure Dependencies

Warning
Location
SKILL.md:52
Finding

Unpinned Global Installation of Third-Party CLI Dependency

Content
View full analysis
` instead of `runcomfy login`. ``` ### Technical Analysis The installation command requests the latest available version of `@runcomfy/cli` and installs it globally. It does not pin a reviewed version or integrity digest. This creates a mutable supply-chain boundary: the package installed in the future may differ from the package reviewed when the Skill was published. npm lifecycle scripts may execute during installation, and a globally installed executable becomes available outside the project directory. The dependency is especially sensitive because the resulting CLI is expected to receive: - A RunComfy bearer token. - User prompts. - Optional reference-image data or URLs. - Output-directory access. No evidence in the audited file establishes that the package is currently malicious. The risk arises from trusting an unpinned, remotely distributed package with sensitive credentials and globally scoped installation. ### Attack Path 1. A malicious or compromised version of `@runcomfy/cli` is published under the expected package name. 2. A user follows the Skill's unpinned command after that version becomes current. 3. npm downloads and globally installs the compromised release. 4. Malicious lifecycle code may execute during installation, or malicious behavior may run when the CLI is invoked. 5. The compromised CLI can access its process environment and command arguments, potentially including `RUNCOMFY_TOKEN`, prompts, file paths, and generated content. ### Impact Assessment Code supplied by the package executes with the privileges of the user perf ...[truncated 680 chars]
Remediation
View remediation
``` Prefer a project-local installation over a global installation, and invoke it from the project's dependency context. Commit and enforce a lockfile so that dependency resolution is reproducible. Additional hardening should include: 1. Verify npm registry provenance and package integrity before installation. 2. Record and validate the expected package integrity hash. 3. Review package lifecycle scripts and disable them during installation where compatible: ```bash npm install --ignore-scripts --save-exact @runcomfy/cli@ ``` 4. Run the CLI under a minimally privileged account or isolated container. 5. Expose `RUNCOMFY_TOKEN` only to the specific generation process and avoid placing it in broadly inherited environments. 6. Establish a controlled upgrade process in which new versions are reviewed and tested before updating the pinned dependency. 7. Avoid instructing users to run npm installation commands with `sudo` or administrator privileges. ]]>
Vulnerability Patterns
  • 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
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep