Skip to content

Verify and enforce client-owned destinations for remote capture stop and report #4518

Open

Description

@thymikee

Umbrella: #4368. The user authorized Claude planning, assumption verification and completion workers, followed by correctness-preserving cleanup. Source authority: main ddbfc85. No runtime proof is claimed. Preserve typed errors, existing command envelopes, #4050 full-unit fallback and meaningful integration/regression/native evidence. Do not merge, release, push tags, weaken assertions or retry failures blindly.

Purpose: A remote response must not choose arbitrary local write destinations when completing an earlier capture.

Source trigger (reproduce first): packages/remote/src/daemon-artifacts.ts resolveMaterializedArtifactPath accepts response artifact.localPath verbatim on record stop, trace stop and perf stop/report when the current request did not register a path. artifact-download.ts writes through createWriteStream and removes the destination on transfer error. Current tests use benign echoed paths; they do not independently establish earlier client authority.

First completion gate: A controlled loopback/provider test must distinguish a client-registered capture destination from a hostile response-only localPath outside it. Prove the actual write boundary using owned temporary paths, with correct artifact/auth/hash responses. If an earlier guard prevents that write, reject or narrow this candidate. Never use a real user file.

Blocked by: open external #4511 touches the same artifact materialization owners. Read its current disposition before scheduling implementation. Do not modify, take over, stack on or duplicate the external PR. No implementation starts until the overlap is reconciled explicitly.

Proposed invariant: Only current or earlier client-owned capture state can authorize a destination; a daemon echo is not authority. Before coding, decide missing-record behavior, capture/session generation identity, restart/another-process behavior, derived report paths and state lifetime at the existing owner. The proposed remote-connection-state field is not yet an adopted design. Do not create a second global store/cache or infer arbitrary paths from untrusted response names. Coordinate publication atomicity with #4511 rather than cloning a helper. Preserve actual caller-chosen path semantics unless a separate finite policy explicitly changes them.

Required proof after contract adoption: Real command-route start/stop/report across processes/cwd, hostile destination and symlink cases at the correct authority boundary, interrupted-transfer destination preservation, generation/session isolation, compatibility trace and independent source review. Run exact-head affected validation with full-unit fallback. This client-only authority change does not require a device unless dispatch/native behavior changes. No runtime reproduction or readiness claim exists yet.

Activity

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

    @apex-sentinel-staging

    Apex Sentinel · Issue review

    Suggested label: bug

    The issue reports that remote capture completion may accept a response-supplied artifact.localPath verbatim and write to it, asking to verify and enforce that only client-owned destinations are authorized; this is a concrete potential security/behavioral defect with specific code paths and acceptance criteria.

    Required sections

    • Steps to reproduce (missing)
    • Expected and actual behavior (missing)
    • Version or environment (missing)
  2. added
    bugSomething isn't working
    and removed on Nov 14, 2026
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions