Skip to content

Comments

🛡️ Sentinel: [CRITICAL] Fix Arbitrary Command Execution in Rhai Engine#34

Closed
JustinWoodring wants to merge 1 commit intomainfrom
sentinel/fix-rhai-rce-15552410223682778629
Closed

🛡️ Sentinel: [CRITICAL] Fix Arbitrary Command Execution in Rhai Engine#34
JustinWoodring wants to merge 1 commit intomainfrom
sentinel/fix-rhai-rce-15552410223682778629

Conversation

@JustinWoodring
Copy link
Owner

🛡️ Sentinel: [CRITICAL] Fix Arbitrary Command Execution in Rhai Engine

🚨 Severity: CRITICAL

💡 Vulnerability:
The shell_execute function in slatron-server's Rhai engine allowed executing arbitrary system commands. While intended for media tools like yt-dlp, it lacked any validation, allowing full RCE. Additionally, tools like yt-dlp have 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:

  1. Implemented is_command_allowed to restrict execution to yt-dlp, ffmpeg, and ffprobe.
  2. Implemented are_args_allowed to inspect arguments and explicitly block the --exec family of flags for yt-dlp.
  3. Updated run_shell_execute to return a safe error map (code -1) if validation fails, preventing execution.

✅ Verification:

  • Added tests in slatron-server/src/rhai_engine/security_test.rs.
  • Validated that shell_execute("echo", ...) is blocked.
  • Validated that shell_execute("yt-dlp", ["--exec", ...]) is blocked.
  • Verified standard tests pass.

PR created automatically by Jules for task 15552410223682778629 started by @JustinWoodring

…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>
@google-labs-jules
Copy link
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant