본문으로 건너뛰기
Skillpedia
보안6.5k · #13979

trust-boundary-analysis

하는 일

이 스킬은 현재 폴더에서 설정을 읽는 명령줄 도구, IDE 확장, 플러그인 시스템을 위한 감사 안내서입니다. 도구가 시작되는 방식을 점검하는 개발자와 보안 검토자를 위한 스킬입니다.

사용하는 경우

  • ✓개발자가 CLI나 IDE 도구가 열린 폴더의 설정 파일을 신뢰하는지 확인해 달라고 요청할 때.
  • ✓에이전트가 도구의 시작 순서를 추적해 프로젝트 파일과 사용자 파일 중 어떤 설정이 우선하는지 확인할 때.
  • ✓팀이 프로젝트 디렉터리에서 코드나 MCP 서버를 불러오는 플러그인 시스템을 검토하는 경우.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

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.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“우리 개발자 도구가 사용자가 방금 연 프로젝트 폴더의 설정 파일에서 명령을 실행할 수 있는지 확인해 주시겠어요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 도구가 설정 파일을 찾는 방식을 추적하고, 어떤 파일이 먼저 불러와지는지 매핑하며, 명령을 실행하기 전에 프로젝트 파일이 신뢰되는지 확인합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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

자주 묻는 질문

현재 폴더가 왜 중요한가요?

스킬은 프로젝트 폴더에 도구가 자동으로 불러오는 설정이 있을 수 있어, 악성 저장소가 사용자에게 영향을 줄 수 있다고 설명합니다.

작업 공간 신뢰란 무엇인가요?

폴더의 설정이나 플러그인을 쓰기 전에, 그 폴더를 신뢰하는지 묻는 검사라고 스킬은 설명합니다.

이 내용은 어떤 도구에 적용되나요?

스킬은 개발자 도구, CLI, IDE 확장, 언어 서버, 프로젝트 설정을 읽는 빌드 도구를 나열합니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
6.5k
순위
#13979
라이선스
Apache-2.0
업데이트
2026. 11. 1.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬