🛡️ Sentinel: [CRITICAL] Restrict shell_execute to allowlist#32
🛡️ Sentinel: [CRITICAL] Restrict shell_execute to allowlist#32JustinWoodring wants to merge 1 commit intomainfrom
Conversation
Implements a security control in `slatron-server`'s Rhai scripting engine to restrict `shell_execute` to a specific allowlist of commands (`yt-dlp`, `ffmpeg`, `ffprobe`). Previous behavior allowed execution of arbitrary commands (though via `Command::new` not shell, first argument was the binary), presenting a risk of arbitrary code execution by script authors. Changes: - Modified `slatron-server/src/rhai_engine/mod.rs` to add `ALLOWED_COMMANDS` constant and check `cmd` against it. - Added unit tests in `slatron-server/src/rhai_engine/security_test.rs` to verify authorized and unauthorized commands. - Cleaned up lint warnings in security tests. This addresses the RCE vulnerability documented in `.jules/sentinel.md`. 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. |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
Restricted the
shell_executefunction in the server's scripting engine to only allowyt-dlp,ffmpeg, andffprobe. This prevents arbitrary command execution by users with script editing permissions. Added tests to verify the restriction.PR created automatically by Jules for task 1560447406316240706 started by @JustinWoodring