π‘οΈ Sentinel: [CRITICAL] Fix arbitrary command execution in Rhai scripts#29
π‘οΈ Sentinel: [CRITICAL] Fix arbitrary command execution in Rhai scripts#29JustinWoodring wants to merge 1 commit intomainfrom
Conversation
Restricted `shell_execute` in `slatron-server` Rhai engine to an allowlist of commands (`yt-dlp`, `ffmpeg`, `ffprobe`) to prevent arbitrary code execution (RCE). Added security tests to verify the fix. 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. |
π‘οΈ Sentinel: [CRITICAL] Fix arbitrary command execution in Rhai scripts
π¨ Severity: CRITICAL
π‘ Vulnerability: The
shell_executefunction in the Rhai scripting engine allowed execution of arbitrary shell commands (e.g.,echo,ls, etc.) if a script was modified or injected.π― Impact: An attacker with script editing privileges (or if a script injection vulnerability existed) could execute arbitrary code on the server, potentially compromising the entire system.
π§ Fix: Implemented an allowlist in
slatron-server/src/rhai_engine/mod.rsthat restrictsshell_executeto onlyyt-dlp,ffmpeg, andffprobe. Attempts to run other commands now return a security error (code: -1).β Verification: Added unit tests in
slatron-server/src/rhai_engine/security_test.rsto confirm:1.
echo(arbitrary command) is blocked.2.
yt-dlp(allowed command) is permitted.PR created automatically by Jules for task 4956394237584817752 started by @JustinWoodring