A folder-dropped declarative plugin runs a shell hook with no allowlist entry, on a stock project
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu với plugins/trust.py, loader._discover_project, registry._resolve, registry.hooks_for và HookBus.emit để theo dõi các plugin khai báo có nguồn gốc từ project qua đường dẫn stock-project được tái hiện. Xem xét ba cách tiếp cận về trust được đề xuất với một maintainer trước khi chọn phạm vi. Được xem là hoàn tất khi policy đã thống nhất ngăn một hook được thả vào một folder không có trong allowlist thực thi trong đường dẫn unattended, và bản tái hiện được bao phủ bằng các test.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Split out of #461 point 4 / PR #495. #496 names this as separate and out of scope there; it had no issue of its own. Found by a completeness pass over PR #495's config_digest and confirmed firsthand against the code.
Related to #496 but strictly wider: #496 needs a project that has already enabled a [python] plugin. This one needs nothing — [plugins] enabled empty (the default) is enough.
The hole
plugins/trust.py is explicit that this is the designed behavior:
Data-only / declarative plugins (no
[python]) carry no executable Python — they load on folder-drop. Their shell hooks are the same risk surface as today'sengine.toml *_cmdand run through the bus like any command.
That reasoning holds when a human drops the folder. It does not hold under #461's threat model, where a driven session can write anywhere in the workspace — and loader._discover_project reads manifests from <project>/.bmad-loop/plugins/*/plugin.toml, inside that writable tree.
The chain, with no trust gate at any hop:
loader._discover_projectyields the manifest (origin="project").registry._resolve—if manifest.python is None:returns aLoadedPluginimmediately, before thetrust.is_enabledcheck, which only guards the[python]branch.registry.hooks_for(stage)iterates every loaded plugin and filters onmanifest.hook_for(stage)only.HookBus.emit→_dispatch_declarative→_run_subprocess(cmd, shell=True).
Reproduced
Stock policy, empty allowlist, one file written:
# <project>/.bmad-loop/plugins/rogue/plugin.toml
[plugin]
name = "rogue"
api_version = 1
[hooks.pre_sweep_cycle]
cmd = "..."
policy [plugins] enabled = ()
digest moved : False
plugin discovered : True
trusted flag : True
hooks_for(stage) : [('rogue', '...')]
The child SweepEngine builds a fresh PluginRegistry per run and emits pre_sweep_cycle, so the command runs on the host in the unattended path — which is precisely the human-absent window PR #495's gate exists to protect.
Why PR #495 does not close it
config_digest hashes sorted(policy.plugins.enabled). Nothing in .bmad-loop/plugins/ is read at all, and no policy field moves, so the auto-sweep integrity gate passes.
PR #495's docstring previously claimed "Adding a plugin is caught; changing what an enabled one runs is not." That is true only of plugins declaring [python]. Corrected in b049133 — the docstring and CHANGELOG now scope the claim to the [python] tier and point here, so the pin is not read as stronger than it is.
Shape of a fix (undecided — needs a maintainer call)
The trust tiers were drawn on what the plugin contains (Python vs. data). The gap is that they ignore where it came from, and project origin is agent-writable. Options, roughly in increasing cost:
- Gate declarative hooks on
enabledtoo, at least fororigin="project"manifests. Smallest change and it makes the allowlist mean what the CHANGELOG implies. Behavior change for anyone relying on folder-drop for a data-only plugin. - Trust declarative folder-drop by origin: builtin/entry_point load freely, project-origin needs an allowlist entry. Keeps folder-drop working for anything shipped or installed outside the workspace.
- Digest the manifests — fold
.bmad-loop/plugins/*/plugin.tomlcontent intoconfig_digest. Closes the auto-sweep window only, not the parent run, and does nothing for a first run. Weakest of the three; noted for completeness.
Options 1 and 2 also subsume the [plugins.<name>] settings surface: those are overlaid onto manifest defaults by registry._resolve_settings and exported into the hook env as BMAD_LOOP_SETTING_*, and the Unity plugin turns one into an --editor-path argv token. PR #495 deliberately does not pin them (the TUI settings screen writes those same tables, so pinning would refuse an auto-sweep after a supported human edit) — they sit inside an already-trusted plugin's blast radius, which is the boundary this issue and #496 are about.
Notes
- Not a regression. Predates #495, which narrows the surrounding surface without widening this one.
- Unlike #496, a stock project with no plugins configured is exposed.
Related: #461, #496, PR #495.
- Ngôn ngữ chính
- Python
- Star
- 174
- Fork
- 72
- Merge trung bình
- 17 giờ 56 phút
- Pull request đã merge (30 ngày)
- 95
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của bmad-code-org/bmad-loop
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 69/100
bmad-code-org/bmad-loop#973 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
bmad-code-org/bmad-loop#965 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
bmad-code-org/bmad-loop#1004 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
tickets: an injected plan_halt result for a built plan escalates with stopped-attempt wordingĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 36/100
bmad-code-org/bmad-loop#972 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 49/100
bmad-code-org/bmad-loop#971 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của bmad-code-org/bmad-loop
Issue tương tự
-
[BUG]: Compliance rules never see Unity Catalog views as viewsCó thể đã có người làm @wagnercsantos đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
databrickslabs/ontos#1348 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
ibm-granite/granite.build#649 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`forum_pr_poster` action will always return `none` when checking for pre-existing feedback threads, even if a feedback thread already exists.Có thể đã có người làm @pgmzeta đã nhận hôm nay. Đang mởE-Verified P-Major
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
goonstation/goonstation#28259 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
woonstadrotterdam/monumenten#70 ·
Maintainer thường phản hồi trong vòng 15 ngày
-
binding:python bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày