🛡️ Sentinel: [CRITICAL] Fix Process pipe deadlock DoS vulnerabilities - #102
🛡️ Sentinel: [CRITICAL] Fix Process pipe deadlock DoS vulnerabilities#102NSEvent wants to merge 4 commits into
Conversation
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. |
|
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 (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughSubprocess helpers adjust output-draining order and termination waits. Tailscale and network checks suppress unused output, while binary resolution handles execution failures and reads command output before termination checks. ChangesSubprocess Output Handling
Estimated code review effort: 2 (Simple) | ~10 minutes 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@XboxControllerMapper/XboxControllerMapperTests/OBSWebSocketLiveIntegrationTests.swift`:
- Around line 168-179: Make the return contract of resolveBinaryPath consistent
with its declared throws -> String signature: replace the nil return in the
which.run() catch branch with appropriate error propagation, and preserve the
existing successful path returning the resolved binary path for
start(binaryPath:).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 83b157ae-7d6f-4b91-b75a-0e52ed9a1570
📒 Files selected for processing (3)
TriggerKit/Sources/TriggerKitRuntime/AutomationExecutor.swiftXboxControllerMapper/XboxControllerMapper/Services/Input/UniversalControlMouseRelay.swiftXboxControllerMapper/XboxControllerMapperTests/OBSWebSocketLiveIntegrationTests.swift
Co-authored-by: NSEvent <44446865+NSEvent@users.noreply.github.com>
Co-authored-by: NSEvent <44446865+NSEvent@users.noreply.github.com>
Co-authored-by: NSEvent <44446865+NSEvent@users.noreply.github.com>
🚨 Severity: CRITICAL
💡 Vulnerability: When executing shell commands via
Foundation.Process, standard streams were left unread before callingwaitUntilExit(). If a child process output exceeded the OS pipe buffer (~64KB), the child blocked writing, and the parent blocked waiting for exit, resulting in a deadlock and application freeze (Denial of Service).🎯 Impact: Attackers or malformed inputs could intentionally output large data to stderr/stdout during macro or webhook execution to trigger an application deadlock and crash. Unhandled
try? process.run()followed bywaitUntilExit()also introduced uncatchable Obj-C exception crashes.🔧 Fix: Moved
pipe.fileHandleForReading.readDataToEndOfFile()beforewaitUntilExit()in TriggerKit and OBS integrations. Replaced unreadPipe()initializations withFileHandle.nullDevice. Added properdo-catchlaunch validation beforewaitUntilExit().✅ Verification: Statically validated all modified files for bracket/parenthesis syntax correctness. Verified that
waitUntilExit()is never called with unread pipes or after failed process launches.PR created automatically by Jules for task 7345657549228566205 started by @NSEvent
Summary by CodeRabbit
tailscale statuserrors.mediamtxas unavailable and reading command output in a safer order.ncoutput.