Back to skill

Security audit

Workflow

Security checks for vulnerabilities and agentic risk

Overview

This workflow skill is mostly coherent automation guidance, but some trigger examples could let external or untrusted events run local workflows without enough authentication or path control.

Review this skill before installing if you plan to use webhook, file-watcher, or cron triggers. Only run generated workflows from trusted paths, require real webhook signature verification and a workflow allowlist, avoid watching untrusted directories, and be careful with cleanup commands and stored API credentials.

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
components.md:165
Finding

Unauthenticated Webhook Routing Enables Path Traversal and Unintended Workflow Execution

Content
View full analysis

Vulnerability Details

File Location: components.md, lines 165–177
Vulnerability Type: Unauthenticated webhook handling, path traversal, and unsafe workflow dispatch
Risk Level: High

Vulnerable Code

bash
# Simple webhook receiver
while read -r request; do
  PATH=$(echo "$request" | jq -r '.path')
  WORKFLOW=${PATH#/webhooks/}
  PAYLOAD=$(echo "$request" | jq '.body')
  
  # Validate signature
  # ...
  
  # Trigger workflow
  echo "$PAYLOAD" > "workflows/flows/$WORKFLOW/data/00-trigger.json"
  (cd "workflows/flows/$WORKFLOW" && ./run.sh) &
done

Technical Analysis

The webhook router derives WORKFLOW directly from an attacker-controlled request path and uses it in both a file path and a working-directory change. It does not validate the value against a strict workflow-name pattern, compare it to an allowlist, or verify that the resolved path remains beneath workflows/flows/.

Webhook signature verification is represented only by a placeholder comment. If this template is implemented as shown, any party able to submit a request can trigger it without authentication. A value containing directory traversal components such as ../ can cause the router to target paths outside the intended workflow directory.

The router then writes the request body to the resolved data/00-trigger.json and executes ./run.sh from the selected directory. Exploitation depends on the process having write access to the target data directory and the selected directory containing an executable run.sh; however, no attacker-controlled shell metacharacters are required for traversal.

Assigning attacker-derived data to the reserved shell variable PATH is also unsafe. Although the snippet subsequently invokes few external commands, changing PATH can cause command-resolution failures or unexpected executable selection in expanded implementations.

Attack Path

  1. An attacker reaches the webhook receiver.
  2. The attacker submits a request whos ...[truncated 1204 chars]
Remediation
View remediation

Remediation Suggestions

  1. Authenticate every webhook before processing its path or body:
    • Require an HMAC signature using a dedicated per-workflow secret.
    • Compare signatures in constant time.
    • Validate a signed timestamp and reject stale or replayed requests.
  2. Permit only registered workflow identifiers:
    • Enforce a pattern such as ^[a-z0-9]+(-[a-z0-9]+)*$.
    • Resolve the identifier through a fixed allowlist rather than treating it as a path.
  3. Canonicalize the selected directory and verify that it remains beneath the canonical workflows/flows root.
  4. Reject absolute paths, . and .. components, slashes, backslashes, control characters, and symbolic-link escapes.
  5. Rename the request-path variable to REQUEST_PATH; never overwrite the shell's PATH variable.
  6. Use a fixed dispatcher that maps workflow IDs to known executable paths rather than executing ./run.sh from an attacker-influenced directory.
  7. Run the webhook service as a dedicated, unprivileged account with write access only to required workflow trigger locations.
  8. Write payloads atomically, enforce size limits and schemas, and avoid launching unbounded background processes.
  9. Log rejected requests without recording authentication secrets or sensitive payload contents.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Memory PoisoningPersistent Context Injection, Context Window Stuffing, Memory Manipulation
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (40)

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 · components.md (reported line 16)May include surrounding context.

md
## Auth
- **Method:** api_key | oauth | basic | bearer
- **Secret:** `{workflow}_{service}_api_key` (keychain name)
- **Scope:** {permissions granted}
- **Expires:** {if oauth, when tokens expire}

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 · components.md (reported line 28)May include surrounding context.

md
## Auth
- **Method:** api_key | oauth | basic | bearer
- **Secret:** `{workflow}_{service}_api_key` (keychain name)
- **Scope:** {permissions granted}
- **Expires:** {if oauth, when tokens expire}

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

The cleanup trap executes automatically on shell exit and deletes matching files without confirmation, which can cause unintended data loss if users rely on intermediate artifacts for debugging, auditability, or downstream processing. Although the glob is limited to data/0[1-9]-*.json, destructive behavior in an always-on EXIT trap is riskier in workflow tooling because runs frequently manipulate generated files and users may not realize they will be removed.

Content

Scanner excerpt · data-flow.md (reported line 122)May include surrounding context.

bash
# Keep only final output
cleanup() {
  rm -f data/0[1-9]-*.json  # Remove intermediate
  # Keep data/final.json
}
trap cleanup EXIT

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

The remediation suggests deleting /tmp/workflow-*.lock using a wildcard, which can remove unrelated lock files that merely share the prefix. Broad deletion commands in documentation are dangerous because users may run them verbatim, disrupting other processes or bypassing concurrency safeguards.

Content

Scanner excerpt · lifecycle.md (reported line 297)May include surrounding context.

md
|---------|--------------|-----|
| Script doesn't run | Missing shebang or +x | `chmod +x run.sh` |
| Auth fails | Token expired | Refresh OAuth, update secret |
| Lock held | Previous run crashed | `rm /tmp/workflow-*.lock` |
| Wrong data | Stale state | Clear state/, re-run |
| No logs | Cron redirect wrong | Check crontab syntax |

Memory Manipulation

High
Category
Memory Poisoning
Confidence
80% confidence
Finding

Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.

Content

Scanner excerpt · lifecycle.md (reported line 298)May include surrounding context.

md
| Script doesn't run | Missing shebang or +x | `chmod +x run.sh` |
| Auth fails | Token expired | Refresh OAuth, update secret |
| Lock held | Previous run crashed | `rm /tmp/workflow-*.lock` |
| Wrong data | Stale state | Clear state/, re-run |
| No logs | Cron redirect wrong | Check crontab syntax |

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · state.md (reported line 74)May include surrounding context.

Update seen (keep last 1000)

jq -r '.[].id' data/02-new.json >> state/seen.tmp tail -1000 state/seen.tmp | jq -R -s '{seen: split("\n") | map(select(. != "")), updated_at: now | todate}' > state/seen.json rm state/seen.tmp

text

## checkpoint.json

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · state.md (reported line 124)May include surrounding context.

run_node "notify"

Clear checkpoint on success

rm -f state/checkpoint.json

text

## accumulator.json

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
86% confidence
Finding

rm -rf state/* is a destructive operation that recursively deletes all state contents, and if copied into automation or run from an unexpected working directory or symlinked path, it can cause broader-than-intended data loss. In a workflow skill, users may operationalize examples directly, so destructive commands deserve stronger safeguards.

Content

Scanner excerpt · state.md (reported line 168)May include surrounding context.

bash
# Reset and re-scan
reset_state() {
  rm -rf state/*
  echo '{}' > state/cursor.json
  echo '{"seen":[]}' > state/seen.json
  log "state" "reset" "\"reason\":\"manual recovery\""

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

The recovery instruction repeats the destructive rm -rf state/* pattern in prose, encouraging operators to run a high-risk command directly. Documentation can propagate unsafe operational behavior even without attacker input, especially when copied into production runbooks.

Content

Scanner excerpt · state.md (reported line 178)May include surrounding context.

Document recovery procedure in flow.md:

markdown
## Recovery
If state corrupted: `rm -rf state/*` and re-run. 
Will reprocess all items (idempotent operations safe).

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill explicitly instructs use of HTTP requests via curl and describes persistent storage of state, logs, and intermediate data, but it does not warn users that workflow executions may transmit data to external services or retain potentially sensitive information on disk. In a workflow-automation skill, this omission increases the risk of unintended disclosure of secrets, personal data, or operational metadata because users may compose flows that fetch, transform, and log sensitive content by default.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · components.md (reported line 21)May include surrounding context.

md
- **Expires:** {if oauth, when tokens expire}

## Access
- **Base URL:** https://api.example.com/v1
- **Rate limits:** 100 req/min
- **Timeout:** 30s recommended

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · components.md (reported line 33)May include surrounding context.

md
- **Expires:** {if oauth, when tokens expire}

## Access
- **Base URL:** https://api.example.com/v1
- **Rate limits:** 100 req/min
- **Timeout:** 30s recommended

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · data-flow.md (reported line 29)May include surrounding context.

md
- **Expires:** {if oauth, when tokens expire}

## Access
- **Base URL:** https://api.example.com/v1
- **Rate limits:** 100 req/min
- **Timeout:** 30s recommended

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · data-flow.md (reported line 108)May include surrounding context.

md
- **Expires:** {if oauth, when tokens expire}

## Access
- **Base URL:** https://api.example.com/v1
- **Rate limits:** 100 req/min
- **Timeout:** 30s recommended

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · errors.md (reported line 44)May include surrounding context.

md
- **Expires:** {if oauth, when tokens expire}

## Access
- **Base URL:** https://api.example.com/v1
- **Rate limits:** 100 req/min
- **Timeout:** 30s recommended

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · errors.md (reported line 93)May include surrounding context.

md
- **Expires:** {if oauth, when tokens expire}

## Access
- **Base URL:** https://api.example.com/v1
- **Rate limits:** 100 req/min
- **Timeout:** 30s recommended

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · errors.md (reported line 121)May include surrounding context.

md
- **Expires:** {if oauth, when tokens expire}

## Access
- **Base URL:** https://api.example.com/v1
- **Rate limits:** 100 req/min
- **Timeout:** 30s recommended

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · errors.md (reported line 127)May include surrounding context.

md
- **Expires:** {if oauth, when tokens expire}

## Access
- **Base URL:** https://api.example.com/v1
- **Rate limits:** 100 req/min
- **Timeout:** 30s recommended

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · lifecycle.md (reported line 104)May include surrounding context.

md
- **Expires:** {if oauth, when tokens expire}

## Access
- **Base URL:** https://api.example.com/v1
- **Rate limits:** 100 req/min
- **Timeout:** 30s recommended

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · lifecycle.md (reported line 107)May include surrounding context.

md
- **Expires:** {if oauth, when tokens expire}

## Access
- **Base URL:** https://api.example.com/v1
- **Rate limits:** 100 req/min
- **Timeout:** 30s recommended

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · state.md (reported line 40)May include surrounding context.

md
- **Expires:** {if oauth, when tokens expire}

## Access
- **Base URL:** https://api.example.com/v1
- **Rate limits:** 100 req/min
- **Timeout:** 30s recommended

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · state.md (reported line 42)May include surrounding context.

md
- **Expires:** {if oauth, when tokens expire}

## Access
- **Base URL:** https://api.example.com/v1
- **Rate limits:** 100 req/min
- **Timeout:** 30s recommended

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · components.md (reported line 33)May include surrounding context.

Refresh (OAuth only)

bash
# Refresh token stored as: {service}_refresh_token
ACCESS=$(curl -X POST "https://api.example.com/oauth/token" \
  -d "refresh_token=$(security find-generic-password -a clawdbot -s {service}_refresh_token -w)" \
  -d "grant_type=refresh_token" | jq -r '.access_token')

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The webhook router derives WORKFLOW directly from the request path, writes attacker-controlled payloads into a workflow directory, and immediately executes ./run.sh in that derived location. Even though the markdown comments mention signature validation, the example omits actual enforcement and path sanitization, making path traversal, arbitrary workflow triggering, or unauthorized execution plausible if implemented as shown.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The file watcher example automatically runs ./run.sh on any filesystem event in the watched path, which can cause repeated, unintended, or attacker-induced workflow execution if an untrusted or shared directory is monitored. In an automation skill, this increases the chance of denial of service, duplicate side effects, or execution triggered by benign file churn.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.