Is shareAI-lab/learn-claude-code safe?
- Python shell/command execution
- Possible command injection (shell + dynamic command)
- Python filesystem read
What to do: Nothing here argues against installing it. Grant the capabilities it lists only if you expect the tool to need them.
shareAI-lab/learn-claude-code is a directory analyzed by SkillTotal's deterministic static scanner. The scan found no malicious indicators, though 1 risky construct is reported for review. It can: filesystem read, filesystem write, mcp tools detected and shell execution — capabilities are what the code can do, not a verdict on intent. Risk score 20/100 (low).
repo
Automated static-analysis result. It can contain false positives and false negatives, and is not a claim about the intent of shareAI-lab/learn-claude-code'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 (7)
The code builds an OS command out of values that can change at runtime, then runs it through a shell.
r = subprocess.run(command, shell=True, cwd=os.getcwd(),
capture_output=True, text=True, errors="replace", timeout=120)r = subprocess.run(command, shell=True, cwd=WORKDIR,
capture_output=True, text=True, errors="replace",
timeout=120)r = subprocess.run(command, shell=True, cwd=WORKDIR,
capture_output=True, text=True, errors="replace", timeout=120)r = subprocess.run(command, shell=True, cwd=WORKDIR,
capture_output=True, text=True, errors="replace", timeout=120)r = subprocess.run(command, shell=True, cwd=WORKDIR,
capture_output=True, text=True, errors="replace", timeout=120)r = subprocess.run(command, shell=True, cwd=WORKDIR,
capture_output=True, text=True, errors="replace", timeout=120)r = subprocess.run(command, shell=True, cwd=WORKDIR,
capture_output=True, text=True, errors="replace", timeout=120)r = subprocess.run(
command, shell=True, cwd=WORKDIR,
capture_output=True, text=True, errors="replace", timeout=300
)r = subprocess.run(command, shell=True, cwd=WORKDIR,
capture_output=True, text=True, errors="replace", timeout=120)r = subprocess.run(
command, shell=True, cwd=WORKDIR,
capture_output=True, text=True, errors="replace", timeout=120,
)r = subprocess.run(
command, shell=True, cwd=WORKDIR,
capture_output=True, text=True, errors="replace", timeout=120,
)r = subprocess.run(
command, shell=True, cwd=WORKDIR,
capture_output=True, text=True, errors="replace", timeout=120,
)r = subprocess.run(
command,
shell=True,
cwd=path,
capture_output=True,
text=True, errors="replace",
timeout=300,
)r = subprocess.run(
command,
shell=True,
cwd=WORKDIR,
capture_output=True,
text=True, errors="replace",
timeout=120,
)r = subprocess.run(command, shell=True, cwd=WORKDIR,
capture_output=True, text=True, errors="replace", timeout=120)r = subprocess.run(command, shell=True, cwd=WORKDIR,
capture_output=True, text=True, errors="replace", timeout=timeout)r = subprocess.run(command, shell=True, cwd=os.getcwd(),
capture_output=True, text=True, errors="replace", timeout=120)r = subprocess.run(command, shell=True, cwd=WORKDIR,
capture_output=True, text=True, errors="replace",
timeout=120)r = subprocess.run(command, shell=True, cwd=WORKDIR,
capture_output=True, text=True, errors="replace", timeout=120)r = subprocess.run(command, shell=True, cwd=WORKDIR,
capture_output=True, text=True, errors="replace", timeout=120)r = subprocess.run(command, shell=True, cwd=WORKDIR,
capture_output=True, text=True, errors="replace", timeout=120)result = subprocess.run(
command, shell=True, cwd=WORKDIR,
capture_output=True, text=True, errors="replace", timeout=120,
)result = subprocess.run(
command, shell=True, cwd=WORKDIR,
capture_output=True, text=True, errors="replace", timeout=120,
)result = subprocess.run(
command, shell=True, cwd=WORKDIR,
capture_output=True, text=True, errors="replace", timeout=120,
)result = subprocess.run(
command,
shell=True,
cwd=WORKDIR,
capture_output=True,
text=True, errors="replace",
timeout=120,
)Why it matters: If any of those values come from untrusted input, an attacker can run their own commands on the machine.
Fix: Pass arguments as a list without shell=True (e.g. subprocess.run(['git', 'checkout', branch])); never build a shell string from external input. If a shell is unavoidable, quote with shlex.quote.
The component can run operating-system commands or spawn processes.
r = subprocess.run(command, shell=True, cwd=os.getcwd(),
capture_output=True, text=True, errors="replace", timeout=120)r = subprocess.run(command, shell=True, cwd=WORKDIR,
capture_output=True, text=True, errors="replace",
timeout=120)r = subprocess.run(command, shell=True, cwd=WORKDIR,
capture_output=True, text=True, errors="replace", timeout=120)r = subprocess.run(command, shell=True, cwd=WORKDIR,
capture_output=True, text=True, errors="replace", timeout=120)r = subprocess.run(command, shell=True, cwd=WORKDIR,
capture_output=True, text=True, errors="replace", timeout=120)r = subprocess.run(command, shell=True, cwd=WORKDIR,
capture_output=True, text=True, errors="replace", timeout=120)r = subprocess.run(command, shell=True, cwd=WORKDIR,
capture_output=True, text=True, errors="replace", timeout=120)r = subprocess.run(
command, shell=True, cwd=WORKDIR,
capture_output=True, text=True, errors="replace", timeout=300
)r = subprocess.run(command, shell=True, cwd=WORKDIR,
capture_output=True, text=True, errors="replace", timeout=120)r = subprocess.run(
command, shell=True, cwd=WORKDIR,
capture_output=True, text=True, errors="replace", timeout=120,
)r = subprocess.run(
command, shell=True, cwd=WORKDIR,
capture_output=True, text=True, errors="replace", timeout=120,
)r = subprocess.run(
command, shell=True, cwd=WORKDIR,
capture_output=True, text=True, errors="replace", timeout=120,
)r = subprocess.run(
["git", "rev-parse", "--show-toplevel"],
cwd=cwd,
capture_output=True,
text=True, errors="replace",
timeout=10,
)r = subprocess.run(
["git", "rev-parse", "--is-inside-work-tree"],
cwd=self.repo_root,
capture_output=True,
text=True, errors="replace",
timeout=10, …r = subprocess.run(
["git", *args],
cwd=self.repo_root,
capture_output=True,
text=True, errors="replace",
timeout=120,
)r = subprocess.run(
["git", "status", "--short", "--branch"],
cwd=path,
capture_output=True,
text=True, errors="replace",
timeout=60,
)r = subprocess.run(
command,
shell=True,
cwd=path,
capture_output=True,
text=True, errors="replace",
timeout=300,
)r = subprocess.run(
command,
shell=True,
cwd=WORKDIR,
capture_output=True,
text=True, errors="replace",
timeout=120,
)r = subprocess.run(command, shell=True, cwd=WORKDIR,
capture_output=True, text=True, errors="replace", timeout=120)r = subprocess.run(command, shell=True, cwd=WORKDIR,
capture_output=True, text=True, errors="replace", timeout=timeout)r = subprocess.run(command, shell=True, cwd=os.getcwd(),
capture_output=True, text=True, errors="replace", timeout=120)r = subprocess.run(command, shell=True, cwd=WORKDIR,
capture_output=True, text=True, errors="replace",
timeout=120)r = subprocess.run(command, shell=True, cwd=WORKDIR,
capture_output=True, text=True, errors="replace", timeout=120)r = subprocess.run(command, shell=True, cwd=WORKDIR,
capture_output=True, text=True, errors="replace", timeout=120)r = subprocess.run(command, shell=True, cwd=WORKDIR,
capture_output=True, text=True, errors="replace", timeout=120)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 fs.readFileSync(filePath, "utf-8").replace(/\r\n/g, "\n");
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.
fs.rmSync(COURSE_ASSETS_DIR, { recursive: true, force: true });fs.writeFileSync(path.join(OUT_DIR, "versions.json"), JSON.stringify(index, null, 2));
fs.writeFileSync(path.join(OUT_DIR, "docs.json"), JSON.stringify(docs, null, 2));
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.
text = safe_path(path).read_text(encoding="utf-8")
content = fp.read_text(encoding="utf-8")
lines = safe_path(path).read_text(encoding="utf-8").splitlines()
content = fp.read_text(encoding="utf-8")
lines = safe_path(path).read_text(encoding="utf-8").splitlines()
content = fp.read_text(encoding="utf-8")
text = f.read_text(encoding="utf-8")
lines = safe_path(path).read_text(encoding="utf-8").splitlines()
content = fp.read_text(encoding="utf-8")
lines = safe_path(path).read_text(encoding="utf-8").splitlines()
content = fp.read_text(encoding="utf-8")
return json.loads(path.read_text(encoding="utf-8"))
task = json.loads(f.read_text(encoding="utf-8"))
tasks.append(json.loads(f.read_text(encoding="utf-8")))
lines = safe_path(path).read_text(encoding="utf-8").splitlines()
c = fp.read_text(encoding="utf-8")
lines = safe_path(path).read_text(encoding="utf-8").splitlines()
c = fp.read_text(encoding="utf-8")
for line in inbox_path.read_text(encoding="utf-8").strip().splitlines():
return json.loads(self.config_path.read_text(encoding="utf-8"))
lines = _safe_path(path).read_text(encoding="utf-8").splitlines()
c = fp.read_text(encoding="utf-8")
for line in inbox_path.read_text(encoding="utf-8").strip().splitlines():
return json.loads(self.config_path.read_text(encoding="utf-8"))
lines = _safe_path(path).read_text(encoding="utf-8").splitlines()
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.
fp.write_text(content, encoding="utf-8")
fp.write_text(content.replace(old_text, new_text, 1), encoding="utf-8")
fp.write_text(content, encoding="utf-8")
fp.write_text(content.replace(old_text, new_text, 1), encoding="utf-8")
fp.write_text(content, encoding="utf-8")
fp.write_text(content.replace(old_text, new_text, 1), encoding="utf-8")
fp.write_text(content, encoding="utf-8")
fp.write_text(content.replace(old_text, new_text, 1), encoding="utf-8")
with open(transcript_path, "w", encoding="utf-8") as f:
fp.write_text(content, encoding="utf-8")
fp.write_text(content.replace(old_text, new_text, 1), encoding="utf-8")
path.write_text(json.dumps(task, indent=2, ensure_ascii=False), encoding="utf-8")
fp.write_text(content, encoding="utf-8")
fp.write_text(c.replace(old_text, new_text, 1), encoding="utf-8")
fp.write_text(content, encoding="utf-8")
fp.write_text(c.replace(old_text, new_text, 1), encoding="utf-8")
with open(inbox_path, "a", encoding="utf-8") as f:
inbox_path.write_text("", encoding="utf-8")self.config_path.write_text(json.dumps(self.config, indent=2), encoding="utf-8")
fp.write_text(content, encoding="utf-8")
fp.write_text(c.replace(old_text, new_text, 1), encoding="utf-8")
with open(inbox_path, "a", encoding="utf-8") as f:
inbox_path.write_text("", encoding="utf-8")self.config_path.write_text(json.dumps(self.config, indent=2), encoding="utf-8")
fp.write_text(content, 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.
An MCP tool surface (manifest or tool definitions) was found.
@server.tool()
@server.tool()
const server = new Server({const transport = new StdioServerTransport();
@server.tool()
@server.tool()
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 shareAI-lab/learn-claude-code.
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 →