Skip to content

Allocate run-binding refresh returns an existing lease id without the lease id #4909

Closed

Description

@thymikee

refreshExistingRunBinding (packages/daemon/src/resources/lease-registry.ts) returns an existing lease, with its id, to any lease_allocate that repeats the tenant, runId, backend, provider, device key, and clientId of the lease.

The lease id is now the bearer credential for a leased session (ADR 0007). The CLI uses a random clientId and runId, so these act as hidden secrets for CLI clients. A direct RPC or SDK caller that uses a predictable runId and clientId can get another caller's lease id back.

Expected: a run-binding refresh returns the lease only when the request sends that lease id, or the daemon requires runId and clientId with at least 128 random bits before it returns the existing lease.

Activity

  1. apex-sentinel-staging commented on Nov 21, 2026

    @apex-sentinel-staging

    Apex Sentinel · Issue review

    Suggested label: bug

    The issue describes a concrete security defect in refreshExistingRunBinding: repeated lease allocation can return another caller's lease id when identifiers are predictable. It names affected file, behavior, threat model, and expected mitigation.

    Required sections

    • Steps to reproduce (missing)
    • Expected and actual behavior (missing)
    • Version or environment (missing)
  2. thymikee commented on Nov 21, 2026

    @thymikee
    MemberAuthor

    Follow-up from #4911 (lease id is the session credential on 0.22).

  3. thymikee commented on Nov 21, 2026

    @thymikee
    MemberAuthor

    Related, from the #4911 review: putHostLease (packages/daemon/src/resources/lease-registry.ts) still accepts host-chosen lease ids of 16 hex digits (64 bits), though the id is the client's credential. #4911 enforces 128 bits only on client allocate. Raise the host minimum when the macos-app host can be updated in step.

  4. added
    bug
    on Nov 22, 2026
  5. thymikee commented on Nov 22, 2026

    @thymikee
    MemberAuthor

    Fixed by #4947 (merged into 0.22).

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions