🛡️ Sentinel: [CRITICAL] Fix Process pipe deadlock in AutomationExecutor - #144
🛡️ Sentinel: [CRITICAL] Fix Process pipe deadlock in AutomationExecutor#144NSEvent wants to merge 3 commits into
Conversation
**Severity:** CRITICAL **Vulnerability:** The `AutomationExecutor` executed child processes and waited for them to exit (`process.waitUntilExit()`) before attempting to read standard output or error pipes. **Impact:** If a child process writes more data than the OS pipe buffer can hold (~64KB), the child will block on write. If the parent is blocked on `waitUntilExit()`, a permanent deadlock occurs, leading to a Denial of Service. **Fix:** Modified `runProcess` and `childPIDs` to consume pipe output using `readDataToEndOfFile()` *before* calling `waitUntilExit()`, ensuring the buffer is drained and the child can complete safely. **Verification:** Static syntax validation was executed on modified files and related test files (`AutomationExecutorTests.swift`, `AutomationExecutorPolicyTests.swift`). Co-authored-by: NSEvent <44446865+NSEvent@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Warning Review limit reached
Next review available in: 24 minutes Limit details: You’ve used all 1 included review currently available under your plan. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan includes up to 1 review per rolling hour; 0 remain after this review. 📝 WalkthroughWalkthrough
ChangesProcess output ordering
Estimated code review effort: 2 (Simple) | ~5 minutes Merge Risk: ⚪ Minimal · up to The PR makes a localized process-output ordering change, and no actionable merge-blocking risk remains beyond normal checks and review. Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…or and Tests **Severity:** CRITICAL **Vulnerability:** The application executed child processes and waited for them to exit (`process.waitUntilExit()`) before attempting to read standard output or error pipes. **Impact:** If a child process writes more data than the OS pipe buffer can hold (~64KB), the child will block on write. If the parent is blocked on `waitUntilExit()`, a permanent deadlock occurs, leading to a Denial of Service. **Fix:** Modified `runProcess`, `childPIDs` (in `AutomationExecutor`), and `mediamtx` resolution (in `OBSWebSocketLiveIntegrationTests`) to consume pipe output using `readDataToEndOfFile()` *before* calling `waitUntilExit()`, ensuring the buffer is drained and the child can complete safely. Co-authored-by: NSEvent <44446865+NSEvent@users.noreply.github.com>
…or and Tests **Severity:** CRITICAL **Vulnerability:** The application executed child processes and waited for them to exit (`process.waitUntilExit()`) before attempting to read standard output or error pipes. In tests, it also created pipes that were never read. **Impact:** If a child process writes more data than the OS pipe buffer can hold (~64KB), the child will block on write. If the parent is blocked on `waitUntilExit()`, a permanent deadlock occurs, leading to a Denial of Service. **Fix:** Modified `runProcess`, `childPIDs` (in `AutomationExecutor`), and `mediamtx` resolution (in `OBSWebSocketLiveIntegrationTests`) to consume pipe output using `readDataToEndOfFile()` *before* calling `waitUntilExit()`, ensuring the buffer is drained and the child can complete safely. Additionally, replaced unread `Pipe()` instances with `FileHandle.nullDevice` to eliminate any risk of buffer overflow for discarded output streams. Co-authored-by: NSEvent <44446865+NSEvent@users.noreply.github.com>
Severity: CRITICAL
Vulnerability: The
AutomationExecutorexecuted child processes and waited for them to exit (process.waitUntilExit()) before attempting to read standard output or error pipes.Impact: If a child process writes more data than the OS pipe buffer can hold (~64KB), the child will block on write. If the parent is blocked on
waitUntilExit(), a permanent deadlock occurs, leading to a Denial of Service.Fix: Modified
runProcessandchildPIDsto consume pipe output usingreadDataToEndOfFile()before callingwaitUntilExit(), ensuring the buffer is drained and the child can complete safely.Verification: Static syntax validation was executed on modified files and related test files (
AutomationExecutorTests.swift,AutomationExecutorPolicyTests.swift).PR created automatically by Jules for task 10245832723257948522 started by @NSEvent
Summary by CodeRabbit