#21660: fix(plugins): require explicit allowlist for non-bundled plugins
size: XS
## Summary
- When `plugins.allow` is empty (default config), non-bundled plugins discovered via npm packages with `openclaw.plugin.json` auto-load with gateway privileges, creating supply chain risk.
- Added a check in `resolveEnableState()` so that when the allowlist is empty, non-bundled plugins are disabled by default. Only bundled plugins that are explicitly enabled by default can load.
- Bundled plugin behavior is unchanged; non-bundled plugins now require explicit inclusion in `plugins.allow`.
## Test plan
- [ ] Verify that with an empty `plugins.allow`, non-bundled discovered plugins are disabled with reason "not in allowlist (empty allowlist blocks non-bundled plugins)"
- [ ] Verify that bundled plugins enabled by default (device-pair, phone-control, talk-voice) still load normally
- [ ] Verify that explicitly allowlisted non-bundled plugins still load when listed in `plugins.allow`
- [ ] Verify that denylisted plugins remain blocked regardless of allowlist state
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Adds security protection against supply chain attacks by blocking auto-load of non-bundled plugins when the allowlist is empty. The new check in `resolveEnableState()` is correctly positioned after explicit configuration checks (memory slot, entries) and bundled plugin handling, ensuring that only non-bundled plugins without explicit configuration are blocked by the empty allowlist.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk
- The change is a targeted security fix that adds a single conditional check with correct placement in the control flow. The logic properly preserves explicit configurations while blocking potentially dangerous auto-loading behavior. No tests were broken (none exist for this function), and the change aligns with the security principle of secure-by-default.
- No files require special attention
<sub>Last reviewed commit: f7c30c3</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#7204: Plugins: default non-bundled plugins off
by veganmosfet · 2026-02-02
84.4%
#11096: fix(plugins): require explicit trust for workspace and external plu...
by T1mn · 2026-02-07
80.6%
#20499: test(plugins): add bundled+config duplicate discovery regression
by dcol91863 · 2026-02-19
79.6%
#23574: security: P0 critical remediation — plugin sandbox, password hashin...
by lumeleopard001 · 2026-02-22
79.5%
#20424: Fix plugin extension path traversal in discovery/install
by markmusson · 2026-02-18
79.3%
#11439: fix(security): warn on relative OPENCLAW_CONFIG_PATH and disable co...
by coygeek · 2026-02-07
79.0%
#21964: Security: harden gateway and plugin trust boundaries
by Elormyevu · 2026-02-20
78.8%
#11032: fix(security): block plugin install/load on critical source scan fi...
by coygeek · 2026-02-07
78.6%
#12849: fix(plugins): fallback bundled channel specs when npm install retur...
by vincentkoc · 2026-02-09
78.2%
#2556: fix(plugin-install): handle existing plugins and filter workspace deps
by longmaba · 2026-01-27
78.1%