Back to plugin

Security audit

Grape DevOps

Security checks for vulnerabilities and agentic risk

Overview

ClawScan marks grape-kit suspicious because it reports risks in packaging uploads and generating an installation command, without evidence of automatic execution or malicious intent.

Treat this as a review decision, not a claim that the author is malicious. Before installing, consider whether you trust the source and need the plugin’s upload and worker setup features. Avoid uploading directories containing symbolic links to sensitive files, and inspect any generated installation command before running it.

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 (2)

CWE-61

Warning
Location
src/zip.mjs:38
Finding

Skill Upload Packaging Follows Symbolic Links Outside the Selected Directory ## Remediation Suggestions 1. Use `lstat` to identify and reject symbolic links before recursion or file reads. Reject unsupported filesystem entry types. 2. Resolve the selected root and each candidate’s canonical path, then enforce containment using path-component-aware comparisons. 3. Address replacement races between validation and reading. Use no-follow file-opening options where supported and verify the opened file’s metadata. 4. Build a complete upload manifest before transmission. Present included files and total size for approval; reject entries outside the intended root. 5. Add file-count, individual-size, total-size, and recursion-depth limits. These also mitigate excessive traversal and memory consumption. 6. Add regression tests for external file links, external directory links, cyclic links, and links replaced during packaging. Apply the same protections to uploads and updates.

Content
View full analysis

Vulnerability Details

File Location: src/zip.mjs:38–47, 56–69; upload callers at src/tools.mjs:464–472, 1296–1302; network upload at src/api.mjs:331–343
Vulnerability Type: Improper Symbolic Link Resolution; Unintended File Disclosure (CWE-61)
Risk Level: Medium

Vulnerable Code

Directory collection follows symbolic links without validating the resolved target:

js
function collectFiles(dir, base, out = []) {
  for (const entry of readdirSync(dir)) {
    if (SKIP_DIRS.has(entry)) continue
    const abs = join(dir, entry)
    const st = statSync(abs)
    if (st.isDirectory()) collectFiles(abs, base, out)
    else if (st.isFile()) out.push({ abs, rel: relative(base, abs).split(sep).join('/') })
  }
  return out
}

The ZIP writer reads the collected paths:

js
const files = collectFiles(dir, dir)
js
for (const f of files) {
  const data = readFileSync(f.abs)
  const entryName = Buffer.from(`${name}/${f.rel}`, 'utf8')
  const crc = crc32(data)

The upload caller sends the resulting archive:

js
const { buffer, rootName, files } = zipDirectory(resolvePath(a.path), { rootName: pf.rootName })
const json = await api.skillUpload(buffer, `${rootName}.zip`, {
  scope,
  repo: repoFull,
  agent_type: a.agent_type,
  tags: a.tags || '',
  summary: a.summary || pf.description.slice(0, 200),
  change_note: a.change_note || '',
})

Technical Analysis

statSync() follows symbolic links. Consequently, a link inside an otherwise valid skill directory is classified according to its target. File links are subsequently read with readFileSync(), and directory links are traversed recursively.

Neither operation checks whether the resolved target remains inside the selected skill directory. The archive filename is constructed from the unresolved, in-directory path, so an external file’s contents appear in the ZIP as an ordinary skill asset.

Frontmatter preflight validation does not prevent this behavior. Both skill upload ...[truncated 1620 chars]

CWE-78

Warning
Location
src/tools.mjs:1804
Finding

Unescaped Worker Device Names Inject Shell Syntax into Generated Installation Commands ## Remediation Suggestions 1. Validate device names locally before credential creation. Apply a bounded allowlist of letters, digits, dots, underscores, and hyphens; reject whitespace, control characters, shell metacharacters, and leading option markers. 2. Shell-escape every interpolated value using a tested, platform-specific encoder. POSIX single-quote escaping and Windows command escaping require separate implementations; merely adding double quotes does not prevent command substitution. 3. Parse and validate the configured server URL. Reject control characters and prefer HTTPS. 4. Where execution is implemented, use a fixed executable and structured argument arrays without a shell instead of converting tool arguments into command text. 5. Keep the generated command visibly separate from untrusted labels or comments, and preserve explicit user approval before execution. 6. Prefer downloading a pinned, integrity-verified installer for inspection over piping an unverified response directly into Bash. 7. Add tests for command substitutions, separators, backticks, quotes, newlines, and malicious URL characters. Verify that each value is rejected or passed as literal data.

Content
View full analysis

Vulnerability Details

File Location: src/tools.mjs:1804–1839
Vulnerability Type: Shell-Command Injection in Generated Commands (CWE-78)
Risk Level: Medium

Vulnerable Code

The tool takes the device name directly from its arguments:

js
const base = getBaseUrl().replace(/\/$/, '')
const baseName = a.device_name || `grape-kit-${hostname()}`

That value becomes the credential and device name:

js
let cred
let name = baseName
const create = async (n) => (runGrape && !apiModule)
  ? runGrape(['settings', 'runtime', 'credential', 'create', '--json', JSON.stringify({ name: n, scope: 'user' })])
  : { json: await A.workerCredentialCreate(n, 'user') }
try {
  cred = await create(name)
} catch (err) {
  if (/已存在/.test(err.message || '')) {
    name = `${baseName}-${new Date().toISOString().replace(/[-:TZ.]/g, '').slice(0, 14)}`
    cred = await create(name)
  } else {
    throw err
  }
}

The generated Bash command contains the following unescaped interpolation at line 1839:

bash
curl -sSL ${base}/api/runtime/install | bash -s -- --token <TOKEN> --server ${base} --device ${name}

Technical Analysis

The device_name tool argument is an unrestricted string. The implementation does not validate its characters or shell-escape it before interpolation into an installation command.

Shell command substitutions, separators, and newlines in name therefore become executable shell syntax when the generated command is subsequently run. The configured server URL is also inserted without shell escaping.

For example, if accepted by credential creation, the device name worker-$(printf injected) causes Bash to evaluate the substitution rather than pass the device name literally. A malicious substitution could execute an additional command.

The tool itself does not execute the generated installation command. The vulnerability crosses the execution boundary only when a user or authorized agent runs the returned output.

Atta

...[truncated 1532 chars]

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

Endor dependency reachability

Checked Nov 25, 2026 · 7:40 AM UTC

Not analyzed: Endor report-only scanning is not enabled for this plugin.