fix(security): disable auto-execution of workspace plugins without consent#11035
fix(security): disable auto-execution of workspace plugins without consent#11035coygeek wants to merge 2 commits intoopenclaw:mainfrom
Conversation
| if (candidates.length > prevCount) { | ||
| diagnostics.push({ | ||
| level: "warn", | ||
| message: `Workspace plugins discovered at ${dir} — workspace plugins are not auto-enabled for security. Use 'openclaw plugin enable <id>' to enable.`, | ||
| source: dir, |
There was a problem hiding this comment.
Incorrect enable command
The warning message tells users to run openclaw plugin enable <id>, but the CLI command is openclaw plugins enable <id> (plural) in src/cli/plugins-cli.ts:22-46. As written, the suggested command will fail and makes it harder to actually opt in to a discovered workspace plugin.
| if (candidates.length > prevCount) { | |
| diagnostics.push({ | |
| level: "warn", | |
| message: `Workspace plugins discovered at ${dir} — workspace plugins are not auto-enabled for security. Use 'openclaw plugin enable <id>' to enable.`, | |
| source: dir, | |
| message: `Workspace plugins discovered at ${dir} — workspace plugins are not auto-enabled for security. Use 'openclaw plugins enable <id>' to enable.`, |
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/plugins/discovery.ts
Line: 341:345
Comment:
**Incorrect enable command**
The warning message tells users to run `openclaw plugin enable <id>`, but the CLI command is `openclaw plugins enable <id>` (plural) in `src/cli/plugins-cli.ts:22-46`. As written, the suggested command will fail and makes it harder to actually opt in to a discovered workspace plugin.
```suggestion
message: `Workspace plugins discovered at ${dir} — workspace plugins are not auto-enabled for security. Use 'openclaw plugins enable <id>' to enable.`,
```
How can I resolve this? If you propose a fix, please make it concise.…nsent Workspace plugins from .openclaw/extensions/ in cloned repositories were auto-loaded and executed without user consent, enabling arbitrary code execution (CVSS 9.6). This change: 1. Defaults non-bundled plugins to disabled in resolveEnableState() 2. Adds warning diagnostics when workspace plugins are discovered 3. Adds defense-in-depth pre-load check in the loader that blocks workspace plugins unless explicitly enabled via config Users must now opt in via plugins.entries.<id>.enabled: true or 'openclaw plugin enable <id>' to run workspace plugins. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Update the workspace-plugin warning to use the correct CLI command\n('openclaw plugins enable <id>').\n\nAdjust plugin-related tests to explicitly set\nplugins.entries.<id>.enabled=true where plugin loading is expected,\nmatching the security hardening behavior that non-bundled plugins are\nnot enabled by default.
601583e to
0f0c061
Compare
|
Correction (previous comment formatting got mangled by shell interpolation): Rebased onto latest Follow-up changes in this push:
Local verification on this branch:
All passed locally. |
|
Maintainer note for clarity after rebase:
I also updated the PR body to match the implemented scope precisely. |
bfc1ccb to
f92900f
Compare
|
Cleanup note for traceability:
Closing this PR to align with duplicate routing. If maintainers want this exact patch revived, I can reopen or submit a retargeted PR. |
Fix Summary
This PR fixes a workspace-plugin auto-execution security issue by requiring explicit opt-in before non-bundled plugins are enabled.
Scope in this PR
resolveEnableState().origin === "workspace"plugins unlessplugins.entries.<id>.enabled: trueis set.This means a cloned repo's
.openclaw/extensionscontent will not execute unless explicitly enabled.Issue Linkage
Fixes #11031
Security Snapshot
Implementation Details
Files Changed
src/agents/session-tool-result-guard.tool-result-persist-hook.test.ts(+4/-0)src/plugins/config-state.ts(+1/-1)src/plugins/discovery.ts(+8/-0)src/plugins/loader.test.ts(+13/-0)src/plugins/loader.ts(+23/-0)src/plugins/tools.optional.test.ts(+18/-0)Technical Analysis
This PR fixes a workspace-plugin auto-execution security issue by requiring explicit opt-in before non-bundled plugins are enabled.
Validation Evidence
resolveEnableState()Risk and Compatibility
non-breaking; compatibility impact was not explicitly documented in the original PR body.
AI-Assisted Disclosure
Greptile Overview
Greptile Summary
Confidence Score: N/A