Back to plugin

Security audit

Juice Compact

Security checks for vulnerabilities and agentic risk

Overview

ClawScan marks the plugin suspicious because a scanner found that its configured command restrictions can be bypassed to run additional shell commands.

Consider the gateway’s access to files, credentials, and network resources before installing. The scanner describes a static finding, not an executed attack; the evidence does not establish that credentials were stolen or data was sent out.

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

MCP05

Error
Location
dist/index.js:89
Finding

Command Prefix Allowlist Bypass Enables Arbitrary Shell Execution ## Remediation Suggestions 1. **Remove shell interpretation from restricted execution.** Replace the free-form command string with structured executable and argument fields. Execute using `execFile` or `spawn` with `shell: false`. 2. **Authorize exact executable identities.** Resolve approved executables to trusted paths and compare exact identities rather than string prefixes. Do not rely on whitespace trimming or command-name boundaries as shell security controls. 3. **Validate arguments per operation.** Restrict flags, subcommands, paths, and execution-related options. Git, npm, and similar build tools can themselves execute programs, so executable allowlisting alone is insufficient. 4. **Separate unrestricted execution from restricted operations.** Expose narrowly scoped operations for routine workloads. Require explicit authorization for a separate unrestricted shell capability, and use `allowExec: false` when execution is unnecessary. 5. **Isolate execution from the gateway.** Run commands under a dedicated low-privilege identity or sandbox with a minimal environment, restricted workspace access, controlled network egress, and no unnecessary access to credentials or transcripts. Validate `cwd` against approved directories. 6. **Add regression tests.** Cover appended commands, pipelines, substitutions, redirections, prefix-boundary confusion, and execution-capable arguments. Verify that restricted operations cannot launch an unapproved second command.

Content
View full analysis

Vulnerability Details

File Location: plugin/dist/index.js:89–96, 119–129, 132–142
Vulnerability Type: CWE-78 — Improper Restriction of Shell Commands
Risk Level: High

Vulnerable Code

The allowlist validates only the beginning of the complete shell expression:

javascript
const allow = Array.isArray(c.allowedCommands)
    ? c.allowedCommands.filter((x) => typeof x === "string" && x.trim().length > 0)
    : [];
if (allow.length > 0 && !allow.some((prefix) => command.trim().startsWith(prefix.trim()))) {
    return { allowed: false, reason: "command is outside the configured allowedCommands allowlist", rule: "allowlist" };
}
return { allowed: true };

The model-facing tool forwards accepted commands to the execution function:

javascript
execute: async ({ command, cwd, max_result_chars },
// The SDK hands plugin config through as an opaque record; validate it
// inside checkCommand rather than casting it at the call site.
config) => {
    const verdict = checkCommand(command, config);
    if (!verdict.allowed) {
        return textResult(`exec-juice refused: ${verdict.reason}`, { ok: false, refused: verdict.rule ?? "policy" });
    }
    return compactExec(command, cwd || undefined, clampBudget(max_result_chars));
},

The execution function invokes a shell with the entire accepted expression:

javascript
async function compactExec(command, cwd, budget) {
    const t0 = Date.now();
    const shell = shellForPlatform();
    const options = {
        cwd,
        timeout: TIMEOUT_MS,
        maxBuffer: MAX_BUFFER,
        ...(shell ? { shell } : {}),
    };
    try {
        const { stdout, stderr } = await execAsync(command, options);

Technical Analysis

checkCommand treats a matching string prefix as authorization for the entire command. However, child_process.exec interprets that command as shell syntax rather than as a single executable with isolated arguments.

For example, when allowedCommands contains `"git ...[truncated 2891 chars]

SkillSpector was not run because this plugin release contains no bundled skills.

Endor dependency reachability

Checked Nov 7, 2026 · 6:57 PM UTC

No reachable vulnerabilities reported

Endor dependency scan completed.