Skip to content

fix(dotenv): block workspace runtime env vars#62660

Merged
drobison00 merged 3 commits into
openclaw:mainfrom
eleqtrizit:361
Apr 8, 2026
Merged

fix(dotenv): block workspace runtime env vars#62660
drobison00 merged 3 commits into
openclaw:mainfrom
eleqtrizit:361

Conversation

@eleqtrizit

Copy link
Copy Markdown
Contributor

Summary

  • Tightens workspace .env filtering for runtime-control variables that should not be accepted from untrusted repositories
  • Keeps trusted global runtime .env behavior unchanged

Changes

  • Expanded the workspace .env denylist in src/infra/dotenv.ts to cover current runtime-control variables and control-family prefixes
  • Added regression coverage in src/infra/dotenv.test.ts for blocked runtime-control variables and allowed user-defined passthrough variables

Validation

  • Ran corepack pnpm test src/infra/dotenv.test.ts
  • Ran pnpm check via the pre-commit hook during scripts/committer
  • Ran a local agentic review equivalent against the diff; the canned claude -p "/review" flow was not usable here because it tried to invoke GitHub commands under its own permission assumptions

Notes

  • Operators who were using workspace .env for these runtime-control variables should move them to the trusted global ~/.openclaw/.env surface instead
  • Incorporated the existing GHSA-private patch direction and preserved co-author credit in the commit

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Apr 7, 2026
@greptile-apps

greptile-apps Bot commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR tightens the workspace .env denylist in src/infra/dotenv.ts by adding individual keys (browser executable paths, cache-trace vars, raw-stream vars, ClawHub tokens, gateway URL, etc.) and several new prefix-based blocks (CLAWHUB_, OPENCLAW_CLAWHUB_, OPENCLAW_DISABLE_, OPENCLAW_SKIP_, OPENCLAW_UPDATE_). New regression tests in dotenv.test.ts verify that all listed runtime-control keys are blocked from workspace .env while user-defined passthrough vars remain allowed. The trusted global ~/.openclaw/.env surface is unchanged.

Confidence Score: 5/5

Safe to merge — all changes are additive, tighten security, and are covered by regression tests.

The denylist expansions are straightforward and correct. All newly blocked keys and prefix families are genuine runtime-control surfaces. The regression tests cover the full set of added entries and verify passthrough still works for user-defined vars. No existing behavior is broken. No P0/P1 findings were identified.

No files require special attention.

Vulnerabilities

No security concerns identified. The PR strengthens the security posture by expanding the workspace .env denylist to prevent untrusted repositories from injecting runtime-control variables (endpoint redirections, executable paths, auth tokens, plugin control flags) into the OpenClaw process environment.

Reviews (2): Last reviewed commit: "fix(dotenv): block workspace runtime env..." | Re-trigger Greptile

Comment thread src/infra/dotenv.test.ts
@eleqtrizit

Copy link
Copy Markdown
Contributor Author

@greptile review

@eleqtrizit

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Hooray!

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aaf159afe7

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/infra/dotenv.ts
@drobison00
drobison00 merged commit dbfcef3 into openclaw:main Apr 8, 2026
8 checks passed
mrosmarin added a commit to mrosmarin/openclaw that referenced this pull request Apr 8, 2026
* main: (522 commits)
  fix(browser): re-check interaction-driven navigations (openclaw#63226)
  test: reuse verbose directive reply imports
  test: reuse exec directive reply imports
  fix(browser): harden browser control override loading (openclaw#62663)
  Matrix: report startup failures as errors
  auth: persist explicit profile upserts directly
  test(doctor): mock memory-core runtime seam
  auth: avoid external cli sync on profile upsert
  feat: parallelize character eval runs
  fix: load QA live provider overrides
  build: stage nostr runtime dependencies
  fix(dotenv): block workspace runtime env vars (openclaw#62660)
  build: narrow plugin SDK declaration build
  test: harden Parallels macOS smoke fallback
  fix(memory): accept embedded dreaming heartbeat tokens
  test: harden provider mock isolation
  docs(config): tighten wording in reference
  test: reuse followup runner imports
  test: reuse image generate tool imports
  Align remote node exec event system messages with untrusted handling (openclaw#62659)
  ...
eleqtrizit added a commit that referenced this pull request Apr 8, 2026
* fix(dotenv): block workspace runtime env vars

Co-authored-by: zsx <[email protected]>

* docs(changelog): add workspace dotenv runtime-control entry

* fix(dotenv): block workspace gateway port override

---------

Co-authored-by: zsx <[email protected]>
Co-authored-by: Devin Robison <[email protected]>
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
* fix(dotenv): block workspace runtime env vars

Co-authored-by: zsx <[email protected]>

* docs(changelog): add workspace dotenv runtime-control entry

* fix(dotenv): block workspace gateway port override

---------

Co-authored-by: zsx <[email protected]>
Co-authored-by: Devin Robison <[email protected]>
ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
* fix(dotenv): block workspace runtime env vars

Co-authored-by: zsx <[email protected]>

* docs(changelog): add workspace dotenv runtime-control entry

* fix(dotenv): block workspace gateway port override

---------

Co-authored-by: zsx <[email protected]>
Co-authored-by: Devin Robison <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
* fix(dotenv): block workspace runtime env vars

Co-authored-by: zsx <[email protected]>

* docs(changelog): add workspace dotenv runtime-control entry

* fix(dotenv): block workspace gateway port override

---------

Co-authored-by: zsx <[email protected]>
Co-authored-by: Devin Robison <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
* fix(dotenv): block workspace runtime env vars

Co-authored-by: zsx <[email protected]>

* docs(changelog): add workspace dotenv runtime-control entry

* fix(dotenv): block workspace gateway port override

---------

Co-authored-by: zsx <[email protected]>
Co-authored-by: Devin Robison <[email protected]>
@eleqtrizit
eleqtrizit deleted the 361 branch June 30, 2026 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants