Skip to content

Reject shared-writable directories for atomic JSON publication #487

Closed

Description

@Anionix

Classification

  • Category: correctness / filesystem integrity
  • Micro-category: temporary-name swap before publication
  • Severity: P2

Source

Expected

Successful atomic_write_json publication must install the inode populated by
this writer, not a different regular file that reused its temporary basename.

Observed

The temp inode is validated before writing, but os.replace resolves the
basename later. In a group/world-writable destination directory, another OS
principal can replace that entry after flush and cause unrelated bytes to be
published as lifecycle evidence.

Acceptance

  • Define the same-OS-principal directory ownership boundary explicitly.
  • Reject destination directories writable by group or other principals before
    creating a temporary file.
  • Preserve support for owner-private/owner-written run directories on macOS and
    Linux.
  • Add a deterministic rejection regression with no destination mutation.

Primary sources

Activity

  1. Anionix commented on Jul 24, 2026

    @Anionix
    OwnerAuthor

    The macOS ACL bypass found during final review is fixed at
    5ef7c1ffe5200ffb68f5d1b5b425c63961790c37.

    Darwin now inspects ACL_TYPE_EXTENDED through acl_get_fd_np on the retained
    directory descriptor and rejects any extended ACL before creating a temporary
    entry. The regression uses the real /bin/chmod +a API against a mode-0700
    directory and confirms the destination remains unchanged.

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

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions