trust-boundary-analysis
Skill này làm gì
Skill này là hướng dẫn kiểm toán cho công cụ dòng lệnh, tiện ích IDE và hệ thống plugin đọc cài đặt từ thư mục hiện tại. Skill dành cho lập trình viên và người rà soát bảo mật kiểm tra cách công cụ khởi động.
Khi nào nên dùng
- ✓Khi lập trình viên yêu cầu agent kiểm tra xem một CLI hoặc công cụ IDE có tin tệp cấu hình ở bất kỳ thư mục nào nó mở không.
- ✓Khi agent truy vết thứ tự khởi động của công cụ để xem cấu hình nào thắng giữa tệp dự án và tệp người dùng.
- ✓Khi một đội rà soát hệ thống plugin tải mã hoặc máy chủ MCP từ thư mục dự án.
Liên kết skill
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/analyst/trust-boundary/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Công cụ phát triển của chúng tôi có thể chạy lệnh từ tệp cài đặt trong thư mục dự án mà người dùng vừa mở không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent truy vết cách công cụ tìm tệp cấu hình, lập bản đồ tệp nào được nạp trước, và kiểm tra xem tệp dự án có được tin cậy trước khi chạy lệnh không.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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 / SSRFDEBUG,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: trueset? → 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:
- Direct interpolation:
`command ${userValue}`→ injection via; id - Single-quote escape:
osascript -e '${path}'→ escape via'in path - Env var in shell context:
PROXY_CMD="curl evil.com"→ executed as-is - 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_findingwith 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
Câu hỏi thường gặp
Vì sao thư mục hiện tại lại quan trọng?
Skill nói thư mục dự án có thể chứa cấu hình mà công cụ tự nạp, nên một kho mã thù địch có thể ảnh hưởng đến người dùng.
Cơ chế workspace trust là gì?
Skill mô tả đó là bước kiểm tra hỏi xem thư mục có được tin cậy trước khi dùng cài đặt hoặc plugin của nó không.
Điều này áp dụng cho những công cụ nào?
Skill liệt kê công cụ phát triển, CLI, tiện ích mở rộng IDE, language server và công cụ build đọc cấu hình dự án.
Chi tiết
Mô tả gốc của tác giả
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.
Độ phổ biến
- Sao GitHub
- 6.5k
- Vị trí xếp hạng
- #13979
- Giấy phép
- Apache-2.0
- Cập nhật
- 1/11/2026
Bình luận
- …
Thêm skill từ kho mã này
detector-overview
6.5kGiúp agent của bạn đọc code mà một công cụ quét đã đánh dấu, rồi quyết định điểm nào là lỗ hổng bảo mật thật và điểm nào là báo động giả.
exploiter-overview
6.5kGiúp agent của bạn ghép nhiều lỗ hổng bảo mật đã xác nhận thành một chuỗi kiểm thử và kiểm tra chuỗi đó có thể gây hậu quả đến đâu.
llm-redteam-overview
6.5kGiúp agent của bạn tìm đúng hướng dẫn red-team AI cho một bài kiểm thử, bao quát 15 nhóm chiến thuật từ prompt injection đến lạm dụng mô hình.
aatmf-t01-prompt-injection
6.5kGiải thích prompt injection, khi các chỉ dẫn ẩn cố ghi đè một hệ thống AI, để chuyên gia bảo mật có thể kiểm tra lỗi này.
Skill tương tự
reverse-engineer-anything
422kGiúp agent của bạn xem bên trong các app và package đã phát hành để giải thích tính năng, so sánh phiên bản hoặc hướng dẫn dựng lại bằng công cụ REA.
1password
394kGiúp agent của bạn cài đặt CLI của 1Password, đăng nhập, và đọc hoặc đưa thông tin bí mật vào mà không in giá trị ra cuộc trò chuyện.
healthcheck
394kGiúp agent của bạn rà soát bảo mật máy tính hoặc máy chủ đang chạy OpenClaw, như SSH, tường lửa, cập nhật và sao lưu, rồi đề xuất cách sửa an toàn.