diff --git a/CHANGELOG.md b/CHANGELOG.md index 01622c1e2..b34b5ec4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,15 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). project milestone planning. Includes BDD test coverage for the new workflow documentation and permission configuration. +- **Git Worktree TOCTOU Race Condition** (#7507): Fixed a Time-Of-Check-To-Time-Of-Use + (TOCTOU) race condition in `git_worktree.py` that could cause `git worktree add` + operations to fail under concurrent execution. The fix replaces the unsafe + `mkdtemp()` + `rmdir()` pattern with a parent-directory approach that maintains + the OS-level uniqueness guarantee throughout the entire operation. The parent + temporary directory is now persisted and properly cleaned up on both success and + failure paths. Comprehensive BDD test coverage validates the fix under concurrent + execution and confirms proper cleanup behavior. + ### Fixed - **Atomic `server_connect` config writes** (#993): Fixed `server_connect` in @@ -315,6 +324,8 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). are also protected. The DI container registration as `providers.Singleton` is now correct and safe. +- **TOCTOU Race Condition in Git Worktree Sandbox** (#7507): Fixed Time-Of-Check-To-Time-Of-Use race condition in `GitWorktreeSandbox.create()` by replacing unsafe mkdtemp+rmdir pattern with persistent parent directory approach. Parent directory is now held throughout operation lifetime and properly cleaned up in all error paths (timeout, CalledProcessError, OSError) and in the cleanup() method, eliminating race window where another process could claim the worktree path. Comprehensive BDD coverage added for all error-path cleanup branches. + - **Validation Gate Empty-Run Guard** (#7508): Fixed `ApplyValidationSummary.all_required_passed` returning `True` when zero validations were run, silently bypassing the apply gate. The property now returns `False` when the validation result set is empty (`is_empty` is `True`), ensuring @@ -400,3 +411,4 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). renders permission requests directly in the conversation stream for single-file operations. Users can allow/reject with single-key shortcuts (`a`/`A`/`r`/`R`), navigate with arrow keys, confirm with `Enter`, or press `v` to open the full + diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index ff7795e84..65b9ab558 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -24,3 +24,4 @@ Below are some of the specific details of various contributions. * HAL 9000 has contributed automated bug fixes, CLI output formatting improvements, and ongoing maintenance as part of the CleverAgents automation system. * HAL 9000 has contributed the file edit encoding parameter fix (PR #8258 / issue #7559). * HAL 9000 has contributed the architecture-pool-supervisor milestone assignment feature (PR #8188 / issue #7521): added `forgejo_update_pull_request` permission and documented the PR workflow for major spec changes, enabling automatic milestone assignment for specification PRs. +* HAL 9000 has contributed the git worktree TOCTOU race condition fix (PR #8178 / issue #7507): replaced the unsafe mkdtemp() + rmdir() pattern with a parent-directory approach to eliminate the race window in concurrent git worktree operations.