You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
security: revalidate every unlock invariant immediately before SIGTERM #9
unlockThread() performs a strong initial inspection, but the final check before SIGTERM only verifies the owner PID/start time, the held lock, and the current opener. While the transcript is hashed and process evidence is collected, the owner can start new work, become a shared service, or acquire another thread lock.
The post-termination transcript hash detects some races only after the process has already been signaled.
Security impact
A session that was safe during the initial stability window can become active or otherwise unsafe before termination. The tool could then interrupt work despite its fail-closed contract.
Required behavior
Immediately before SIGTERM, revalidate every mutable safety invariant used to authorize termination:
same PID, process start time, UID, Codex identity, and non-shared-service status
same lock inode and actual held advisory lock
exactly one stable opener
owner still holds only the intended native thread lock
transcript remains the same stable file and still ends in event_msg/task_complete
Any changed or unavailable evidence must return refused with a structured reason. The remaining syscall-level race should be documented as requiring an upstream cooperative handoff for complete elimination.
Tests
Use real advisory locks and cover:
a new transcript record arriving during revalidation
Activity