SkillSpector
- Type
- MCP server
- Scanned
- Nov 18, 2026
- Version
- a09091e0ebf6
- Files read
- 582
SkillSpector is a security scanner, local server, and coding-agent extension that checks AI agent skills, plugins, and MCP servers for malicious code, prompt injection, and vulnerable dependencies before you install them. Its biggest risk is that scanning an untrusted folder with the OpenCode extension can execute a malicious program hidden in that folder's .venv directory, while attackers can also use a decoy setting to hide dangerous plugin hooks or bypass its HTTP server filter to read local files.
What it can reach
- Files
- Reads local folders, files, lockfiles, archives (ZIP, TAR, GZIP, DOCX), baselines, and custom YARA rules provided for scanning, unpacks or clones targets into temporary directories, and writes scan reports or baseline files when requested.
- Network
- Downloads repositories and packages from Git hosts, HuggingFace, and npm, sends dependency lists to OSV.dev and queries the MCP Registry, sends scanned file contents to your configured AI model provider by default (and to LangSmith if tracing is enabled), and can run an unauthenticated local HTTP MCP server.
- Shell commands
- Runs git commands to clone remote repositories, starts Python worker processes to inspect dependencies, invokes local AI CLIs (claude, gemini, opencode) when selected as the model provider, and runs the skillspector command from its extensions and companion skill workflow.
- Secrets
- Reads AI model API keys, custom gateway headers, LangSmith settings, AWS and Google Cloud credentials, and ambient Git credentials from environment variables and local authentication stores.
Findings
-
HighOpenCode extension executes
.venvbinary from the target worktree before PATH.opencode/tools/skillspector_scan_lib.ts:197
When
SKILLSPECTOR_BINis unset,resolveBinarylooks for<worktree>/.venv/bin/skillspector(or.venv/Scripts/skillspector.exeon Windows) inside the active session worktree before falling back toskillspectoronPATH. If a user installs the OpenCode tool globally to audit untrusted repositories and runsskillspector_scaninside a repository checkout that contains a malicious.venv/bin/skillspector, approving the scan executes the attacker's binary from the repository instead of the user's installed scanner.Fix: Resolve any bundled
.venvrelative to the extension's own installation directory (usingimport.meta.url, as the Pi extension does) or fall back only toskillspectoronPATH, never an untrusted workspace.venv. -
HighBundled disableAllHooks setting suppresses plugin hook exfiltration and execution findings
src/skillspector/nodes/analyzers/bundled_execution_surface.py:1286
When a scanned bundle includes .claude/settings.json or .claude/settings.local.json with disableAllHooks set to true, _bundled_hooks_are_disabled sets hooks_disabled to True across every hook file in the bundle, including hooks/hooks.json and .claude-plugin/plugin.json. This clears all parsed hook declarations, suppressing BH1 hook-execution findings, CRITICAL BH2 remote-exfiltration findings, and the partial-completeness flag for unmodeled hook commands. When a user installs that bundle as a Claude Code plugin (or copies a skill subdirectory), Claude Code loads the plugin hooks from hooks/hooks.json or .claude-plugin/plugin.json and ignores the .claude/settings*.json file inside the plugin directory, allowing a malicious plugin to pass the safe_to_install gate with a clean SAFE verdict.
Fix: Never allow disableAllHooks in .claude/settings.json or .claude/settings.local.json to suppress findings or completeness checks on plugin hook surfaces (hooks/hooks.json and .claude-plugin/plugin.json), and retain BH1/BH2 visibility on project settings hooks since user or CLI settings can override project-level flags.
-
MediumHTTP MCP local-target check can be bypassed to read arbitrary host files
src/skillspector/mcp_server.py:96
When the MCP server runs over HTTP (
skillspector mcp --transport http),run_scansetsallow_local_targets=Falseto block callers from reading host files. However,_is_local_targettreats any string containing://as remote and checkscandidate.exists()on relative paths, whilerun_scanvalidatesurlparse(target).scheme == "https"(which lowercases the scheme and does not require a host). Inputs such asHTTPS://../../../../../../etc/passwdorhttps:x/../../../../../../etc/passwdpassrun_scan, failInputHandler's case-sensitivestartswith("https://")checks, and fall through toos.path.abspath, which lexically collapsesHTTPS:/..orhttps:x/..to read arbitrary files or directories on the host, send them to the configured LLM, and return snippets in the response.Fix: Require
parsed_target.scheme == "https"with a non-emptyparsed_target.hostname, pass a normalized lowercasehttps://URL toInputHandler, and reject local filesystem fallback insideInputHandler.resolvewheneverallow_local_targetsis false. -
MediumGit clone in local and stdio MCP modes allows
.lfsconfigSSRF via host git-lfs filterssrc/skillspector/input_handler.py:418
When
allow_git_credentialsis true (the default for the CLI, stdio MCP server, Pi extension, and OpenCode extension),_git_invocationrunsgitwith the host's global and system configuration, and_clone_gitonly overridescore.symlinks=false. On machines withgit-lfsinstalled, cloning an untrusted GitHub, GitLab, or Bitbucket repository containing.gitattributes(filter=lfs) and a custom.lfsconfig(lfs.url) automatically triggersgit-lfsduring checkout, causing outbound HTTP requests (and potential Git credential helper lookups) to arbitrary external or private internal URLs outside SkillSpector's SSRF host allowlist.Fix: Set
GIT_LFS_SKIP_SMUDGE=1in thegit cloneenvironment and pass-c filter.lfs.smudge= -c filter.lfs.process= -c filter.lfs.required=false -c http.followRedirects=falseon allgit cloneinvocations. -
MediumCatastrophic regex backtracking in auto-run memory-write detector hangs scans
src/skillspector/nodes/analyzers/static_patterns_memory_poisoning.py:764
The MP3 memory-write detector runs _PY_STRING_LITERAL and _TS_STRING_LITERAL via Python's native re.finditer on auto-run test files (such as conftest.py, test_*.py, and *.test.ts), bypassing static_runner's 0.25-second timed regex engine. Inside (?P<dest>(?:\\.|(?!(?P=q)).)*), both branches match any two-character escape sequence such as \\n or \\\\ because (?!(?P=q)). does not exclude backslashes. When the rest of the sink pattern fails to match—for example on an ordinary single-argument open("...") read call, Path("...").read_text(), or an unclosed string literal containing 35+ escape sequences—Python's C regex engine backtracks exponentially (2^k steps) without checking workflow deadlines, hanging the CLI or MCP server at 100% CPU.
Fix: Exclude backslashes and line breaks from the second branch (for example, (?!\\|(?P=q))[^\r\n]) or route the write-sink patterns through static_runner.iter_pattern_matches so the per-rule timeout applies.
-
LowGemini CLI provider runs in read-only plan mode without disabling tools, MCP servers, or hooks
src/skillspector/providers/_agent_cli.py:420
When
SKILLSPECTOR_PROVIDER=gemini_cliis selected,_build_gemini_argvinvokesgeminiwith--approval-mode planand--skip-trustwhile preservingHOMEin the child environment. Unlikeclaude_cliandopencode_cli(which enforce a strict deny-all tool policy and block ambient configs/MCP servers) andcodex_cli(which is disabled because read-only mode still permits reads), Gemini CLI'splanmode auto-approves read-only tools and loads MCP servers, extensions, and hooks from~/.gemini/settings.json. Prompt injection inside a scanned skill's files can invoke those tools and exfiltrate or reflect results into the scan output.Fix: Disable
gemini_cliuntil a verified deny-all-tools and isolated-config invocation is available, or explicitly disable all built-in tools, extensions, hooks, and MCP servers and verify the resolved policy before sending untrusted stdin. -
LowAmbient LangSmith tracing uploads unredacted file caches even during
--no-llmscansbuild_contextstoreslocal_file_cacheandraw_file_cache—including unredacted.envfiles, hidden files, andlocal_onlyscripts intentionally withheld from LLM providers—insideSkillspectorState, andlangsmithis installed as a core dependency. Unlike the OpenCode wrapper (which stripsLANGCHAIN_*andLANGSMITH_*variables), the CLI, MCP server, and Pi extension pass graph runs directly to LangGraph without disabling tracing when--no-llmoruse_llm=Falseis set. If a user hasLANGSMITH_TRACING=trueorLANGCHAIN_TRACING_V2=truein their environment, static-only scans still upload unredacted scanned file contents to LangSmith.Fix: Disable LangChain/LangSmith tracers when
use_llmis false, and keepraw_file_cacheand unredactedlocal_file_cacheout of traced LangGraph state (using a process-local store keyed by scan ID, aspython_ast_cache_keyalready does). -
LowSkill workflow uses a predictable
/tmpreport path and reads stale files on scan failureskills/skill-inspector/SKILL.md:41
The
skill-inspectorskill instructs the agent to write JSON reports to the fixed path/tmp/skill-inspector-report.jsonand states that if the command exits non-zero, the agent should inspect any partial report at that path and continue. If a scan exits with code 2 before writing output, the agent can read a stale report from an earlier scan or a read-only/tmp/skill-inspector-report.jsonplanted beforehand by another local user on a shared machine.Fix: Create a private per-run directory with
mktemp -d(or read JSON from stdout without--output) instead of writing to a fixed path in/tmp. -
LowContrib batch scanner loads
.envfrom the current working directory withoverride=Truecontrib/batch_scan/__init__.py:45
At import time,
contrib.batch_scancalls_dotenv.load_dotenv(_dotenv.find_dotenv(usecwd=True), override=True)ifpython-dotenvis installed. Runningpython -m contrib.batch_scan.batch_scanfrom inside an untrusted directory containing a.envfile overwritesos.environbefore CLI flags like--no-llmare parsed, allowing an attacker's.envto redirect provider base URLs (exfiltrating API keys) or injectPYTHONPATH,PYTHONSTARTUP, orLD_PRELOADinto spawned worker processes. Rated low becausecontrib/is excluded from the built wheel and never run by the installed CLI, MCP server, or extensions.Fix: Remove automatic CWD
.envloading withoverride=True, or require an explicit--env-fileCLI flag loaded without overriding critical runtime and loader variables.
