Skip to content

[backend] World-writable chmod storm + sleep-retry loop in tool uninstall (removePathRobust) #97

Closed

Description

@devin-ai-integration

removePathRobust in manager.go:111-131:

_ = filepath.WalkDir(path, func(p string, d fs.DirEntry, walkErr error) error {
    if walkErr == nil {
        _ = os.Chmod(p, 0o666)
    }
    return nil
})
time.Sleep(50 * time.Millisecond)

Three problems:

  1. 0o666 on every file — marks every tool file world-writable on POSIX systems purely to work around Windows read-only attributes. On multi-user machines this briefly exposes all installed tool binaries as writable by any local user.
  2. Fixed time.Sleep(50ms) retries instead of real backoff — a busy-wait guess, not a synchronization mechanism. If a file lock persists the loop just fails after ~150ms.
  3. Both error returns ignored — WalkDir and Chmod errors are discarded, so partial permission failures are invisible.

Activity

  1. sanketpatel32 commented on Nov 22, 2026

    @sanketpatel32
    Owner

    Fixed in PR #128 (merged 76e635c, shipped in v0.51.0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions