π‘οΈ Sentinel: [CRITICAL] Fix RCE and DoS risks in PDF compilation#309
π‘οΈ Sentinel: [CRITICAL] Fix RCE and DoS risks in PDF compilation#309anchapin wants to merge 2 commits into
Conversation
Co-authored-by: anchapin <6326294+anchapin@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. |
Co-authored-by: anchapin <6326294+anchapin@users.noreply.github.com>
π¨ Severity: CRITICAL
π‘ Vulnerability: PDF compilation mechanisms (
cli/pdf/converter.pyandcli/generators/cover_letter_generator.py) were missing the-no-shell-escapeflag when invokingpdflatexorpandoc(via--pdf-engine-opt=-no-shell-escape), and they also lacked timeouts for the subprocess commands.π― Impact: Allowed arbitrary command execution (Remote Code Execution / RCE) from untrusted LaTeX inputs, as well as Denial of Service attacks from infinite compilation loops.
π§ Fix: Enforced the
-no-shell-escapeflag forpdflatexand--pdf-engine-opt=-no-shell-escapeforpandoc. Added a subprocess timeout of 30 seconds that explicitly handles cleanup with.kill()to avoid double-free or zombie process issues.β Verification: Ran unit tests and the security suite using
bandit. Reviewed changes via read tools. Added entry to Sentinel journal.PR created automatically by Jules for task 428022128705215362 started by @anchapin