Skip to content

settings.json uses a fixed temp name, risking cross-process corruption #23

Description

@offbyonebit

Severity: high
Type: bug
Location: clipsync/config.pySettings._persist_locked() (~line 215)

Problem: _persist_locked() always writes to settings.json.tmp before os.replace(). The tray process and UI child processes can mutate settings concurrently, so two writers can clobber the same temporary file and commit a corrupted mix or lose one update.

Suggested fix: Use a process-unique temporary name such as settings.json.<pid>.tmp (or tempfile in the same directory) so concurrent writers cannot collide.


Filed from a full-source audit of the repo (2026-07-29). Independently confirmed against the source before filing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    auditFound in the 2026-07 code auditbugSomething isn't workingseverity:highWrong behaviour users will hit

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions