π‘οΈ Sentinel: [CRITICAL] Fix Command Option Injection#72
π‘οΈ Sentinel: [CRITICAL] Fix Command Option Injection#72
Conversation
β¦orker This patch ensures that user-provided `mainFile` values in the compilation queue cannot start with a hyphen (`-`). This prevents Command Option Injection attacks where a malicious user could pass options (like `-shell-escape`) to the `latexmk` external command spawned by the Rust compilation worker.
|
π 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. |
π¨ Severity: CRITICAL
π‘ Vulnerability: The
mainFileparameter inbackend/src/services/compileQueue.tswas passed to thelatexmkcommand via the Rust compile worker without validating if it looked like a flag (i.e., starting with a-).π― Impact: An attacker could craft a compile job where the
mainFilewas a malicious flag like-shell-escape, potentially leading to remote command execution on the worker server, depending on the LaTeX distribution configuration.π§ Fix: Added a check to explicitly reject
mainFileinputs that start with a hyphen.β Verification: Validated that inputs starting with
-are correctly rejected with a400 Bad RequestHttpError. Tests were run and code review was completed to verify safety.PR created automatically by Jules for task 1816402237701966379 started by @dttdrv