Skip to content

Commit 018494f

Browse files
authored
fix(dotenv): reserve workspace OPENCLAW env namespace (#69376)
1 parent e181811 commit 018494f

3 files changed

Lines changed: 8 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Docs: https://docs.openclaw.ai
1717
- BlueBubbles: raise the outbound `/api/v1/message/text` send timeout default from 10s to 30s, and add a configurable `channels.bluebubbles.sendTimeoutMs` (also per-account) so macOS 26 setups where Private API iMessage sends stall for 60+ seconds no longer silently lose messages at the 10s abort. Probes, chat lookups, and health checks keep the shorter 10s default. Fixes #67486. (#69193) Thanks @omarshahine.
1818
- Context engine/plugins: stop rejecting third-party context engines whose `info.id` differs from the registered plugin slot id. The strict-match contract added in 2026.4.14 broke `lossless-claw` and other plugins whose internal engine id does not equal the slot id they are registered under, producing repeated `info.id must match registered id` lane failures on every turn. Fixes #66601. (#66678) Thanks @GodsBoy.
1919
- Agents/compaction: rename embedded Pi compaction lifecycle events to `compaction_start` / `compaction_end` so OpenClaw stays aligned with `pi-coding-agent` 0.66.1 event naming. (#67713) Thanks @mpz4life.
20+
- Security/dotenv: block all `OPENCLAW_*` keys from untrusted workspace `.env` files so workspace-local env loading fails closed for new runtime-control variables instead of silently inheriting them. (#473)
2021

2122
## 2026.4.20
2223

src/infra/dotenv.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,10 @@ describe("workspace .env blocklist completeness", () => {
607607
await withIsolatedEnvAndCwd(async () => {
608608
await withDotEnvFixture(async ({ cwdDir }) => {
609609
const runtimeControlKeys = [
610+
"OPENCLAW_GIT_DIR",
611+
"OPENCLAW_WORKSPACE_DIR",
612+
"OPENCLAW_MDNS_HOSTNAME",
613+
"OPENCLAW_SESSION_CACHE_TTL_MS",
610614
"OPENCLAW_UPDATE_PACKAGE_SPEC",
611615
"OPENCLAW_GATEWAY_PORT",
612616
"OPENCLAW_GATEWAY_URL",

src/infra/dotenv.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ const BLOCKED_WORKSPACE_DOTENV_PREFIXES = [
7575
"ANTHROPIC_API_KEY_",
7676
"CLAWHUB_",
7777
"OPENAI_API_KEY_",
78+
// Workspace .env is untrusted; reserve the full OpenClaw runtime namespace
79+
// for shell/global config so new OPENCLAW_* controls are fail-closed by default.
80+
"OPENCLAW_",
7881
"OPENCLAW_CLAWHUB_",
7982
"OPENCLAW_DISABLE_",
8083
"OPENCLAW_SKIP_",

0 commit comments

Comments
 (0)