-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
Bug: openclaw skills install changes /tmp permissions from 1777 to 0700 #101224
Copy link
Copy link
Closed
Closed
Copy link
Labels
P0Emergency: data loss, security bypass, crash loop, or unusable core runtime.Emergency: data loss, security bypass, crash loop, or unusable core runtime.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.Crash, hang, restart loop, or process-level availability failure.impact:ux-release-blockerA non-technical user is blocked without terminal, logs, config, or support.A non-technical user is blocked without terminal, logs, config, or support.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.no-staleExclude from stale automationExclude from stale automation
Description
Metadata
Metadata
Assignees
Labels
P0Emergency: data loss, security bypass, crash loop, or unusable core runtime.Emergency: data loss, security bypass, crash loop, or unusable core runtime.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.Crash, hang, restart loop, or process-level availability failure.impact:ux-release-blockerA non-technical user is blocked without terminal, logs, config, or support.A non-technical user is blocked without terminal, logs, config, or support.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.no-staleExclude from stale automationExclude from stale automation
Type
Fields
Priority
None yet
Bug:
openclaw skills installchanges/tmpdirectory permissions from 1777 to 0700Summary
When OpenClaw installs or updates skills via the clawhub skill installation mechanism, it creates temporary working directories under
/tmpusingfs.mkdirwithmode: 0o700. Due to Node.js'sfs.mkdir({ recursive: true })behavior, this inadvertently changes the permissions of the/tmpdirectory itself from1777(sticky, world-writable) to0700(owner-only), breaking all other services that depend on/tmp.Environment
/tmp: on root filesystem (not a separate tmpfs mount)Reproduction
/tmphas correct permissions:stat -c '%a' /tmp→1777openclaw skills install <skill>or a cron job that calls the skills update flow)/tmppermissions again:stat -c '%a' /tmp→0700Root Cause
The
openclaw-skillsprocess creates temp directories like/tmp/openclaw-clawhub-skill-<random>and/tmp/openclaw-skill-clawhub-<uuid>-<random>using Node.jsfs.mkdir(path, { recursive: true, mode: 0o700 }).On Node.js, when
recursive: trueis used with amodeoption, the recursive implementation may callchmodon existing parent directories in the path. This is a known Node.js behavior. Since/tmpis the parent of the temp directory being created,/tmpitself gets chmod'd to0700.Evidence (auditd logs)
An audit watch (
-w /tmp -p a -k tmp_perm_change) captured the exact sequence:Step 1:
/tmpis041777(directory, sticky, 1777):Step 2: A temp dir is created under
/tmpwith mode 0700:Step 3:
/tmpis now040700(directory, 0700) — permissions changed!:The syscall number 53 on ARM64 is
mkdirat. Thea2=0x1c0=0o700in octal. In the span of 1 millisecond,/tmpwent from041777to040700.This was reproducible across multiple days (observed on 2026-07-06 04:01 and 2026-07-07 04:00).
Impact
/tmpbeing world-writable breaks (MySQL, PHP-FPM, bt-monitor, system tools, etc.)Suggested Fix
Use
os.tmpdir()or a subdirectory that doesn't clobber/tmpitself — e.g., create/tmp/openclaw-skill-staging/first (without recursive), then create temp dirs inside it.Or don't pass
modetofs.mkdirwhen creating dirs under/tmp— the default mode (0o777 & ~umask) is fine for temp staging dirs, and won't trigger the recursive chmod on/tmp.Or explicitly restore
/tmppermissions after skill installation completes:fs.chmod('/tmp', 0o1777).Workaround
Users can add a cron job to restore
/tmpafter skill updates:Or rewrite the update cron task to only check for updates (not install), and install manually.