Sentinel: [CRITICAL] Fix Arbitrary Command Execution in Rhai Engine#30
Sentinel: [CRITICAL] Fix Arbitrary Command Execution in Rhai Engine#30JustinWoodring wants to merge 1 commit intomainfrom
Conversation
Restricts the `shell_execute` function in `slatron-server` Rhai engine to a specific allowlist of commands (`yt-dlp`, `ffmpeg`, `ffprobe`) to prevent arbitrary code execution (RCE). Also adds a regression test in `security_test.rs`. 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-serverallowed execution of arbitrary shell commands.🎯 Impact: An attacker with script editing privileges could execute arbitrary code on the server, potentially compromising the entire system.
🔧 Fix: Implemented an explicit allowlist for
shell_executeinslatron-server/src/rhai_engine/mod.rs. Onlyyt-dlp,ffmpeg, andffprobeare allowed.✅ Verification: Added
test_shell_execute_allowlistinslatron-server/src/rhai_engine/security_test.rswhich verifies that disallowed commands (e.g.,ls) are rejected with a security error, while allowed commands pass the check. Verified by runningcargo testinslatron-server.PR created automatically by Jules for task 5448247204337572309 started by @JustinWoodring