Harden update environment path resolution#77470
Conversation
|
Codex review: needs changes before merge. Summary Reproducibility: yes. from source inspection: current main omits Next step before merge Security Review findings
Review detailsBest possible solution: Keep the infra hardening in the owner files, add a single-line Unreleased changelog entry, then let maintainer/security review and CI decide landing. Do we have a high-confidence way to reproduce the issue? Yes, from source inspection: current main omits Is this the best way to solve the issue? Yes, mostly: blocking workspace Full review comments:
Overall correctness: patch is correct Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 8c7ec5d1f9ff. |
Adds the user-facing Unreleased Fixes entry for the workspace LOCALAPPDATA blocklist + portable Git path-prepend hardening change in this PR.
8e7411a to
479ee5d
Compare
* Harden update environment path resolution * docs(changelog): credit windows update env path hardening Adds the user-facing Unreleased Fixes entry for the workspace LOCALAPPDATA blocklist + portable Git path-prepend hardening change in this PR.
* Harden update environment path resolution * docs(changelog): credit windows update env path hardening Adds the user-facing Unreleased Fixes entry for the workspace LOCALAPPDATA blocklist + portable Git path-prepend hardening change in this PR.
* Harden update environment path resolution * docs(changelog): credit windows update env path hardening Adds the user-facing Unreleased Fixes entry for the workspace LOCALAPPDATA blocklist + portable Git path-prepend hardening change in this PR.
* Harden update environment path resolution * docs(changelog): credit windows update env path hardening Adds the user-facing Unreleased Fixes entry for the workspace LOCALAPPDATA blocklist + portable Git path-prepend hardening change in this PR.
* Harden update environment path resolution * docs(changelog): credit windows update env path hardening Adds the user-facing Unreleased Fixes entry for the workspace LOCALAPPDATA blocklist + portable Git path-prepend hardening change in this PR.
Harden update environment path resolution
Summary
Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause (if applicable)
.envfiltering did not block the Windows local app-data key, and portable Git discovery trusted an explicit env object beforeprocess.env.Regression Test Plan (if applicable)
src/infra/dotenv.test.ts,src/infra/update-global.test.tsUser-visible / Behavior Changes
Windows update path setup no longer derives portable Git directories from a workspace-provided local app-data value.
Diagram (if applicable)
Security Impact (required)
No)No)No)Yes)No)Yes, explain risk + mitigation: The command resolution surface is narrowed by preventing workspace dotenv values from selecting the portable Git root used during updates.Repro + Verification
Environment
Steps
.envcontaining a Windows local app-data key that points at an attacker-controlled portable Git tree.Expected
Actual
src/infra/dotenv.test.tsandsrc/infra/update-global.test.tspassed under the infra Vitest config.Evidence
Targeted validation:
Human Verification (required)
What you personally verified (not just CI), and how:
openclaw updaterun.Review Conversations
If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.
Compatibility / Migration
Yes)No)No)Risks and Mitigations
.envto supply this Windows host-root variable for update behavior..envis untrusted for host-root controls; trusted shell or global config remains the source for process-local update environment values.