Is JuliusBrussee/caveman safe?
- Python shell/command execution
- Node.js shell/command execution
- Defense-evasion command idiom
What to do: Nothing here argues against installing it. Grant the capabilities it lists only if you expect the tool to need them.
JuliusBrussee/caveman is an npm package analyzed by SkillTotal's deterministic static scanner. The scan found no malicious indicators, though 1 risky construct is reported for review. It can: delegated authentication, dynamic code execution, filesystem read, filesystem write, mcp tools detected, network egress and shell execution — capabilities are what the code can do, not a verdict on intent. Risk score 20/100 (low).
caveman-installer 3.2.0
Automated static-analysis result. It can contain false positives and false negatives, and is not a claim about the intent of JuliusBrussee/caveman's authors. Report a false positive.
Behavioral traits
How this component maps to the CSA agentic threat model. Descriptive — it never affects the risk score.
Findings (12)
The code turns strings into live code at runtime (eval / new Function / exec).
new Function('module', 'exports', 'require', '__dirname', '__filename', code)(new Function('module', 'exports', 'require', '__dirname', '__filename', code)(Why it matters: If those strings aren't fixed and trusted, they become a way to run arbitrary code.
Fix: Avoid evaluating dynamically constructed code; if unavoidable, ensure the input is a trusted constant and never derived from external data.
A command uses a known defense-evasion idiom: PowerShell execution-policy bypass / encoded command / hidden window, macOS code-signing bypass, or launching a payload from a world-writable temp directory. These are hallmarks of droppers and rarely appear in legitimate code. (7 occurrence(s) shown as evidence).
? `powershell -ExecutionPolicy Bypass -File "${scriptPath}"`command: 'powershell -ExecutionPolicy Bypass -File "' + managedStatusLinePath + '"'
Fix: Verify why the component bypasses execution policy / code signing or runs from a temp directory; these patterns are characteristic of malware staging.
The component can run operating-system commands or spawn processes.
import { spawnSync } from "node:child_process";return spawnSync("git", args, { cwd, encoding, maxBuffer: 8 * 1024 * 1024 });import { spawn } from "node:child_process";const child = spawn(invocation.command, invocation.args, {import { spawnSync } from "node:child_process";import { spawnSync } from "node:child_process";const result = spawnSync("gh", argv, { encoding: "utf8" });import { spawnSync } from "node:child_process";const result = spawnSync(invocation.command, invocation.args, { env, encoding: "utf8", timeout: 15_000 });import { spawn } from "node:child_process";const child = spawn(bin, process.argv.slice(2), { stdio: "inherit" });import { spawn, spawnSync } from "node:child_process";const r = spawnSync(binary, ["--version"], { encoding: "utf8", timeout: 15000 });const b = spawnSync(process.execPath, ["scripts/build-extension-zip.mjs", "firefox"], { cwd: EXT_ROOT, encoding: "utf8", timeout: 60000 });wex = spawn(invocation.command, invocation.args, invocation.options);
try { spawnSync("taskkill", ["/PID", String(wex.pid), "/T", "/F"], { timeout: 10000 }); } catch { /* ignore */ }const child_process = require('child_process');const r = child_process.spawnSync('sh', ['-c', `command -v ${shellEscape(cmd)}`], { stdio: 'ignore' });return child_process.spawnSync(invocation.command, invocation.args, opts || {});return child_process.spawnSync(cmd, args, opts || {});const r = child_process.spawnSync('/bin/sh', ['-c', 'command -v node'], { encoding: 'utf8' });const probe = child_process.spawnSync(resolved, ['--version'], { encoding: 'utf8' });const r = child_process.spawnSync('curl', ['-fsSL', '-o', dest, url], { stdio: 'inherit' });import { spawn } from "node:child_process";const child = spawn(bin, process.argv.slice(2), { stdio: "inherit" });Why it matters: Powerful and often legitimate — confirm the commands aren't built from untrusted input.
Fix: Confirm the command and its arguments are fully controlled and not derived from untrusted input; prefer execFile with an argument array.
The component can run operating-system commands or spawn processes.
result = subprocess.run(command, input=data, env=env, cwd=root, capture_output=True, timeout=timeout)
process = subprocess.Popen([str(proxy), "serve"], env=env, cwd=root, stdout=log, stderr=log)
out = subprocess.run(
cmd, capture_output=True, text=True, check=True, cwd=cwd,
encoding="utf-8", errors="replace", stdin=subprocess.DEVNULL,
timeout=CALL_TIMEOUT,
)out = subprocess.run(
[claude_bin(), "--version"], capture_output=True, text=True,
check=True, encoding="utf-8", errors="replace",
)out = subprocess.run(
["node", str(hooks / TRACKER)], cwd=tmp, env=env,
input=json.dumps({"prompt": "ordinary prompt"}),
capture_output=True, text=True, check=True, encoding="utf-8",
)out = subprocess.run(
cmd, capture_output=True, text=True, check=True, env=env,
encoding="utf-8", errors="replace", stdin=subprocess.DEVNULL,
)base_src = subprocess.run(
["git", "show", f"{args.base}:src/hooks/{TRACKER}"], cwd=ROOT,
capture_output=True, text=True, check=True, encoding="utf-8",
).stdoutbase_sha = subprocess.run(
["git", "rev-parse", "--short", args.base], cwd=ROOT,
capture_output=True, text=True, check=True,
).stdout.strip()proc = subprocess.run([_binary(), *args], **kwargs)
result = subprocess.run(command, **run_kwargs)
result = subprocess.run(command, **run_kwargs)
Why it matters: Powerful and often legitimate — confirm the commands aren't built from untrusted input.
Fix: Confirm the command and its arguments are fully controlled and not derived from untrusted input; avoid shell=True.
The component reads files from disk.
return fallbackCanonicalMode(JSON.parse(fs.readFileSync(file, 'utf8')).defaultMode);
const parsed = JSON.parse(fs.readFileSync(p, 'utf8'));
const v = fs.readFileSync('/proc/version', 'utf8').toLowerCase();const rule = fs.readFileSync(path.join(repoRoot, 'src', 'rules', 'caveman-activate.md'), 'utf8').trimEnd();
const raw = fs.readFileSync(path.join(repoRoot, OMP_PACKAGE_FILE), 'utf8');
const ruleBody = fs.readFileSync(path.join(repoRoot, 'src', 'rules', 'caveman-activate.md'), 'utf8');
fs.writeFileSync(path.join(agentsRoot, name), transformOpencodeAgentFrontmatter(fs.readFileSync(src, 'utf8')));
const body = transformOpencodeAgentFrontmatter(fs.readFileSync(src, 'utf8'), { subagent: true });const ruleBody = fs.readFileSync(path.join(repoRoot, 'src', 'rules', 'caveman-activate.md'), 'utf8').trimEnd() + '\n';
const existing = fs.readFileSync(agentsMd, 'utf8');
return crypto.createHash('sha256').update(fs.readFileSync(p)).digest('hex');const txt = fs.readFileSync(tmp, 'utf8');
const body = fs.readFileSync(ocAgentsMd, 'utf8');
const body = transformCursorAgentFrontmatter(fs.readFileSync(path.join(repoRoot, 'agents', file), 'utf8'), { readonly });try { return fs.readFileSync(p, 'utf8'); } catch (_) { return null; }const content = fs.readFileSync(fd, 'utf8');
hash.update(fs.readFileSync(target));
parsed = JSON.parse(fs.readFileSync(journalPath, 'utf8'));
const source = fs.readFileSync(normalized, 'utf8');
try { raw = fs.readFileSync(p, 'utf8'); }content = fs.readFileSync(agentPath, 'utf8');
return fallbackCanonicalDefault(JSON.parse(fs.readFileSync(file, 'utf8')).defaultMode);
const wanted = fs.readFileSync(source, 'utf8');
const current = fs.readFileSync(target, 'utf8');
return fs.readFileSync(target, 'utf8') === wanted ? target : null;
Why it matters: Usually legitimate, but worth confirming it can't be steered into reading sensitive files.
Fix: Confirm which files are read and that paths cannot be influenced by untrusted input to reach sensitive locations.
The component writes or deletes files on disk.
await fs.rm(outDir, { recursive: true, force: true });await fs.writeFile(path.join(outDir, `${c.name}.input.json`), JSON.stringify(c.input, null, 2) + '\n');await fs.writeFile(path.join(outDir, `${c.name}.expected.json`), JSON.stringify(expected, null, 2) + '\n');await fs.writeFile(path.join(outDir, 'manifest.json'), JSON.stringify({ cases: manifest }, null, 2) + '\n');if (cwd) { try { fs.rmSync(cwd, { recursive: true, force: true }); } catch (_) {} }{ relativePath: COPILOT_HOOK_FILE, write: (stage) => fs.writeFileSync(stage, JSON.stringify(hook, null, 2) + '\n') },fs.writeFileSync(path.join(pluginDir, 'plugin.json'), JSON.stringify({fs.rmSync(staging, { recursive: true, force: true });fs.writeFileSync(path.join(pluginDir, OMP_PACKAGE_FILE), JSON.stringify(pkg, null, 2) + '\n');
fs.writeFileSync(path.join(pluginDir, OMP_INDEX_FILE), ompExtensionSource(ruleBody));
fs.writeFileSync(path.join(agentsRoot, name), transformOpencodeAgentFrontmatter(fs.readFileSync(src, 'utf8')));
fs.writeFileSync(path.join(rulesRoot, OMP_RULE_FILE), ruleBody);
write: (stage) => fs.writeFileSync(stage, body, { mode: 0o600, flag: 'wx' }),fs.writeFileSync(agentsMd, next, { mode: 0o644 });fs.writeFileSync(agentsMd, next, { mode: 0o644 });fs.writeFileSync(agentsMd, existing + sep + fencedBlock, { mode: 0o644 });fs.writeFileSync(agentsMd, fencedBlock, { mode: 0o644 });for (const { tmp } of staged) try { fs.unlinkSync(tmp); } catch (_) { /* best effort */ }if (scratch) try { fs.rmSync(scratch, { recursive: true, force: true }); } catch (_) { /* best effort */ }const out = fs.createWriteStream(dest);
try { fs.rmSync(scratch, { recursive: true, force: true }); } catch (_) { /* best effort */ }try { fs.unlinkSync(p); } catch (_) {}try { fs.unlinkSync(ocAgentsMd); } catch (_) {}fs.writeFileSync(ocAgentsMd, next, { mode: 0o644 });if (!opts.dryRun) { try { fs.unlinkSync(ocAgentsMd); } catch (_) {} }Why it matters: Usually legitimate, but worth confirming the paths can't be controlled by untrusted input.
Fix: Confirm which files are written/deleted and that paths cannot be influenced by untrusted input.
The component reads files from disk.
metadata = json.loads((package / "package.json").read_text(encoding="utf-8"))
detail = (root / "proxy.log").read_text(encoding="utf-8", errors="replace")[-1000:]
if package.exists() or sentinel.read_bytes() != b'{"preserve":true}\n':prompts = [c["prompt"] for c in json.loads(PROMPTS.read_text(encoding="utf-8"))["cases"]]
prompts = [p.strip() for p in PROMPTS.read_text(encoding="utf-8").splitlines() if p.strip()]
skill_md = (SKILLS / skill / "SKILL.md").read_text(encoding="utf-8")
data = json.loads(SNAPSHOT.read_text(encoding="utf-8"))
head_src = (HOOKS / TRACKER).read_text(encoding="utf-8")
prompts = [p.strip() for p in PROMPTS.read_text(encoding="utf-8")
skill_md = (SKILLS / "caveman" / "SKILL.md").read_text(encoding="utf-8")
cases = json.loads(CASES.read_text(encoding="utf-8"))["cases"]
data = json.loads(path.read_text(encoding="utf-8"))
return urllib.request.build_opener(_RejectRedirects()).open(req, timeout=timeout)
orig_text = orig_path.read_text(encoding="utf-8", errors="ignore")
comp_text = comp_path.read_text(encoding="utf-8", errors="ignore")
raw = filepath.read_bytes()
if backup_path.read_bytes() != original_raw:
text = filepath.read_text(encoding="utf-8", errors="ignore")
return path.read_text(encoding="utf-8")
document = yaml.safe_load(path.read_text(encoding="utf-8"))
check_review_markers(current_path.read_text(encoding="utf-8"), "current.yaml")
orig_text = orig_path.read_text(encoding="utf-8", errors="ignore")
comp_text = comp_path.read_text(encoding="utf-8", errors="ignore")
raw = filepath.read_bytes()
if backup_path.read_bytes() != original_raw:
Why it matters: Usually legitimate, but worth confirming it can't be steered into reading sensitive files.
Fix: Confirm which files are read and that paths cannot be influenced by untrusted input to reach sensitive locations.
The component writes or deletes files on disk.
sentinel.write_bytes(b'{"preserve":true}\n')(root / "npmrc").write_text("", encoding="utf-8")with (root / "proxy.log").open(mode="wb") as log:
terse_file.write_text(terse_prefix, encoding="utf-8")
skill_file.write_text(f"{terse_prefix}\n\n{skill_md}", encoding="utf-8")partial.write_text(
json.dumps(snapshot, ensure_ascii=False, indent=2), encoding="utf-8"
)SNAPSHOT.write_text(json.dumps(snapshot, ensure_ascii=False, indent=2), encoding="utf-8")
shutil.copytree(HOOKS, hooks)
(hooks / TRACKER).write_text(tracker_source, encoding="utf-8")
(config / ".caveman-active").write_text(level, encoding="utf-8")
payload.write_text(json.dumps({"hookSpecificOutput": {
"hookEventName": "UserPromptSubmit",
"additionalContext": context,
}}), encoding="utf-8")SNAPSHOT.write_text(json.dumps(snapshot, ensure_ascii=False, indent=2),
encoding="utf-8")Why it matters: Usually legitimate, but worth confirming the paths can't be controlled by untrusted input.
Fix: Confirm which files are written/deleted and that paths cannot be influenced by untrusted input.
The component makes outbound network requests.
pages.set(url, fetch(url, { redirect: "follow", signal: AbortSignal.timeout(20_000) })response = await fetch(url, { signal: AbortSignal.timeout(timeout) });import { createServer as createHttpServer } from "node:http";try { await fetch(`http://127.0.0.1:${bidiPort}/session/status`, { signal: AbortSignal.timeout(1200) }); agentUp = true; break; } catch { /* retry */ }const req = https.get(url, (res) => {response = await fetch(url, { signal: AbortSignal.timeout(timeout) });import { request as httpRequest } from "node:http";import { request as httpsRequest } from "node:https";return fetch(url, {const response = await fetch(url, { signal: AbortSignal.timeout(timeoutSeconds * 1000) });const response = await fetch(`${registry}/@caveman-ai%2fcli`, {resp = await fetch(`${baseURL}/api/v1/me/wrap-entitlement`, {const response = await fetch(`${baseURL}/api/v1/auth/device/ack`, {const codeResp = await fetch(`${baseURL}/api/v1/auth/device/code`, {const tokResp = await fetch(`${baseURL}/api/v1/auth/device/token`, {response = await fetch(`${cfg.baseURL}/api/v1/projects/${encodeURIComponent(cfg.projectId)}/keys/${encodeURIComponent(cfg.gatewayKeyId)}/revoke`, {response = await fetch(`${cfg.baseURL}/api/v1/auth/logout`, request);const response = await fetch(`${cfg.baseURL}/api/v1/imports?format=local-scan${project}`, {const response = await fetch(`${cfg.baseURL}/api/v1/imports?format=caveman-jsonl`, {const response = await fetch(`${cfg.baseURL}/api/v1/practice-findings${project}`, {const response = await fetch(`${cfg.baseURL}/api/v1/imports?format=${encodeURIComponent(format)}`, {const response = await fetch(`${cfg.baseURL}/api/v1/eval-evidence/batches`, {const response = await fetch(`${cfg.baseURL}${path}`, { headers: { authorization: `Bearer ${cfg.token}` } });const response = await fetch(`${cfg.baseURL}${path}`, { method: "POST", headers: { authorization: `Bearer ${cfg.token}`, "content-type": "application/json", "x-cave-csrf": "cli" }, body: JSON.stringify(body) });response = await fetch(`${cfg.baseURL}${path}`, request);Why it matters: Usually legitimate, but confirm the destinations are expected and no sensitive data leaves.
Fix: Confirm the destination hosts are expected and that no sensitive data is sent off-host.
The component makes outbound network requests.
import urllib.request
with urllib.request.urlopen(f"{gateway}/health/live", timeout=1) as response:outgoing = httpx.Request(request.method, request.url, headers=headers, content=content, extensions=request.extensions)
self.runtime, self.scope, self.transport = ensure_sync(runtime), scope, transport or httpx.HTTPTransport()
self.runtime, self.scope, self.transport = ensure_async(runtime), scope, transport or httpx.AsyncHTTPTransport()
import urllib.request
raise urllib.error.HTTPError(req.full_url, code, "cave_redirect_not_allowed", response_headers, None)
return urllib.request.build_opener(_RejectRedirects()).open(req, timeout=timeout)
req = urllib.request.Request(
f"{self.base_url}/sdk/v1/tool-search",
data=json.dumps(body).encode(),
headers=headers(self, wf),
method="POST",
)req = urllib.request.Request(
f"{self.base_url}/sdk/v1/compress",
data=json.dumps(body).encode(),
headers=headers(self, self.default_workflow),
method="POST",
)req = urllib.request.Request(
f"{self.base_url}/sdk/v1/cave-plan",
headers=otlp_headers(self),
method="GET",
)req = urllib.request.Request(
f"{self._cave.base_url}{path}",
data=json.dumps(body).encode() if body is not None else None,
headers=headers(self._cave, self._cave.default_workflow),
method=met …req = urllib.request.Request(
f"{self._cave.base_url}/sdk/v1/context/pack",
data=json.dumps({"query": query, "items": wire_items, "options": wire_options}).encode(),
headers=headers(self._cave, self._cave …req = urllib.request.Request(
f"{self.cave.base_url}{path}",
data=json.dumps(body).encode(),
headers=request_headers,
method="POST",
)req = urllib.request.Request(
f"{self.cave.base_url}{path}",
headers=headers(
self.cave,
self.workflow,
trace_id=self.trace_id,
parent_span_id=self.span …req = urllib.request.Request(
f"{self.cave.base_url}{self.prefix}{path}",
data=json.dumps(body).encode(),
headers=headers(
self.cave,
self.workflow,
self.up …req = urllib.request.Request(
f"{self.cave.base_url}/v1/traces",
data=json.dumps(self._build_payload(batch)).encode(),
headers=otlp_headers(self.cave),
method=" …req = urllib.request.Request(
f"{self._cave.base_url}{_POLICY_PATH}",
headers=request_headers,
method="GET",
)import http.client
connection = http.client.HTTPSConnection(via_host, via_port, context=self._ssl or ssl.create_default_context())
connection = http.client.HTTPConnection(via_host, via_port)
raise http.client.IncompleteRead(bytes(data), response.length)
import urllib.request
request = urllib.request.Request(
f"{base}/chat/completions",
data=json.dumps(body).encode("utf-8"),
headers={"Content-Type": "application/json"},
)Why it matters: Usually legitimate, but confirm the destinations are expected and no sensitive data leaves.
Fix: Confirm the destination hosts are expected and that no sensitive data is sent off-host.
An OAuth 2.0 / OpenID Connect delegated-authentication flow was detected (authorization-code / refresh-token / token-exchange grant, an OIDC authorize/discovery endpoint or id_token, or a delegation library). Tools authenticate with the end user's delegated, scoped credentials rather than a long-lived embedded service credential.
for (const key of ["account_id", "access_token", "refresh_token", "id_token"]) {Fix: Delegated auth is a lower-blast-radius execution context than an embedded static credential. Confirm the requested scopes are minimal and that tokens are never logged or forwarded off-host.
An MCP tool surface (manifest or tool definitions) was found.
"tools": [
gdMarkerRe = regexp.MustCompile(`(?m)^[ \t]*(?:extends[ \t]+[A-Za-z_"']|class_name[ \t]+[A-Za-z_]|@tool\b|@export|@onready\b|@icon\(|signal[ \t]+[A-Za-z_])`)
@tool(name="caveman_retrieve", description=RECOVERY_DESCRIPTION, inputSchema={"json": RECOVERY_SCHEMA}, context=True)pi.registerTool({Why it matters: Just context — review which tools it offers and their permissions.
Fix: Review the declared MCP tools and their permissions.
How attackers abuse these capabilities
Interactive labs on the attack class behind the rules above. They show the technique, not anything found in JuliusBrussee/caveman.
Check your own component
Run the same evidence-backed scan on any MCP server, agent skill, or package.
Scan your own componentHow we determine this: deterministic static analysis (regex + AST), evidence-anchored, no code execution. Methodology →