Skip to content

Close the UDS socket bind-to-chmod race in the daemon #1506

Closed

Description

@malibio

Overview

The daemon binds its Unix socket at the ambient umask and then sets 0o600 as a second step, leaving a brief window where the socket exists at the process umask.

Problem Statement

Between bind() and set_permissions(0o600) the socket may be momentarily accessible to other local users on a shared-home system.

Proposed Solution

Apply umask(0o177) around the bind, or bind inside a 0o700 directory, so the socket is never exposed. Governed by ADR-052.

Acceptance Criteria

  • No window exists where the socket is more permissive than owner-only
  • Code passes bun run quality:fix; tests pass

Technical Specifications

Reference Files

  • packages/daemon/src/main.rs (~155-158, 205-208)
  • Decision: ADR-052

Related Issues

Activity

  1. malibio commented on Jul 6, 2026

    @malibio
    CollaboratorAuthor

    Frontend baseline: 146 test files passed, 3939 tests passed.

  2. self-assigned this
    on Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions