Back to skill

Security audit

codeflow

Security checks for vulnerabilities and agentic risk

Overview

Codeflow is a real session-streaming tool, but it also weakens agent permission boundaries, installs persistent tool hooks, and sends or stores detailed development-session content by default.

Review this carefully before installing. Use it only for channels where everyone may see file paths, file-write previews, command output, prompts, and final results. Enable CODEFLOW_SAFE_MODE=true and consider CODEFLOW_STREAM_LOG=redacted or off. Do not apply the global Claude bypassPermissions setting or --dangerously-skip-permissions unless you knowingly accept unrestricted agent actions. Treat the enforcer install button as an administrative action because it changes OpenClaw plugin configuration and may restart the gateway.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • System PersistenceInstalls backdoors, hooks, services, or scheduled tasks that survive the run
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
Findings (6)

T01 · Skill Instruction Hijacking

Error
Location
SKILL.md:32
Finding

Session-Wide Instruction and Tool Hijacking Through Codeflow Enforcement

Content
View full analysis
{ const sessionKey = norm(ctx.sessionKey); if (!sessionKey) { return; } const state = await queryCurrent(sessionKey); if (!state?.active) { return; } return { prependContext: [ "Codeflow Enforced = ON for this thread.", `Coding, development, and review work must run via \`${codeflowScript} run|review|parallel|resume\`.`, "Direct write/edit/apply_patch/exec tool usage is blocked.", "If workdir is missing, ask for it. If the user wants to exit this mode, use /codeflow off.", ].join("\n"), }; }, { priority: 1000 }, ); api.on( "before_tool_call", async (event, ctx) => { const sessionKey = norm(ctx.sessionKey); if (!sessionKey) { return; } const state = await queryCurrent(sessionKey); if (!state?.active) { return; } const toolName = lower(event.toolName); if (BLOCKED_MUTATION_TOOLS.has(toolName)) { return { block: true, blockReason: "Codeflow is enforced for this thread. Direct file mutation is blocked; use Codeflow instead.", }; } if (toolName === "exec") { const command = extractEx ...[truncated 2155 chars]
Remediation
View remediation

T06 · System Persistence

Error
Location
scripts/_internal/bin/enforcer.sh:611
Finding

Persistent Installation of Host-Level Prompt and Tool Hooks

Content
View full analysis
/dev/null || true)" merged="$(PLUGIN_ALLOW_RAW="$raw" python3 - "$PLUGIN_ID" <<'PY' ... changed = plugin_id not in items if changed: items.append(plugin_id) print(("true" if changed else "false") + "\t" + json.dumps(items, ensure_ascii=False)) PY )" ... if [ "$changed" = true ]; then run_openclaw config set plugins.allow "$merged" --json >/dev/null fi } ``` ```bash case "$ACTION" in install) require_openclaw require_bundled_plugin ensure_plugin_allowlisted run_openclaw plugins install -l "$PLUGIN_DIR" maybe_restart_gateway "$RESTART" ;; update) require_openclaw require_bundled_plugin ensure_plugin_allowlisted run_openclaw plugins uninstall "$PLUGIN_ID" --keep-files >/dev/null 2>&1 || true run_openclaw plugins install -l "$PLUGIN_DIR" maybe_restart_gateway "$RESTART" ;; uninstall) require_openclaw run_openclaw plugins uninstall "$PLUGIN_ID" --keep-files maybe_restart_gateway "$RESTART" ;; esac ``` The documented setup invokes the persistent installation: ```bash bash {baseDir}/scripts/codeflow enforcer install --restart ``` ### Technical Analysis The installer changes the persistent `plugins.allow` configuration, installs the bundled plugin into OpenClaw, and can restart the gateway. Once loaded, the plugin registers hooks for prompt construction and tool calls. The plugin installation persists beyond an individual Codeflow relay run. Although the guard state is intended to be session-scoped, the host-level hook remains available across sessions. The uninstall operation also uses `--keep-files` and does ...[truncated 875 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
references/setup.md:69
Finding

Setup Disables Claude Code Permission Boundaries Globally

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/_internal/py/parse-stream.py:370
Finding

File Contents and Command Output Are Externally Relayed and Stored in Full by Default

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/_internal/bin/dev-relay.sh:469
Finding

Discord Webhook Destination Is Not Validated

Content
View full analysis
&2 exit 1 } if ! WEBHOOK_URL="$WEBHOOK_URL" python3 - <<'PY' import os import sys import urllib.request url = (os.environ.get("WEBHOOK_URL") or "").strip() if not url: sys.exit(1) try: with urllib.request.urlopen(url, timeout=10) as resp: code = getattr(resp, "status", None) or resp.getcode() sys.exit(0 if int(code) == 200 else 1) except Exception: sys.exit(1) PY then echo "❌ Error: Webhook URL appears invalid or unreachable" >&2 exit 1 fi ``` The Discord adapter then posts directly to the supplied value: ```python webhook_url = os.environ.get("WEBHOOK_URL", "").strip() ``` ```python def _http_post_json(url: str, payload: Dict[str, Any], headers: Optional[Dict[str, str]] = None) -> Dict[str, Any]: DELIVERY_STATS["http_requests"] += 1 body = json.dumps(payload, ensure_ascii=False).encode("utf-8") req = urllib.request.Request(url, data=body, method="POST") req.add_header("Content-Type", "application/json") ``` ```python for chunk in chunks[start:]: if not chunk: continue url = _with_query(webhook_url, thread_id=_thread_id) if _thread_id else webhook_url payload = {"content": chunk, "username": name or agent_name} if not allow_mentions: payload["allowed_mentions"] = {"parse": []} _http_post_json(url, payload) ``` ### Technical Analysis The validation logic checks only whether the URL is nonempty, reachable, and returns HTTP 200. It does not require HTTPS, enforce an official Discord ...[truncated 1152 chars]
Remediation
View remediation
/` path format. - Reject user-info components, fragments, unexpected ports, IP-literal hosts, and malformed hostnames. - Disable automatic redirects or revalidate every redirect target against the same allowlist. - Avoid issuing a GET request to a secret-bearing webhook URL merely to test reachability; use a documented Discord validation method. - Display the normalized destination hostname and channel identity to the user before sending session content. ]]>

T08 · Insecure Dependencies

Error
Location
scripts/_internal/bin/enforcer.sh:18
Finding

Unpinned OpenClaw Package Is Downloaded and Executed Through NPX

Content
View full analysis
/dev/null 2>&1 && command -v openclaw >/dev/null 2>&1' _ "$nvm_script" >/dev/null 2>&1; then OPENCLAW_LAUNCHER_KIND="native" OPENCLAW_LAUNCHER_LABEL="openclaw" OPENCLAW_CMD=() OPENCLAW_NVM_SCRIPT="$nvm_script" return 0 fi fi if command -v openclaw >/dev/null 2>&1; then OPENCLAW_LAUNCHER_KIND="native" OPENCLAW_LAUNCHER_LABEL="openclaw" OPENCLAW_CMD=(openclaw) return 0 fi if command -v npx >/dev/null 2>&1; then OPENCLAW_LAUNCHER_KIND="npx" OPENCLAW_LAUNCHER_LABEL="npx -y openclaw" OPENCLAW_CMD=(npx -y openclaw) return 0 fi OPENCLAW_LAUNCHER_KIND="missing" OPENCLAW_LAUNCHER_LABEL="" OPENCLAW_CMD=() return 1 } ``` ### Technical Analysis If no local `openclaw` executable is available, the script falls back to `npx -y openclaw`. No version is specified and no package integrity value is verified. The `-y` option suppresses the normal installation confirmation. The package resolved by the registry can therefore change after the Skill has been audited. Status, installation, configuration, and gateway restart operations can trigger this path. Any registry compromise, package ownership compromise, or malicious future package release would execute with the current user's privileges. ### Attack Path 1. The host does not have a global `openclaw` executable in the detected paths. 2. `npx` is available. 3. The user runs an enforcer status, installation, update, uninstall, or restart-related flow. 4. The script selects `npx -y ...[truncated 622 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (124)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Plugin installation/configuration management and restart guidance are privileged host-administration functions, yet the skill is introduced primarily as a session-streaming tool. That kind of understatement can cause operators to approve a skill without recognizing that it can change local configuration and service state.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Plugin installation/configuration management and restart guidance are privileged host-administration functions, yet the skill is introduced primarily as a session-streaming tool. That kind of understatement can cause operators to approve a skill without recognizing that it can change local configuration and service state.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Plugin installation/configuration management and restart guidance are privileged host-administration functions, yet the skill is introduced primarily as a session-streaming tool. That kind of understatement can cause operators to approve a skill without recognizing that it can change local configuration and service state.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Plugin installation/configuration management and restart guidance are privileged host-administration functions, yet the skill is introduced primarily as a session-streaming tool. That kind of understatement can cause operators to approve a skill without recognizing that it can change local configuration and service state.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

Plugin installation/configuration management and restart guidance are privileged host-administration functions, yet the skill is introduced primarily as a session-streaming tool. That kind of understatement can cause operators to approve a skill without recognizing that it can change local configuration and service state.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Plugin installation/configuration management and restart guidance are privileged host-administration functions, yet the skill is introduced primarily as a session-streaming tool. That kind of understatement can cause operators to approve a skill without recognizing that it can change local configuration and service state.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Plugin installation/configuration management and restart guidance are privileged host-administration functions, yet the skill is introduced primarily as a session-streaming tool. That kind of understatement can cause operators to approve a skill without recognizing that it can change local configuration and service state.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Plugin installation/configuration management and restart guidance are privileged host-administration functions, yet the skill is introduced primarily as a session-streaming tool. That kind of understatement can cause operators to approve a skill without recognizing that it can change local configuration and service state.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

Plugin installation/configuration management and restart guidance are privileged host-administration functions, yet the skill is introduced primarily as a session-streaming tool. That kind of understatement can cause operators to approve a skill without recognizing that it can change local configuration and service state.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Plugin installation/configuration management and restart guidance are privileged host-administration functions, yet the skill is introduced primarily as a session-streaming tool. That kind of understatement can cause operators to approve a skill without recognizing that it can change local configuration and service state.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Plugin installation/configuration management and restart guidance are privileged host-administration functions, yet the skill is introduced primarily as a session-streaming tool. That kind of understatement can cause operators to approve a skill without recognizing that it can change local configuration and service state.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Plugin installation/configuration management and restart guidance are privileged host-administration functions, yet the skill is introduced primarily as a session-streaming tool. That kind of understatement can cause operators to approve a skill without recognizing that it can change local configuration and service state.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Plugin installation/configuration management and restart guidance are privileged host-administration functions, yet the skill is introduced primarily as a session-streaming tool. That kind of understatement can cause operators to approve a skill without recognizing that it can change local configuration and service state.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Plugin installation/configuration management and restart guidance are privileged host-administration functions, yet the skill is introduced primarily as a session-streaming tool. That kind of understatement can cause operators to approve a skill without recognizing that it can change local configuration and service state.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Plugin installation/configuration management and restart guidance are privileged host-administration functions, yet the skill is introduced primarily as a session-streaming tool. That kind of understatement can cause operators to approve a skill without recognizing that it can change local configuration and service state.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Plugin installation/configuration management and restart guidance are privileged host-administration functions, yet the skill is introduced primarily as a session-streaming tool. That kind of understatement can cause operators to approve a skill without recognizing that it can change local configuration and service state.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Plugin installation/configuration management and restart guidance are privileged host-administration functions, yet the skill is introduced primarily as a session-streaming tool. That kind of understatement can cause operators to approve a skill without recognizing that it can change local configuration and service state.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Plugin installation/configuration management and restart guidance are privileged host-administration functions, yet the skill is introduced primarily as a session-streaming tool. That kind of understatement can cause operators to approve a skill without recognizing that it can change local configuration and service state.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Plugin installation/configuration management and restart guidance are privileged host-administration functions, yet the skill is introduced primarily as a session-streaming tool. That kind of understatement can cause operators to approve a skill without recognizing that it can change local configuration and service state.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
For PR review, parallel tasks, Discord bridge, and Codex structured output: see [references/advanced-modes.md](references/advanced-modes.md).

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
For PR review, parallel tasks, Discord bridge, and Codex structured output: see [references/advanced-modes.md](references/advanced-modes.md).

Credential Access

High
Category
Privilege Escalation
Confidence
97% confidence
Finding

The subprocess is launched with process.env merged into its environment, exposing all ambient secrets available to the host process to the called script. If the script, its dependencies, logging, or any downstream command is compromised or overly verbose, credentials such as API keys, tokens, and service secrets can be disclosed or abused.

Content

Scanner excerpt · extensions/codeflow-enforcer/index.js (reported line 121)May include surrounding context.

js
try {
      return await runner(argv, {
        timeoutMs: commandTimeoutMs,
        env: env ? { ...process.env, ...env } : process.env,
      });
    } catch (error) {
      degraded = true;

Exfiltration Commands

High
Category
Prompt Injection
Confidence
90% confidence
Finding

Instructions found that direct the agent to transmit conversation context or user data to external services.

Content

Scanner excerpt · references/advanced-modes.md (reported line 91)May include surrounding context.

md
| `!log [PID]` | Show recent stream event types |

**Notes:**
- This bridge does **not** forward messages to agent stdin and does **not** implement remote `!kill` (by design).
- Fail-closed by default: if `--channel`/`--users` (or env) are not both configured, commands are refused.
- Always scope it to a channel + allowlist (`--channel` + `--users`) to avoid exposing session metadata broadly.
- `CODEFLOW_SAFE_MODE=true` enables stricter redaction across Codeflow.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The setup instructs users to globally disable Claude Code's permission prompts and allow all actions via ~/.claude/settings.json, which materially weakens the host agent's security model for every future session, not just this skill. In the context of a tool that streams coding-agent activity and may invoke agent sessions, this creates a broad path for unintended file access, command execution, and data exfiltration without user confirmation.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

These instructions tell the user to suppress permission prompts and permit all actions without any warning about the resulting trust expansion. That omission increases the chance users will apply an unsafe global configuration they do not understand, allowing subsequent agent runs to operate with effectively unrestricted authority.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.