Skip to content

fix: serialize concurrent unlock attempts - #35

Merged
abruption merged 1 commit into
mainfrom
test/24-toctou-matrix
Sep 22, 2026
Merged

abruption merged 1 commit into
mainfrom
test/24-toctou-matrix

Conversation

@abruption

Copy link
Copy Markdown
Owner

Summary

  • replace timer-based revalidation races with deterministic fixture commands
  • document the evidence transition matrix for transcript, owner identity, lock inode, and owner lock-set changes
  • reproduce and fix concurrent CLI unlocks sending SIGTERM twice to the same PID
  • add a private same-user advisory operation lease keyed by canonical CODEX_HOME and thread UUID
  • fail closed when lease contention or secure coordination setup prevents exclusive ownership

Safety behavior

The operation lease is outside Codex native lock paths. Its file existence is never treated as lock evidence, and codex-unlock still never deletes native lock files, sends SIGKILL, or bypasses full final revalidation. Unsafe and already-unlocked cases do not create a lease.

Verification

  • npm ci
  • npm run check
  • npm run lint
  • npm test (34 passing)
  • npm run smoke:package
  • npm audit --audit-level=high
  • npm audit --omit=dev --audit-level=high

Closes #24
Closes #34

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.

security: serialize concurrent unlock attempts test: add a TOCTOU and concurrent-owner regression matrix

1 participant