Skip to content

fix: reject unsafe state lock files - #119

Merged
dmoliveira merged 1 commit into
mainfrom
fix/state-lock-file-safety
Jul 30, 2026
Merged

dmoliveira merged 1 commit into
mainfrom
fix/state-lock-file-safety

Conversation

@dmoliveira

Copy link
Copy Markdown
Owner

Summary

  • anchor state lock operations to validated private directory descriptors
  • reject symlink, hardlink, special-file, ownership, permission, and identity-race hazards before using locks
  • revalidate successful and busy locks before status/PID effects and make PID writes complete/fail closed
  • preserve TUI fail-closed behavior through an OSError integrity subtype

Threat model

Protects against unsafe preexisting lock entries and namespace manipulation by other users/groups. The configured state-root ancestry, malicious processes sharing the effective UID, and non-local filesystem locking semantics remain trusted/out of scope.

Validation

  • full suite: 453 passed, 85% coverage
  • Python 3.11 focused state/lifecycle/service/TUI suite: 148 passed
  • state security suite: 49 passed
  • repeated concurrent creation: 20/20 plus independent 10/10
  • touched Ruff, format, compile, and diff checks passed
  • final security review: GO; no critical/high/medium findings

Runtime-Session: ses_057afdc3effemiOJ2zfmjJiDqe

Runtime-Session: ses_057afdc3effemiOJ2zfmjJiDqe
@dmoliveira
dmoliveira merged commit 53ea256 into main Jul 30, 2026
2 checks passed
@dmoliveira
dmoliveira deleted the fix/state-lock-file-safety branch July 30, 2026 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant