Skip to content

security: bind OAuth connection publication to stable directory authority #342

Description

@seonghobae

Buyer/security gap

Provider-OAuth connection documents must not trade same-object publication authority for pathname convenience. POSIX renameat() constrains namespace resolution with directory descriptors but still consumes a source pathname; that is not proof that final mutation consumed the exact opened/reviewed source object. DiskSage therefore keeps existing-record replacement unavailable rather than presenting repeated pathname checks as exact-source-object mutation.

Current exact owner evidence — 2026-09-09 KST

Authoritative platform contract

POSIX.1-2024 rename()/renameat() are pathname operations; directory descriptors constrain resolution but do not turn a source pathname into an opened-file-handle precondition. Linux O_TMPFILE/linkat(..., AT_EMPTY_PATH) are platform-specific and do not by themselves provide a portable existing-destination replacement contract.

Microsoft exposes handle-oriented rename metadata through FILE_RENAME_INFO.RootDirectory and SetFileInformationByHandle(FileRenameInfo), but DiskSage still needs a complete design binding temporary creation, final replacement, reparse handling, cleanup, ACL/privacy policy, and durability to accepted native handles.

On macOS, namespace atomicity, fsync, and stronger device-flush semantics remain distinct; claims must match the primitive actually exercised.

Current #344 contract

Production fail-closes existing-record replacement when exact-source-object mutation cannot be proved. Create-new publication remains separate and retains exact private-mode admission, descriptor-relative no-follow authority, absolute destination/policy boundaries, exact opened/final identity and byte verification, bounded final reads/serialization, exact-private parent requirements, and descriptor-bound cleanup. Missing-parent pathname provisioning and delete-and-create replacement are not authorized shortcuts.

Remaining RED/GREEN acceptance

  1. fix(ci): repair contract-doc path filtering #338 exact 8b0e2b... must first earn terminal current-head GREEN. Source-absent Windows success is not provider runtime evidence.
  2. After fix(ci): repair contract-doc path filtering #338 GREEN, fix: make cloud operational help a successful terminal action #212 must adopt it through ordinary non-force ancestry, remove the competing leaf provider-oauth-windows.yml, and its resulting exact Test must execute provider_oauth_cli_process from source on Windows and finish GREEN. Predecessor Windows evidence does not transfer.
  3. fix: make cloud operational help a successful terminal action #212's Ubuntu full Test on the resulting exact head must also be terminal GREEN before CLI/process/platform readiness.
  4. First-create behavior stays distinct from replacement. Failure cleanup must never pathname-unlink an unrelated replacement object.
  5. Unix durable connection-document load admission remains exact 0600; error classification must not turn pathname metadata into read/mutation authority.
  6. Any future Unix/macOS enabled replacement must prove at the final identity-check→mutation boundary that the object mutated is the exact reviewed source. Another pathname recheck is insufficient.
  7. Windows must pin directory/file namespace authority with native handles through temporary creation and final replacement, reject reparse drift, enforce private ACL policy, define data/namespace flush behavior, and fail closed when unavailable.
  8. macOS evidence must name the persistence primitive actually exercised and not claim stronger power-loss durability than demonstrated.
  9. Existing destination symlink/reparse/non-regular, ancestor replacement, mode/content drift, cleanup substitution, permission/resource failure, and partial-failure scenarios remain fail closed.
  10. No source copy into fix: make cloud operational help a successful terminal action #212 or sibling services; DiskSage retains filesystem invariants through owner contracts. Exact-head applicable Test/Release/Security/SAST/CodeQL/coverage/review evidence must be terminal success before integration.

Close only after #212 inherits the exact current owner contracts with its own source-present GREEN evidence, Windows parity is addressed for every exposed update path, and any future enabled replacement has adversarial real-filesystem exact-source and durability evidence.

Activity

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 workingpriority: highHigh-priority or P1 work

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions