Skip to content

[high, unverified] Rename or Move onto an existing name silently replaces the other file #508

Open

Description

@Interstellar-code

Unverified: the bug-hunt's skeptic check did not reach a verdict on this finding. Verify it before fixing.

Location: src/screens/files/files-screen.tsx:3034

Severity: high · Confidence: high

When

The user renames or moves a file to a name or path where another file already exists, then saves.

Effect

The other file is replaced and its contents are lost, and the dialog closes as if the rename worked.

Evidence

Rename/move submit (lines 2017-2038) sends action: 'rename' with to: nextPath or to: value, and the Save button at line 3034 has no existence check or confirmation. Server src/routes/api/files.ts:451-452 does await fs.mkdir(path.dirname(toPath), { recursive: true }) then await fs.rename(fromPath, toPath). Node fs.rename replaces an existing destination file on POSIX systems without error.

Skeptic note

no usable skeptic answer


Bug-hunt id: bh:550c3ab8 · run: sweep:screens / slice screens · source: ~/.bughunt-data/repos/hermes-switchui/reports/2026-10-27-screens.json (local path on the owner's Mac)

Filed from the 2026-10-27 bug-hunt sweep (unverified, not triaged).

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions