#11439: fix(security): warn on relative OPENCLAW_CONFIG_PATH and disable config-origin plugin auto-enable
stale
Cluster:
OpenClaw Plugin Enhancements
## Fix Summary
- Emit a `[security]` warning when `OPENCLAW_CONFIG_PATH` is a relative path, which may indicate a malicious `.env` file planted in a repository's working directory
- Change config-origin plugins (discovered via `plugins.load.paths`) to require explicit enablement rather than auto-enabling, breaking the untrusted code execution chain
## Issue Linkage
Fixes #11437
## Security Snapshot
| Metric | Value |
|--------|-------|
| **Score** | 9.6 / 10.0 |
| **Severity** | Critical |
| **Vector** | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H |
## Implementation Details
### Files Changed
- `src/config/paths.ts` (+17/-0)
- `src/plugins/config-state.ts` (+8/-0)
### Technical Analysis
- Emit a `[security]` warning when `OPENCLAW_CONFIG_PATH` is a relative path, which may indicate a malicious `.env` file planted in a repository's working directory
## Validation Evidence
- Command: `OPENCLAW_CONFIG_PATH`
- Status: failed
## Risk and Compatibility
breaking change noted in original PR body; review downstream compatibility.
## AI-Assisted Disclosure
- AI-assisted: yes
- Model: Claude Code
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR adds a security warning when `OPENCLAW_CONFIG_PATH` is set to a relative path, and changes plugin enablement so plugins discovered from `plugins.load.paths` (origin: `config`) are disabled by default unless explicitly enabled via `plugins.entries["<id>"].enabled: true`.
The config-path change affects `src/config/paths.ts` resolution helpers, while the plugin change is enforced centrally in `src/plugins/config-state.ts` via `resolveEnableState()`, which is consumed by the plugin loader when constructing plugin records.
<h3>Confidence Score: 4/5</h3>
- This PR is generally safe to merge, with one user-facing warning message bug to fix.
- The functional changes are localized and flow through existing central resolution points (`resolveConfigPath*` and `resolveEnableState`). The main correctness issue found is the warning text hardcoding `OPENCLAW_CONFIG_PATH` even when the legacy `CLAWDBOT_CONFIG_PATH` is the actual source, which will mislead users; otherwise the changes appear consistent with the stated security intent.
- src/config/paths.ts
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#23574: security: P0 critical remediation — plugin sandbox, password hashin...
by lumeleopard001 · 2026-02-22
82.0%
#21964: Security: harden gateway and plugin trust boundaries
by Elormyevu · 2026-02-20
80.0%
#11032: fix(security): block plugin install/load on critical source scan fi...
by coygeek · 2026-02-07
79.9%
#20424: Fix plugin extension path traversal in discovery/install
by markmusson · 2026-02-18
79.3%
#21660: fix(plugins): require explicit allowlist for non-bundled plugins
by AI-Reviewer-QS · 2026-02-20
79.0%
#11096: fix(plugins): require explicit trust for workspace and external plu...
by T1mn · 2026-02-07
78.4%
#9440: fix(security): warn users when gateway token appears in URLs
by zenchantlive · 2026-02-05
78.4%
#15757: feat(security): add hardening gap audit checks
by saurabhsh5 · 2026-02-13
78.3%
#11435: fix(security): validate OPENCLAW_BROWSER_CONTROL_MODULE before dyna...
by coygeek · 2026-02-07
78.0%
#11048: fix: address repository issues (env, author, CI comments, security ...
by cavula · 2026-02-07
77.9%