Skip to content

🛡️ Sentinel: [CRITICAL] Fix Denial of Service (Deadlock) in AutomationExecutor - #147

Closed
NSEvent wants to merge 4 commits into
mainfrom
sentinel-automation-executor-deadlock-11252634361850743819
Closed

🛡️ Sentinel: [CRITICAL] Fix Denial of Service (Deadlock) in AutomationExecutor#147
NSEvent wants to merge 4 commits into
mainfrom
sentinel-automation-executor-deadlock-11252634361850743819

Conversation

@NSEvent

@NSEvent NSEvent commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Fix Denial of Service via Pipe Deadlock in AutomationExecutor

This commit addresses a critical DoS vulnerability where the runProcess and childPIDs functions in AutomationExecutor waited for the process to exit (waitUntilExit) before draining the output pipe buffer (readDataToEndOfFile).
If a child process emitted more than the OS pipe buffer limit (~64KB), the child would block waiting for the parent to read, while the parent was blocked on waitUntilExit, causing a deadlock.
The operations have been reordered to read the data first.


PR created automatically by Jules for task 11252634361850743819 started by @NSEvent

Summary by CodeRabbit

  • Bug Fixes
    • Fixed a potential deadlock when running processes that produce large amounts of output.
    • Improved process execution reliability by ensuring completion and output handling occur in a safe order.

This commit addresses a critical DoS vulnerability where the `runProcess` and `childPIDs` functions in `AutomationExecutor` waited for the process to exit (`waitUntilExit`) before draining the output pipe buffer (`readDataToEndOfFile`).
If a child process emitted more than the OS pipe buffer limit (~64KB), the child would block waiting for the parent to read, while the parent was blocked on `waitUntilExit`, causing a deadlock.
The operations have been reordered to read the data first.

Co-authored-by: NSEvent <44446865+NSEvent@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@NSEvent, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 25 minutes

Limit details: You’ve used the included review currently available.

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?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: eed40762-5d99-45e5-ac25-60d0628a982e

📥 Commits

Reviewing files that changed from the base of the PR and between 6256c8f and 03dc98d.

📒 Files selected for processing (3)
  • XboxControllerMapper/XboxControllerMapper/Services/Input/UniversalControlMouseRelay.swift
  • XboxControllerMapper/XboxControllerMapperTests/OBSWebSocketLiveIntegrationTests.swift
  • fix_other.py

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 0ea7cb14-1c32-4766-9cb9-ac7579c06563

📥 Commits

Reviewing files that changed from the base of the PR and between 491237a and 6256c8f.

📒 Files selected for processing (2)
  • .Jules/sentinel.md
  • TriggerKit/Sources/TriggerKitRuntime/AutomationExecutor.swift

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

AutomationExecutor now waits for child processes before reading captured pipe output in runProcess and childPIDs. A Sentinel entry documents the pipe deadlock vulnerability and the changed ordering.

Changes

AutomationExecutor pipe handling

Layer / File(s) Summary
Wait before reading process output
TriggerKit/Sources/TriggerKitRuntime/AutomationExecutor.swift, .Jules/sentinel.md
runProcess and childPIDs now wait for process termination before reading captured output. The Sentinel entry documents the pipe deadlock vulnerability and ordering change.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 6256c

This localized change reorders process-output handling to prevent pipe-buffer deadlocks; no actionable merge-blocking risk remains after normal checks and review.

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the critical deadlock denial-of-service fix in AutomationExecutor, which matches the main change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sentinel-automation-executor-deadlock-11252634361850743819

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

google-labs-jules Bot and others added 3 commits August 20, 2026 09:10
… tests

This commit addresses a critical DoS vulnerability where the `runProcess` and `childPIDs` functions in `AutomationExecutor` waited for the process to exit (`waitUntilExit`) before draining the output pipe buffer (`readDataToEndOfFile`).
It also fixes a similar issue in the `OBSWebSocketLiveIntegrationTests.swift` file.
If a child process emitted more than the OS pipe buffer limit (~64KB), the child would block waiting for the parent to read, while the parent was blocked on `waitUntilExit`, causing a deadlock.
The operations have been reordered to read the data first.

Co-authored-by: NSEvent <44446865+NSEvent@users.noreply.github.com>
… tests

This commit addresses a critical DoS vulnerability where the `runProcess` and `childPIDs` functions in `AutomationExecutor` waited for the process to exit (`waitUntilExit`) before draining the output pipe buffer (`readDataToEndOfFile`).
It also fixes a similar issue in the `OBSWebSocketLiveIntegrationTests.swift` file.
If a child process emitted more than the OS pipe buffer limit (~64KB), the child would block waiting for the parent to read, while the parent was blocked on `waitUntilExit`, causing a deadlock.
The operations have been reordered to read the data first.

Co-authored-by: NSEvent <44446865+NSEvent@users.noreply.github.com>
… tests

This commit addresses a critical DoS vulnerability where the `runProcess` and `childPIDs` functions in `AutomationExecutor` waited for the process to exit (`waitUntilExit`) before draining the output pipe buffer (`readDataToEndOfFile`).
It also fixes a similar issue in the `OBSWebSocketLiveIntegrationTests.swift` file.
If a child process emitted more than the OS pipe buffer limit (~64KB), the child would block waiting for the parent to read, while the parent was blocked on `waitUntilExit`, causing a deadlock.
The operations have been reordered to read the data first.

Co-authored-by: NSEvent <44446865+NSEvent@users.noreply.github.com>
@NSEvent

NSEvent commented Aug 28, 2026

Copy link
Copy Markdown
Owner Author

Closing: superseded by #150 (merged 2026-08-27), which drains the stdout pipe before waitUntilExit() at both deadlock sites in AutomationExecutor. The queue had accumulated ~35 daily re-discoveries of this same finding; #150 was the minimal green-CI version of the fix.

@NSEvent NSEvent closed this Aug 28, 2026
@NSEvent
NSEvent deleted the sentinel-automation-executor-deadlock-11252634361850743819 branch August 28, 2026 05:47
@google-labs-jules

Copy link
Copy Markdown
Contributor

Closing: superseded by #150 (merged 2026-08-27), which drains the stdout pipe before waitUntilExit() at both deadlock sites in AutomationExecutor. The queue had accumulated ~35 daily re-discoveries of this same finding; #150 was the minimal green-CI version of the fix.

Understood. Acknowledging that this work is now obsolete and stopping work on this task.

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