🛡️ Sentinel: [CRITICAL] Fix Arbitrary Command Execution in Rhai Engine#34
🛡️ Sentinel: [CRITICAL] Fix Arbitrary Command Execution in Rhai Engine#34JustinWoodring wants to merge 1 commit intomainfrom
Conversation
…ngerous args - Implements strict allowlist for `shell_execute` in `slatron-server` (yt-dlp, ffmpeg, ffprobe only). - Adds argument validation to block dangerous flags (e.g., `yt-dlp --exec`). - Adds security regression tests in `security_test.rs`. Sentinel-Journal: 2025-10-26 - [Argument Injection in Allowed Tools] Co-authored-by: JustinWoodring <41842051+JustinWoodring@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. |
🛡️ Sentinel: [CRITICAL] Fix Arbitrary Command Execution in Rhai Engine
🚨 Severity: CRITICAL
💡 Vulnerability:
The
shell_executefunction inslatron-server's Rhai engine allowed executing arbitrary system commands. While intended for media tools likeyt-dlp, it lacked any validation, allowing full RCE. Additionally, tools likeyt-dlphave flags (--exec) that can execute commands, which were also unblocked.🎯 Impact:
Any user with permission to edit scripts (e.g., editors) could execute arbitrary code on the server, potentially taking full control of the system.
🔧 Fix:
is_command_allowedto restrict execution toyt-dlp,ffmpeg, andffprobe.are_args_allowedto inspect arguments and explicitly block the--execfamily of flags foryt-dlp.run_shell_executeto return a safe error map (code -1) if validation fails, preventing execution.✅ Verification:
slatron-server/src/rhai_engine/security_test.rs.shell_execute("echo", ...)is blocked.shell_execute("yt-dlp", ["--exec", ...])is blocked.PR created automatically by Jules for task 15552410223682778629 started by @JustinWoodring