Skip to content

[codex] fix: allow trusted .openclaw symlink#72713

Draft
sgaofen wants to merge 17 commits into
openclaw:mainfrom
sgaofen:codex/fix-72572-openclaw-symlink
Draft

[codex] fix: allow trusted .openclaw symlink#72713
sgaofen wants to merge 17 commits into
openclaw:mainfrom
sgaofen:codex/fix-72572-openclaw-symlink

Conversation

@sgaofen

@sgaofen sgaofen commented Apr 27, 2026

Copy link
Copy Markdown

Summary

Closes #72572.

This restores support for dotfile-managed ~/.openclaw directories while keeping exec approval paths hardened on both the Node and macOS node-host paths.

  • allow trusted first-level ~/.openclaw symlinks on POSIX after validating link ownership, link location, target ownership, target permissions, and stable resolved ancestors
  • keep Windows .openclaw symlink targets blocked until ACL validation exists
  • keep rejecting user-controlled chained symlink targets, deeper symlink traversal, and symlinked exec-approvals.json destinations
  • fail closed for unsafe approvals reads in runtime policy paths while keeping snapshot/control-plane reads usable
  • apply equivalent state-dir, JSON store, and socket-parent hardening on macOS, including symlinked OPENCLAW_STATE_DIR overrides and system /tmp//var symlink roots
  • document the supported symlink shape in approvals CLI docs

Validation

  • pnpm docs:list
  • pnpm exec oxfmt --check --threads=1 src/infra/exec-approvals.ts src/infra/exec-approvals-store.test.ts
  • pnpm test src/infra/exec-approvals-store.test.ts
  • swiftc -parse apps/macos/Sources/OpenClaw/ExecApprovals.swift apps/macos/Sources/OpenClaw/ExecApprovalsSocket.swift apps/macos/Sources/OpenClaw/NodeMode/MacNodeRuntime.swift apps/macos/Tests/OpenClawIPCTests/ExecApprovalsSocketPathGuardTests.swift apps/macos/Tests/OpenClawIPCTests/ExecApprovalsStoreRefactorTests.swift
  • git diff --check
  • pnpm check:changed (core lanes passed; apps lane stopped because swiftlint is not installed locally)
  • swift test --filter ExecApprovalsSocketPathGuardTests attempted; SwiftPM hung while downloading/building Sparkle artifact locally
  • codex review -c model="gpt-5.4" --base origin/main

AI-assisted: yes
lobster-biscuit

@clawsweeper

clawsweeper Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

Keep open: the underlying symlinked .openclaw bug is still real, but this draft PR is not merge-ready because it is conflicting, lacks real behavior proof, and its head is stale against current exec-approvals state-dir and hardening behavior.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #72572
Summary: This PR is a draft candidate fix for the canonical symlinked .openclaw exec approvals issue; the canonical issue remains open while multiple candidate PRs need security-reviewed convergence.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Canonical path: Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review.

So I’m closing this here because the remaining work is already tracked in the canonical issue.

Review details

Best possible solution:

Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review.

Do we have a high-confidence way to reproduce the issue?

Yes. Source inspection shows openclaw exec-policy preset reaches the exec approvals writer, and current main still has a test expecting a symlinked .openclaw component to be rejected.

Is this the best way to solve the issue?

No, not as submitted. The compatibility direction is valid, but the stale draft needs a rebase that preserves current state-dir behavior and hardening before it can be the best fix.

Security review:

Security review needs attention: The patch changes command-approval filesystem trust boundaries and currently misses current main's directory hardening on the Node path.

  • [medium] Approval directory hardening is missing on PR head — src/infra/exec-approvals.ts:285
    The PR head no longer performs current main's POSIX 0700 chmod after creating the approvals directory, leaving command-approval state permissions dependent on existing mode or process umask.
    Confidence: 0.86
  • [medium] Symlink trust boundary needs maintainer review — apps/macos/Sources/OpenClaw/ExecApprovalsSocket.swift:755
    The branch allows previously rejected symlink shapes in approval storage and macOS socket handling, so ownership, permissions, chained symlinks, destination-file symlinks, and socket placement need explicit security review before merge.
    Confidence: 0.84

AGENTS.md: found and applied where relevant.

What I checked:

  • stale F-rated PR: PR was opened 2026-04-27T08:40:23Z, is older than 60 days, and the latest review rated it F.
  • proof blocker: real behavior proof is missing and proof tier is F, so this branch is not merge-ready without contributor follow-up.
  • no human follow-up: live comments and timeline hydrated by apply contain no non-automation activity after the ClawSweeper review.

Likely related people:

  • Takhoffman: Commit 4bf94aa added the local exec-policy CLI and updated the approvals write path used by the reported command. (role: introduced affected CLI surface; confidence: high; commits: 4bf94aa0d669; files: src/cli/exec-policy-cli.ts, src/infra/exec-approvals.ts, src/infra/exec-approvals-store.test.ts)
  • vincentkoc: Commit 364d498 repaired trusted OPENCLAW_HOME symlinks in the same exec approvals path and tests. (role: recent symlink-fix contributor; confidence: high; commits: 364d49889e67; files: src/infra/exec-approvals.ts, src/infra/exec-approvals-store.test.ts)
  • steipete: Commit 538605f extracted filesystem safety primitives and moved exec approvals toward the shared fs-safe guard surface. (role: adjacent filesystem-safety contributor; confidence: high; commits: 538605ff44d2; files: src/infra/fs-safe-advanced.ts, src/infra/exec-approvals.ts)
  • jesse-merhi: Commit c9707ab recently changed command authorization and exec approvals store/tests adjacent to this path. (role: recent adjacent exec approvals contributor; confidence: medium; commits: c9707ab635b9; files: src/infra/exec-approvals.ts, src/infra/exec-approvals-store.test.ts, src/gateway/server-methods/exec-approval.ts)

Codex review notes: model internal, reasoning high; reviewed against 36dd9ee3c3c1.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels May 20, 2026
@clawsweeper

clawsweeper Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat.

Where did the egg go?
  • The egg game starts only after the PR passes the real-behavior proof check.
  • Before that, no creature or rarity is rolled. The treat waits for real proof.
  • This is still just collectible flavor: proof affects review readiness, not creature quality.

@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Jun 4, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Jun 4, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label Jun 15, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 17, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added stale Marked as stale due to inactivity triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 18, 2026
@clawsweeper

clawsweeper Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: [codex] fix: allow trusted .openclaw symlink This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: macos App: macos docs Improvements or additions to documentation merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: exec-policy still rejects symlinked ~/.openclaw after #72377 replacement for #64663

1 participant