Skip to content

V2 deduplication cleanup can delete unrelated files through a temporary-directory symlink #145

Closed

Description

@YuriNek0

Problem

OpenCode V2 plugin coordinate alerts through a predictable directory in shared temporary storage. If that directory is a symlink, marker cleanup follows it and can delete files older than an hour in the target directory (if OpenCode process’s filesystem permissions allowed).

Reproduction (Linux)

  1. Create a target directory A containing a disposable file B with a modification time older than one hour.
  2. Assuming TMPDIR is /tmp.
  3. In /tmp/opencode-notifier-<uid>, create a symlink to the target directory A.
  4. Invoke the V2 delivery-claim function to run its cleanup pass.
  5. The disposable file B is removed.

Expected behavior

Claim cleanup must not follow a directory symlink into unrelated storage. If claim storage cannot be trusted, alerts should still be delivered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions