Back to skill

Security audit

Matz Swarm

Security checks for vulnerabilities and agentic risk

Overview

The skill is a disclosed automation swarm, but it gives background agents broad ability to change, push, review, and merge code with key safety prompts disabled.

Install only in a dedicated sandbox or service account with narrowly scoped repository tokens. Keep Obsidian intake trusted, avoid globally disabling agent safety prompts, require explicit approval before npm install, push, MR/PR creation, and merge, and disable or tightly control webhook notifications and cleanup until reviewed.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (3)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/config.sh:147
Finding

AI coding and review agents execute with sandbox and approval protections disabled

Content
View full analysis
&1 | tee -a "$log_file" ;; codex) echo "$prompt" | codex exec --dangerously-bypass-approvals-and-sandbox - 2>&1 | tee -a "$log_file" ;; aider) aider --yes --message "$prompt" 2>&1 | tee -a "$log_file" ;; esac } swarm_run_review() { local prompt_file="$1" case "$SWARM_REVIEW_AGENT" in codex) cat "$prompt_file" | codex exec review \ --dangerously-bypass-approvals-and-sandbox \ -c "model_reasoning_effort=high" - 2>&1 ;; claude) claude --dangerously-skip-permissions -p "$(cat "$prompt_file")" 2>&1 ;; none) echo "REVIEW_RESULT: PASS" echo "(review skipped)" ;; esac } ``` The unrestricted agent receives task and repository context assembled in `scripts/spawn-agent.sh:127-151`: ```bash { echo "You are working on project: ${PROJECT_NAME}" echo "Task: ${TASK_DESCRIPTION}" echo "Priority: ${PRIORITY}" echo "Working directory: ${WORKTREE}" echo "Branch: ${BRANCH_NAME}" echo "" echo "--- PROJECT CONTEXT ---" echo "${CONTEXT_SECTION}" echo "--- END CONTEXT ---" echo "" echo "Instructions:" echo "1. Read existing code carefully before making changes" echo "2. Follow existing code style and architecture" echo "3. Make clean atomic commits with clear messages" echo "4. When done: push branch to origin" echo "5. Do NOT create MR/PR — that will be handled automatically after review" ech ...[truncated 3160 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Error
Location
scripts/spawn-agent.sh:118
Finding

Automatic npm installation executes untrusted repository lifecycle scripts

Content
View full analysis
> "$LOG_FILE" 2>&1 echo " ✓ Done" fi ``` ### Technical Analysis The workflow automatically runs `npm install` whenever a cloned repository contains `package.json`. By default, npm installation can execute package and project lifecycle hooks, including `preinstall`, `install`, and `postinstall`. These hooks are executable code and run with the privileges and environment of the swarm user. The repository may be newly cloned immediately before this operation, and there is no trust verification, lockfile enforcement, package integrity policy, script suppression, isolation, or user confirmation. Consequently, a malicious repository or compromised transitive dependency can execute code before the AI review phase begins. This issue is distinct from the unrestricted AI-agent finding: exploitation does not require prompt injection or model cooperation. Merely spawning a task against a repository containing a malicious lifecycle script can trigger execution. ### Attack Path 1. An attacker creates, compromises, or gains contribution control over a repository configured in `registry.json`. 2. The repository contains a malicious lifecycle entry, for example a `postinstall` script, or references a compromised dependency with such a script. 3. A user or the scheduled Obsidian scanner starts a task for that project. 4. `spawn-agent.sh` clones or updates the repository and creates a worktree. 5. The script detects `package.json` and invokes `npm install` automatically. 6. npm executes the malicious lifecycle hook under the swarm user's account. 7. The payload can read accessible ...[truncated 832 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/new-project.sh:9
Finding

Unvalidated project names permit filesystem path traversal during project initialization

Content
View full analysis
[obsidian-note]" && exit 1 log() { echo "[new-project] $1"; } log "Initializing project: $PROJECT_NAME" REPO_URL=$(swarm_repo_url "$PROJECT_NAME") LOCAL_REPO="${SWARM_REPO_BASE}/${PROJECT_NAME}" CONTEXT_FILE="${SWARM_DIR}/projects/${PROJECT_NAME}/context.md" OBS_NOTE="${SWARM_OBSIDIAN_DIR}/${PROJECT_NAME}.md" OBS_TEMPLATE="${SWARM_OBSIDIAN_DIR}/_template.md" ``` The derived paths are later used for filesystem operations at `scripts/new-project.sh:27-46`: ```bash mkdir -p "$(dirname "$LOCAL_REPO")" "$SWARM_WORKTREE_BASE" if [ ! -d "${LOCAL_REPO}/.git" ]; then log "Cloning repo..." git clone "$REPO_URL" "$LOCAL_REPO" 2>/dev/null || { cd "$LOCAL_REPO" git init git remote add origin "$REPO_URL" echo "# $PROJECT_NAME" > README.md git add README.md git commit -m "init: project scaffold" git branch -M main git push -u origin main } log "✓ Local repo ready" fi mkdir -p "$(dirname "$CONTEXT_FILE")" if [ ! -f "$CONTEXT_FILE" ]; then ``` ### Technical Analysis `PROJECT_NAME` is accepted without validation and concatenated directly into repository, context, and Obsidian paths. Shell quoting prevents command substitution and word splitting, but it does not prevent path traversal. Components such as `../` are resolved by the filesystem after concatenation. For example, a directly supplied project name containing traversal components can cause `LOCAL_REPO`, `CONTEXT_FILE`, or `OBS_NOTE` to resolve outside their intended base directories. The later `mkdir`, clone, initialization, and file-creation operations then act on those escaped paths. Existing-file checks reduce some overwrite ...[truncated 2015 chars]
Remediation
View remediation
&2 exit 1 fi ``` 2. Explicitly reject `.` and `..`, path separators, leading hyphens, control characters, shell metacharacters, and newline characters. 3. Canonicalize each derived path with `realpath` or an equivalent implementation before use. 4. Verify that every canonical path remains beneath its expected canonical base directory. 5. Apply the same validation to provider repository names so filesystem and remote-provider naming policies remain consistent. 6. Refuse to register a project if `local_repo`, context, or note paths fall outside approved roots. 7. Add tests covering traversal strings, absolute paths, Unicode separator edge cases, newlines, and option-like names. 8. When initialization is triggered through a conversational intent, display the normalized project slug and require confirmation if it differs from the supplied value. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (28)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The README explicitly instructs users to disable Claude Code's dangerous-mode permission prompt for unattended automation, which removes an interactive safeguard before potentially destructive actions. In the context of an autonomous coding orchestrator that creates worktrees, edits code, pushes changes, and runs on cron, this materially increases the chance of unintended destructive operations or prompt-injection-driven abuse proceeding without human review.

Content

No source excerpt is available for this finding.

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
93% confidence
Finding

Pointing users to modify ~/.claude/settings.json to disable safety prompts affects the agent's global configuration, not just this project. That broadens the blast radius: once changed, other sessions and repositories may inherit reduced protections, enabling unsafe actions outside the intended automation workflow.

Content

Scanner excerpt · README.md (reported line 115)May include surrounding context.

md
claude login

# Skip permission prompts (required for automation)
# In ~/.claude/settings.json:
{ "skipDangerousModePermissionPrompt": true }

# Trust worktree directories (avoids trust dialog per worktree)

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
96% confidence
Finding

The skill references and relies on sensitive agent configuration under ~/.claude/settings.json and adjacent auth/trust files, including settings that suppress dangerous-mode prompts and mark directories as trusted. Access to or dependence on these files increases the blast radius of compromise because a triggered workflow may run with elevated trust assumptions and inherited credentials.

Content

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

md
### Claude Code CLI
- Authenticated via OAuth (`~/.claude.json` oauthAccount)
- `~/.claude/settings.json`: `skipDangerousModePermissionPrompt: true`
- `~/.claude.json` projects: trust `~/GitLab/worktrees` and `~/GitLab/repos` (`hasTrustDialogAccepted: true`)
- No `ANTHROPIC_*` env vars leaking into tmux (causes proxy conflicts)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill instructs immediate execution of merge operations without confirmation once a matching phrase is seen in context. Merging a merge request is a destructive repository action that can change protected branches, deploy code downstream, and close review windows, so skipping an explicit confirmation step is dangerous.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The coding and review helpers invoke external agents with explicit sandbox/approval bypass flags such as '--dangerously-skip-permissions' and '--dangerously-bypass-approvals-and-sandbox'. In an agent-swarm context, prompts and prompt files may contain attacker-influenced content, so removing tool safety controls materially increases the risk of unauthorized command execution, file access, secret exposure, and destructive actions on the host or repositories.

Content

No source excerpt is available for this finding.

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
98% confidence
Finding

The helper runs Claude with '--dangerously-skip-permissions', explicitly disabling a key safety boundary while feeding it arbitrary prompt content. In an automation environment this is dangerous because prompts can be indirectly attacker-controlled, enabling prompt-triggered actions that access sensitive files, alter code, or invoke external tools without normal approval checks.

Content

Scanner excerpt · scripts/config.sh (reported line 151)May include surrounding context.

sh
local prompt="$1" log_file="$2"
    case "$SWARM_CODING_AGENT" in
        claude)
            claude --dangerously-skip-permissions -p "$prompt" 2>&1 | tee -a "$log_file"
            ;;
        codex)
            echo "$prompt" | codex exec --dangerously-bypass-approvals-and-sandbox - 2>&1 | tee -a "$log_file"

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
98% confidence
Finding

This review helper reads prompt content from a file and passes it to Claude with '--dangerously-skip-permissions', combining potentially untrusted file content with disabled safety checks. In this skill context, that makes prompt injection and unsafe tool use more dangerous because review inputs may originate from repositories, tasks, or other automated components rather than a trusted human operator.

Content

Scanner excerpt · scripts/config.sh (reported line 172)May include surrounding context.

sh
-c "model_reasoning_effort=high" - 2>&1
            ;;
        claude)
            claude --dangerously-skip-permissions -p "$(cat "$prompt_file")" 2>&1
            ;;
        none)
            echo "REVIEW_RESULT: PASS"

Session Persistence

Medium
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · README.md (reported line 85)May include surrounding context.

5. Set up cron

bash
crontab -e
text

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The documentation describes autonomous task spawning, code modification, merge request creation, and cleanup/removal behavior without a prominent safety warning or controls guidance. In this skill's context, those behaviors can lead to unauthorized code changes, accidental execution of malicious task content, or deletion of worktrees/logs with limited operator awareness, especially when triggered by cron or Obsidian note state changes.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The top-level description says to use the skill when a user says generic terms like "合并"/"merge" or asks about status, without strict boundaries. Because the skill can launch agents, create merge requests, and merge code, an imprecise activation description materially raises the chance of the orchestration running on casual or misinterpreted input.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
95% confidence
Finding

The instruction to take action immediately without asking for confirmation enables autonomous execution of repository operations based on natural-language matching alone. In this context, the actions include spawning agents, running status scripts, creating projects, and initiating merges, so removing human confirmation makes accidental or manipulated execution more likely.

Content

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

md
## Intent → Action Mapping

When a user message matches one of these intents, take the corresponding action immediately without asking for confirmation:

| User says | Context | Action |
|-----------|---------|--------|

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger phrases are broad and include common language like "merge," "spawn," and "check status," which can cause accidental activation from ordinary conversation. In this skill, those activations map directly to operational shell scripts affecting repositories and merge requests, so ambiguous matching increases the risk of unintended actions.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
76% confidence
Finding

The guardrail states the skill should not read project source code, diagnose issues, or design solutions itself. However, the same document describes a workflow that creates prompts with project context, runs coding and review agents against repository worktrees, and processes project-specific merge requests, which means the overall skill does engage with project code as part of its operation. This is an intent/documentation contradiction rather than a mere omission.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The script rewrites the tasks state file by creating a temporary file and moving it into place, and later updates note files as part of automated status changes. While there is internal logging, there is no user-facing disclosure, confirmation, or explanatory comment warning that this cron monitor will modify task metadata and note content automatically.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
65% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/check-agents.sh (reported line 36)May include surrounding context.

sh
if [ "$HAS_COMMITS" -gt 0 ]; then
        log "Agent done with $HAS_COMMITS commits, triggering review..."
        jq --arg id "$TASK_ID" '.tasks |= map(if .id == $id then .status = "reviewing" else . end)' "$TASKS_FILE" > "${TASKS_FILE}.tmp" && mv "${TASKS_FILE}.tmp" "$TASKS_FILE"
        nohup "$SCRIPTS_DIR/review-and-push.sh" "$TASK_ID" >> "${LOGS_DIR}/${TASK_ID}.log" 2>&1 &
      else
        log "no-output: $TASK_ID"
        jq --arg id "$TASK_ID" '.tasks |= map(if .id == $id then .status = "no-output" else . end)' "$TASKS_FILE" > "${TASKS_FILE}.tmp" && mv "${TASKS_FILE}.tmp" "$TASKS_FILE"

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The script launches another script in the background with nohup to perform review-and-push automation. This is a consequential subprocess action, but the file lacks a clear user-facing warning or descriptive comment that the monitor will automatically trigger downstream execution when certain conditions are met.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

When a merge request is detected as merged, the script rewrites the user's note file and may invoke a sync script that alters project state. These actions are operationally significant, but the script does not include a clear disclosure that merged-MR detection will trigger automatic writeback and synchronization behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This shell script force-removes git worktrees and recursively deletes directories, and also deletes old log and marker files via find ... -delete. Although it writes to a log file, there is no visible user disclosure, confirmation prompt, or explanatory warning to the user before these destructive operations occur.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The file banner says this is 'Shared configuration for Agent Swarm scripts', which implies a configuration/helper role. In addition to setting variables, the script defines functions that create and merge merge requests, create repositories, invoke coding/review agents with dangerous bypass flags, and send outbound notifications/webhooks, which materially exceeds a pure configuration purpose.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The helpers create merge requests/pull requests and can merge them or create repositories on remote Git hosting services, which are externally visible and potentially irreversible actions. While the code comments describe implementation details, they do not provide a user-facing warning, confirmation, or disclosure about these remote write operations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The notification helper can send arbitrary message content to external services (OpenClaw or a configured webhook) with no validation, allowlist, or user disclosure at the point of use. In an agent system, messages may contain task content, secrets, repository metadata, or model output, so this creates a real exfiltration path if upstream components pass sensitive data or if configuration is tampered with.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

This curl call posts message data to a configurable external URL, creating a direct outbound data transmission channel. Because the target is configuration-controlled and the payload is arbitrary text, a compromised config or unsafe caller could exfiltrate secrets, internal task data, or repository details without meaningful safeguards.

Content

Scanner excerpt · scripts/config.sh (reported line 190)May include surrounding context.

sh
--target "$SWARM_NOTIFY_TARGET" --message "$msg" >/dev/null 2>&1
            ;;
        webhook)
            curl -s -X POST "$SWARM_NOTIFY_TARGET" \
                -H "Content-Type: application/json" \
                -d "{\"text\": $(echo "$msg" | jq -Rs .)}" >/dev/null 2>&1
            ;;

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script launches swarm_run_coding_agent inside tmux to autonomously modify repository contents based on parsed review output, with no human approval before execution and no constraint beyond prompt text. Because the review output can drive code changes and the agent operates on the worktree directly, this creates a risky self-modifying loop that can introduce malicious, destructive, or incorrect changes that later get committed and pushed.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script automatically performs git push and creates a merge request after review without any interactive confirmation, dry-run gate, or explicit approval step. In an agent-driven workflow this can publish unintended, unsafe, or policy-violating changes to a remote repository, especially because earlier steps may have been influenced by autonomous review/fix behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This script automatically converts note content into live task executions by invoking spawn-agent.sh and then mutating the source note status, all without any approval gate, authentication check, or user-visible confirmation. In context, Obsidian notes are editable content rather than a trusted control plane, so any note marked status: ready can trigger autonomous actions and create a reliable path for unintended or attacker-influenced task execution.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.