π‘οΈ Sentinel: [CRITICAL] Fix PDF compilation RCE vulnerabilities#370
π‘οΈ Sentinel: [CRITICAL] Fix PDF compilation RCE vulnerabilities#370anchapin wants to merge 2 commits into
Conversation
Adds `-no-shell-escape` flags to pdflatex and pandoc executions in PDFConverter and CoverLetterGenerator to prevent arbitrary remote code execution during LaTeX compilation. Also introduces a 30-second timeout to prevent denial-of-service via infinite compilation loops, matching the security implementations seen in other modules like TemplateGenerator. Comprehensive tests added to enforce these properties. Co-authored-by: anchapin <[email protected]>
|
π 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. |
Fix import sorting in `cli/generators/cover_letter_generator.py` and `tests/test_pdf_security.py` that failed CI checks. Co-authored-by: anchapin <[email protected]>
π¨ Severity: CRITICAL
π‘ Vulnerability: Remote Code Execution (RCE) via LaTeX compilation and Denial of Service (DoS) via compilation hangs.
π― Impact: A malicious LaTeX file passed to PDF compilation functions could invoke arbitrary shell commands using
pdflatexorpandocif-no-shell-escapeis omitted. Additionally, a malformed file could cause compilation to hang forever without a timeout, leading to application starvation.π§ Fix: Enforced the
-no-shell-escapeflag forpdflatexdirectly andpandocvia--pdf-engine-optwithinPDFConverterandCoverLetterGenerator. Addedtimeout=30and proper process cleanup tosubprocess.Popen.communicate()to prevent hangs.β Verification: Test coverage added in
tests/test_pdf_security.pyto ensure correct arguments are passed and timeout exceptions properly terminate the target process. Full suite executed and passing.PR created automatically by Jules for task 4171164387063333793 started by @anchapin