Trust boundary mapping and startup sequence audit for developer tools, CLI apps, and plugin systems. Load when the target is a developer tool, CLI, IDE extension, or any application that loads config from the current directory.
69
85%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Critical
Do not install without reviewing
This skill targets the vulnerability class that produced 5 RCE vectors in Google Gemini CLI from a single architectural flaw: missing workspace trust. Developer tools that auto-load configuration from untrusted directories are a rich attack surface.
Apply this skill when the target:
.env, settings.json, or config files from the current working directoryFor any CLI tool or developer application, trace the full initialization:
grep -rn 'readFile\|readFileSync\|fs.read\|open(' --include='*.ts' --include='*.js' \
/workspace/target/src/ | grep -i 'config\|settings\|env\|rc\|\.json'Map the search order. Common dangerous patterns:
cwd/.tool/config.json → cwd/.env → ~/.tool/config → /etc/tool/configRecord each config loading point:
kg_add_node("code_location", "loadConfig() reads .env from cwd",
props={"file": "src/config/settings.ts", "line": 42, "trust_level": "untrusted"})grep -rn 'process\.env\|os\.environ\|env::var\|getenv' --include='*.ts' \
--include='*.py' --include='*.rs' /workspace/target/src/Check: Are env vars from .env files injected into process.env? Which vars
control dangerous behavior? Look for:
*_COMMAND, *_CMD, *_EXEC → shell execution*_PROXY → SSRF / network interception*_PATH, *_DIR → path traversal*_URL → open redirect / SSRFDEBUG, NODE_ENV → bypass security controlsgrep -rn 'trust\|isTrusted\|workspace.*safe\|folder.*trust' --include='*.ts' \
--include='*.js' /workspace/target/src/Look for the pattern:
// DANGEROUS: trust disabled by default
if (!settings.folderTrustEnabled) {
return { isTrusted: true }; // ← All workspaces trusted
}If no trust check exists, every config is loaded blindly. This is the root cause.
grep -rn 'spawn\|exec\|execSync\|child_process\|subprocess\|os\.system\|Popen' \
--include='*.ts' --include='*.js' --include='*.py' /workspace/target/src/For each spawn/exec call, check:
shell: true set? → shell injection via crafted valuesgrep -rn 'discoverTools\|loadPlugins\|autoDiscover\|mcpServers\|toolDiscovery' \
--include='*.ts' --include='*.js' /workspace/target/src/Check: Are plugins/tools loaded from project-level config BEFORE any user confirmation? MCP servers, language server plugins, and build tool extensions are common vectors.
Map the attack flow as a chain in the knowledge graph:
ENTRYPOINT (malicious .env file in cloned repo)
→ enables → ENV_INJECT (process.env poisoned)
→ enables → SHELL_EXEC (spawn with shell:true)
→ reaches → CROWN_JEWEL (arbitrary code execution)Use low edge weights (0.2–0.4) for automatic/silent steps. Use higher weights (1.0+) for steps requiring user interaction.
Then call plan_attack_chains(top_k=5) to surface the cheapest paths.
When config values flow into shell commands, check for:
`command ${userValue}` → injection via ; idosascript -e '${path}' → escape via ' in pathPROXY_CMD="curl evil.com" → executed as-isspawn('git', ['clone', userUrl]) → --upload-pack= prefixFor each, the PoC pattern is:
id, env, write a sentinel file)validate_finding with the sentinel as the success patternAlways test: does the same code path execute WITHOUT the malicious config? The negative control is the same operation with a clean/empty config directory. If the behavior occurs regardless, it's not a vulnerability — it's expected.
0cf691e
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.