Back to skill

Security audit

Bytesagain Workflow Builder

Security checks for vulnerabilities and agentic risk

Overview

This skill matches its stated workflow-builder purpose, but it can run saved shell commands with weak scoping and no clear safety gate.

Install only if you are comfortable with a workflow tool that executes shell commands under your user account. Treat workflow JSON as executable code, review every step before running it, avoid workflows from untrusted sources, and do not use it in directories or environments containing sensitive credentials unless workflow ID validation and execution confirmation are added.

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
scripts/script.sh:94
Finding

Workflow ID Path Traversal Enables Execution of Commands from External JSON Files

Content
View full analysis
" && exit 1 local file="$STORE/$id.json" [ ! -f "$file" ] && echo "Workflow $id not found" && exit 1 WF_FILE="$file" python3 << 'PYEOF' import json, subprocess, os, datetime path = os.environ["WF_FILE"] with open(path) as f: d = json.load(f) print(f"\n🚀 Running workflow: [{d['id']}] {d['name']}") print(f" Steps: {len(d['steps'])}\n") d["status"] = "running" d["last_run"] = datetime.datetime.now().strftime("%Y-%m-%d %H:%M") all_ok = True for step in d["steps"]: print(f" [{step['index']}/{len(d['steps'])}] {step['name']}...", end=" ", flush=True) step["status"] = "running" try: result = subprocess.run(step["command"], shell=True, capture_output=True, text=True, timeout=30) ``` The same unsafe path construction is also present in: - `scripts/script.sh:62-68` for `add-step` - `scripts/script.sh:130-134` for `status` - `scripts/script.sh:181-186` for `export` ### Technical Analysis The workflow identifier is inserted directly into the filesystem path: ```bash local file="$STORE/$id.json" ``` No allowlist validation, canonicalization, or containment check ensures that the resulting file remains under `$HOME/.bytesagain-workflows`. An identifier containing traversal components such as `../` can therefore resolve to a JSON file outside the workflow store. The `run` operation loads the selected file as JSON and passes every `steps[].command` value to: ```python subprocess.run(step["command"], shell=True, ...) ``` Shell command execution is an advertised feature of the Skill. The vulnerability arises because path traversal allows an external, potentially attacker-controlled JSON file to be treated as a trusted workflow definition. Th ...[truncated 2765 chars]
Remediation
View remediation
&2 exit 1 } } ``` Call this function from `add-step`, `run`, `status`, and `export`. 2. **Enforce canonical path containment.** Resolve both the store and candidate file to canonical paths and verify that the candidate's parent is exactly the workflow store. Do not rely only on substring or prefix comparisons. 3. **Reject traversal and separators explicitly.** Reject identifiers containing `/`, backslashes, `..`, control characters, or unexpected extensions. 4. **Protect against symlink traversal.** Reject symbolic links and verify that the final target is a regular file owned by the expected user. Where possible, open files using APIs that prevent symlink following. 5. **Apply restrictive storage permissions.** Create the store with mode `0700` and workflow files with mode `0600`, rather than relying on the caller's current `umask`. 6. **Validate the workflow schema before execution.** Confirm that all required fields have the expected types, impose limits on step counts and field lengths, and reject malformed definitions. 7. **Clarify the trust boundary for command execution.** Treat workflow files as executable code. If workflows can be imported or originate outside the protected store, require explicit user review or confirmation before executing their commands. 8. **Apply the fix consistently.** Centralize path construction and validation so `add-step`, `run`, `status`, and `export` cannot implement different security checks. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (4)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The workflow runner executes previously stored step commands without any confirmation, review gate, or trust boundary, which makes accidental or malicious command execution very easy. Because commands are persisted and later run with shell interpretation, a user may trigger destructive actions from a workflow file without noticing, especially if the file was modified by another process or sourced from an untrusted origin.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
99% confidence
Finding

The code passes stored workflow commands directly into subprocess.run(..., shell=True), allowing arbitrary shell execution with full shell metacharacter processing. Any attacker-controlled or tampered command string can execute additional commands, redirect output, access secrets, or modify the system under the privileges of the invoking user.

Content

Scanner excerpt · scripts/script.sh (reported line 101)May include surrounding context.

sh
print(f"  [{step['index']}/{len(d['steps'])}] {step['name']}...", end=" ", flush=True)
    step["status"] = "running"
    try:
        result = subprocess.run(step["command"], shell=True, capture_output=True, text=True, timeout=30)
        if result.returncode == 0:
            step["status"] = "done"
            step["output"] = result.stdout.strip()[:200]

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
96% confidence
Finding

The skill advertises capabilities to create and run shell-based workflows, which inherently implies command execution, file access, and environment interaction, but it does not declare any explicit tool scope or permissions boundary. That omission increases the risk that an agent may invoke powerful tools without clear least-privilege constraints or user awareness, especially for a workflow runner that can automate multi-step system changes.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill explicitly supports adding and executing arbitrary shell commands, including build and deployment actions like rsync, yet it provides no warning that these actions can modify files, execute untrusted commands, access secrets, or affect remote systems. In this context, the absence of safety guidance is especially dangerous because the skill is designed to chain and automate multi-step execution, amplifying the blast radius of a mistaken or malicious command.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.