Back to skill

Security audit

Kannaka

Security checks for vulnerabilities and agentic risk

Overview

The skill is a memory and swarm CLI wrapper, but it directs agents to install and run an unreviewed native binary with broad local, network, paid-service, and persistent configuration powers.

Install only if you trust the publisher and are comfortable running a downloaded native binary with your user permissions. Prefer a sandbox or test account, pin and verify the release yourself, avoid yolo mode, do not join swarms with sensitive project or memory data, and check qBraid device selection before any hardware run that could spend credits.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Tool Hijacking and SpoofingModifies or replaces tools so legitimate-looking calls execute attacker logic
  • 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
Findings (4)

T03 · Remote Payload Retrieval and Execution

Error
Location
SKILL.md:20
Finding

Unreviewable Remote Binary Retrieval and Execution

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 20-21, 30, and 77
Vulnerability Type: Remote payload retrieval and execution
Risk Level: High

Vulnerable Code Snippet:

markdown
If none exists, run **`/kannaka install`** (downloads the binary from GitHub releases).
Data dir defaults to `~/.kannaka` (override with `KANNAKA_DATA_DIR`).

| `install [tag]` | Run `bash "${CLAUDE_PLUGIN_ROOT}/scripts/install-binary.sh" [tag]` — fetch the kannaka binary for this OS/arch from GitHub releases (default `latest`), sha256-verified, into `~/.local/bin`. |

- All commands shell out to the resolved binary, e.g. `"$KANNAKA_BIN" recall "query" --top-k 5`.

Technical Analysis

The Skill directs the agent to download a native executable from an external GitHub release and execute it for all subsequent operations. The project artifact does not include the referenced scripts/install-binary.sh, an immutable release URL, a pinned version, an expected digest, a signature, or an independently authenticated checksum source. Consequently, the claimed SHA-256 verification cannot be validated from the reviewed project.

The default release selector is latest, so the effective executable can change after the Skill has been reviewed. Hash verification alone would not establish trust if the executable and checksum are obtained from the same compromised source.

Attack Path

  1. An attacker compromises the external release repository, release publishing credentials, download path, or missing installer.
  2. The user invokes /kannaka install, or installation is initiated because no local binary is found.
  3. The installer retrieves an attacker-controlled native executable.
  4. The executable passes any checksum hosted alongside the compromised release.
  5. A documented Kannaka command executes the downloaded binary with the invoking user's permissions.
  6. The payload can use the advertised shell, filesystem, memory, ...[truncated 427 chars]
Remediation
View remediation

Remediation Suggestions

  • Bundle the installer in the reviewed project so its behavior can be audited.
  • Pin an immutable release version and exact expected SHA-256 digest instead of using latest.
  • Hardcode and validate the expected HTTPS repository and publisher identity.
  • Verify a cryptographic release signature against a public key distributed independently of the release.
  • Do not retrieve the executable and integrity metadata solely from the same trust domain.
  • Require explicit user approval before downloading or executing native code.
  • Display the source URL, version, digest, destination, and signature status before installation.
  • Run the executable with sandboxed filesystem and network permissions wherever possible.

T07 · Tool Hijacking and Spoofing

Warning
Location
SKILL.md:13
Finding

Executable Substitution Through Environment Variable and PATH Resolution

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 13-18 and 77
Vulnerability Type: Tool hijacking and spoofing
Risk Level: Medium

Vulnerable Code Snippet:

markdown
Resolve the `kannaka` binary in this order and use the first hit:
1. `$KANNAKA_BIN` (if set and executable)
2. `~/.local/bin/kannaka.exe` (Windows) or `~/.local/bin/kannaka` (Linux/macOS)
3. `~/.kannaka/bin/kannaka.exe` (Windows) or `~/.kannaka/bin/kannaka` (Linux/macOS)
4. `kannaka.exe` (Windows) / `kannaka` (Linux/macOS) on `PATH`

- All commands shell out to the resolved binary, e.g. `"$KANNAKA_BIN" recall "query" --top-k 5`.

Technical Analysis

The resolution procedure gives highest priority to the KANNAKA_BIN environment variable and ultimately falls back to a same-name executable found on PATH. Checking only whether a file is executable does not establish its identity, ownership, integrity, or provenance.

A process that controls the environment can redirect KANNAKA_BIN to an arbitrary executable. Likewise, an attacker who can place a file named kannaka or kannaka.exe in an earlier PATH directory can replace the expected tool. Quoting the resolved path prevents shell word splitting but does not prevent substitution of the executable itself.

Attack Path

  1. An attacker gains control over the invoking process environment, shell profile, automation configuration, or a directory early in PATH.
  2. The attacker sets KANNAKA_BIN to a malicious executable or plants a counterfeit kannaka binary.
  3. The user invokes a legitimate-looking Kannaka operation.
  4. The Skill selects the first executable candidate without validating its digest, signature, ownership, or trusted installation directory.
  5. The substituted executable runs with the user's permissions and receives command arguments or memory content intended for the legitimate tool.

Impact Assessment

Exploitation enables arbitrary code executi ...[truncated 263 chars]

Remediation
View remediation

Remediation Suggestions

  • Resolve the executable from a fixed, trusted absolute installation path.
  • Validate its pinned digest or cryptographic signature before every execution.
  • Verify that the executable and parent directories have trusted ownership and are not writable by untrusted users.
  • Reject environment-variable overrides by default.
  • If custom executable paths are necessary, require explicit user consent and perform the same integrity checks.
  • Avoid unrestricted PATH lookup, or compare the resolved canonical path against an allowlist.
  • Log the canonical executable path and verified version before invoking it.

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:54
Finding

Broad Autonomous, Network, and Paid-Service Capabilities Lack Defined Security Gates

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 54-75
Vulnerability Type: Excessive autonomous privileges and untrusted external interaction
Risk Level: Medium

Vulnerable Code Snippet:

markdown
### Agentic coding loop
| Command | Description |
|---------|-------------|
| `agent "<task>"` | Autonomous coding loop with filesystem/shell tools, backed by the HRM (it `recall`s context and `remember`s insights). Flags: `--cwd`, `--mode default\|yolo\|plan` (or `--yolo`/`--plan`), `--session <id>`, `--model`, `--json` (NDJSON harness backend), `--no-memory-tools`, `--no-quantum`. |

### Quantum (qBraid)
| Command | Description |
|---------|-------------|
| (agent tools) | `quantum_devices` / `quantum_run` / `quantum_recall` / `quantum_random` — real quantum computing via qBraid, available inside `agent`. Default device is the **free** simulator; naming a QPU runs on hardware and spends credits. `quantum_recall` runs resonance recall as amplitude amplification. Disable with `--no-quantum`. Standalone CLI/MCP: the `kannaka-quantum` package. |

### Swarm (NATS)
| Command | Description |
|---------|-------------|
| `swarm join` | Join the QueenSync swarm over NATS |
| `swarm status` | Swarm phase snapshot (peers, frequency, coherence) — JSON |
| `swarm sync` | Force a phase sync round |
| `swarm brief "<topic>"` | Sensemaking brief (ADR-0035; `--peers` for swarm consensus, `--json`) |
| `swarm health` | Memory immune report (dry-run); `--apply` runs reversible actions (down-rank/quarantine/expire) |
| `swarm gaps` | Knowledge-gap report — weakly-represented / low-confidence domains (ADR-0035, `--json`) |
| `swarm plan` | Research plan — ranks gaps into directed research tasks (ADR-0035 Wave 4, `--json`) |
| `swarm loop` | Self-directed sensemaking cycle through the 5 swarm states (ADR-0035 Wave 4) |
| `inbox tail` | Stream agent-to-agent inbox messages |

Technica

...[truncated 1873 chars]

Remediation
View remediation

Remediation Suggestions

  • Remove yolo mode or require explicit, informed opt-in for each session.
  • Sandbox shell execution and constrain filesystem access to an approved working directory.
  • Require confirmation before destructive commands, writes outside the project, outbound transfers, and paid operations.
  • Apply network endpoint allowlists and document the exact NATS and qBraid endpoints.
  • Enforce authentication, transport encryption, and peer authorization for swarm functionality.
  • Treat inbox and swarm messages strictly as untrusted data, not executable instructions.
  • Redact secrets and sensitive memory content before external transmission.
  • Disable quantum and swarm functionality by default and impose configurable spending limits.
  • Provide detailed, reviewable audit logs for shell, filesystem, memory, network, and paid-service actions.

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:31
Finding

Persistent Claude Configuration Modification Through an Absent External Script

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 31-34
Vulnerability Type: Unsafe configuration modification
Risk Level: Medium

Vulnerable Code Snippet:

markdown
| `statusline on` | Run `bash "${CLAUDE_PLUGIN_ROOT}/statusline/setup.sh" on` — enable the live HRM+swarm statusline (copies the script to `~/.claude/kannaka/`, wires `settings.json` with a forward-slash path + `refreshInterval: 2`). |
| `statusline off` | Run `bash "${CLAUDE_PLUGIN_ROOT}/statusline/setup.sh" off` — restore the previous statusLine. |
| `statusline status` | Run `bash "${CLAUDE_PLUGIN_ROOT}/statusline/setup.sh" status`. |

After `statusline on`, tell the user to restart the session (or wait one render) to see it.

Technical Analysis

The Skill executes statusline/setup.sh from the path supplied through CLAUDE_PLUGIN_ROOT. That script is not present in the reviewed artifact, so its behavior, path handling, backup process, permissions, and rollback logic cannot be verified.

The operation copies executable content into ~/.claude/kannaka/ and modifies settings.json, causing behavior to continue in later renders or sessions. If CLAUDE_PLUGIN_ROOT resolves to an attacker-controlled directory, the command directly executes the attacker's script. Even when the intended script is used, unsafe or non-atomic configuration editing could corrupt settings or overwrite unrelated configuration.

Attack Path

  1. An attacker controls or influences CLAUDE_PLUGIN_ROOT, or replaces content beneath that directory.
  2. The user invokes statusline on, off, or status.
  3. Bash executes the unverified statusline/setup.sh.
  4. The script modifies Claude configuration or places executable statusline content under the user's home directory.
  5. The installed statusline is invoked during subsequent rendering or sessions, extending the effect beyond the initial command.

Impact Assessment

Exploitation may permit a ...[truncated 282 chars]

Remediation
View remediation

Remediation Suggestions

  • Include statusline/setup.sh in the reviewed project and subject it to security review.
  • Resolve and validate CLAUDE_PLUGIN_ROOT against a trusted canonical plugin directory.
  • Verify the script's signature or pinned digest before execution.
  • Show the exact configuration diff and obtain user approval before applying it.
  • Modify only the documented statusline keys and preserve unrelated settings.
  • Use atomic file replacement, restrictive permissions, and timestamped backups.
  • Validate JSON before committing changes and provide a tested rollback path.
  • Avoid copying mutable executable scripts into persistent configuration directories where possible.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill instructs the agent to run installer and statusline setup scripts that download a binary from GitHub releases and modify local user configuration, but it does not require an explicit warning or confirmation before making those system changes. In an agent-skill context, this is dangerous because users may invoke the skill expecting informational assistance while the skill performs persistence-oriented actions such as writing to ~/.local/bin, copying scripts, and editing settings.json.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The documented agent command advertises an autonomous coding loop with filesystem and shell tools, including a yolo mode, but provides no safety boundary, approval requirement, or warning about command execution and file modification. This increases risk because the skill context is explicitly agentic and memory-backed, making it more likely that a user triggers broad local actions with insufficient review.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The swarm and inbox commands describe joining a NATS-based swarm, syncing, briefing, and tailing inter-agent messages, but they do not warn that data may be transmitted to peers or external services. In this skill's context, that omission is material because memory, prompts, and other potentially sensitive workspace context could be shared over the network without the user understanding the privacy implications.

Content

No source excerpt is available for this finding.