T05 · Unauthorized Access and Privilege Escalation
- Location
shark.sh:69- Finding
Claude Is Executed with Permission Checks Disabled
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill has a coherent async-agent purpose, but it grants broad background execution and permission-bypassed Claude runs without enough user control or containment.
Install only if you explicitly want an agent to spawn subagents, run long shell commands in the background, and manage recurring pollers. Avoid the bundled shark.sh unless you remove the Claude permission-bypass flag or run it in a sandbox. Review and pin any remote install source, keep state files private, and do not use this with commands or logs that may contain secrets.
shark.sh:69Claude Is Executed with Permission Checks Disabled
shark.sh:45Mutable State Is Injected Directly into a Privileged Agent Prompt
shark-exec/SKILL.md:87Background Pollers May Persist Beyond the Initiating Skill Run
README.md:133Installation Instructions Retrieve Mutable, Unverified Remote Content
shark-exec/SKILL.md:58Full Commands and Process Output Are Persisted and Forwarded Without Redaction
Code or instructions that leak agent conversation context to external services, potentially exposing sensitive user interactions.
│ spawn N remoras (+ 1 pilot fish when first completes early)
▼
┌─────────────┐
│ SPAWN │ sessions_spawn × N, all parallel, record session IDs
└──────┬──────┘
│ main agent keeps reasoning (never waits)
▼
Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.
rm -f "$_timeout_flag"
claude --print --permission-mode bypassPermissions < "$_prompt_file" &
_claude_pid=$!
(
The script invokes claude with --permission-mode bypassPermissions, which disables normal safety/authorization controls while feeding it task text, skill instructions, and pending state that may all be adversarial. In a loop runner, this grants the model repeated unrestricted execution opportunities, making prompt-injection or unsafe tool use materially more dangerous than necessary for the stated purpose.
Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.
# Install as a skill (full repo with shark-exec)
mkdir -p ~/.claude/skills
git clone https://github.com/keugenek/shark-pattern ~/.claude/skills/shark
Add to CLAUDE.md:
The installation instructions place the skill under a persistent per-user agent skills directory and tell the user to reference it from CLAUDE.md, creating durable behavioral influence across future sessions. In the context of agent skills, persistence increases risk because any unsafe or later-compromised skill content continues affecting subsequent tasks until manually removed.
# Install as a skill (full repo with shark-exec)
mkdir -p ~/.claude/skills
git clone https://github.com/keugenek/shark-pattern ~/.claude/skills/shark
Add to CLAUDE.md:
Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.
Add to CLAUDE.md:
## Execution Model
See ~/.claude/skills/shark/SKILL.md — use the Shark Pattern for any multi-step task with slow tools.
Or drop just the SKILL.md:
The trigger phrases are very broad natural-language commands such as 'Use shark mode', 'Keep swimming', and 'Never wait for tools'. In agents that auto-load nearby instruction files, these generic phrases can unintentionally activate the skill in unrelated conversations and push the agent into spawning background tasks or changing execution behavior without clear user consent.
The skill can auto-activate not only on explicit user requests but also when the agent 'notices' it may block on a slow tool. That broad heuristic can cause the agent to change execution mode, spawn subagents, or initiate background work without clear user consent, increasing the chance of unexpected tool use and side effects.
The skill encourages spawning background workers and maintaining asynchronous state across turns, which creates persistence beyond a single user-visible action. Without strict lifecycle controls and consent boundaries, background agents may continue running, consume resources, or act on stale context after the user no longer expects activity.
- "use the shark pattern"
- "non-blocking agent"
- "never wait for tools"
- "spawn background workers"
- "parallel subagents"
- "keep the main agent moving"
- or when you notice you're about to block on a slow tool (web fetch, SSH, build, test run, API call)
The skill normalizes killing or tearing down subprocesses/subagents on timeout or completion without requiring a user-visible warning about interruption, unsaved work, or partial outputs. In practice, this can terminate active tasks abruptly and lead to lost state, incomplete edits, or inconsistent results, especially when external tools or long-running jobs are involved.
The installation command uses npx clawhub@latest install shark, which fetches and executes the latest published package version at runtime rather than a pinned, reviewed version. In a skill-distribution context this creates a supply-chain execution risk: if the package, a dependency, or the distribution account is compromised, users may run attacker-controlled code directly from the promotional instructions.
The suggested trigger phrases — such as Use shark mode for this, Non-blocking — spawn where needed, and especially Keep swimming — are broad, natural-language expressions that could appear in normal conversation or unrelated prompts. If the skill system activates on these phrases, the skill may be invoked unintentionally, causing unexpected spawning behavior, altered execution flow, or unsafe tool use in contexts where the user did not explicitly intend to enable this skill.
The skill is explicitly designed around background execution and persistent polling of shell commands, which increases the risk that untrusted or dangerous commands continue running outside the main interaction flow. Because the pattern encourages session persistence plus scheduled polling and notification, misuse could enable long-lived unauthorized execution, harder-to-audit actions, or persistence of sensitive command output in files and notifications.
This must be the **first thing you do** — before exec, before writing state. Silence = failure.
### Step 2 — Launch Background Process
Launch the command in the background using your agent's background execution primitive (see [Runtime Adapters](#runtime-adapters) below).
The skill instructs the agent to read and modify a shared state file and elsewhere explicitly says to reset corrupted pending.json to an empty jobs list. That creates a real integrity and availability risk: concurrent jobs, malformed input, or partial writes can cause job loss, orphaned processes, or accidental deletion of tracking state without operator confirmation.
The header states each iteration is one bounded Claude turn and 'Never blocks >30s per loop,' yet the script's actual task completion mechanism relies on Claude writing .shark-done and progress files outside the script itself. While the Claude subprocess is timeout-bounded, the documented framing overstates what the script itself guarantees about successful bounded loop behavior and completion semantics.
The script executes Claude with bypassed permissions without an explicit warning or informed-consent step for the user. Because the tool is being run on arbitrary task text and skill content, the absence of a clear warning increases the risk that users unknowingly authorize unsafe operations or overtrust the loop wrapper.
The README repeatedly instructs users to fetch remote content with curl and clone a repository into agent skill directories, but it does not warn that this imports unreviewed instructions/code into trusted agent context. In an agent-skill setting, downloaded prompt files can alter model behavior persistently, making this more sensitive than ordinary package installation guidance.
No suspicious patterns detected.