π‘οΈ Sentinel: [CRITICAL] Fix LaTeX RCE and DoS vulnerability in PDF generation#312
π‘οΈ Sentinel: [CRITICAL] Fix LaTeX RCE and DoS vulnerability in PDF generation#312anchapin wants to merge 1 commit into
Conversation
Added missing `-no-shell-escape` flags and strict subprocess timeouts to `pdflatex` and `pandoc` commands in `PDFConverter` and `CoverLetterGenerator`. This prevents arbitrary code execution via LaTeX `\write18` and DoS attacks via compilation infinite loops. 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. |
π¨ Severity: CRITICAL
π‘ Vulnerability: Remote Code Execution (RCE) via
pdflatexandpandocallowing shell escapes, and Denial of Service (DoS) via missing timeouts onsubprocess.communicate().π― Impact: Malicious user input (or AI-hallucinated LaTeX) containing
\write18{...}could execute arbitrary system commands on the host. Malicious or malformed LaTeX could also cause infinite compilation loops, consuming all CPU resources.π§ Fix: Enforced the
-no-shell-escapeflag for allpdflatexandpandoc(via--pdf-engine-opt) calls incli/pdf/converter.pyandcli/generators/cover_letter_generator.py. Implemented a 30-second timeout with properprocess.kill()cleanup.β Verification: Code review confirmed flags are added. Tested locally via
python -m pytest tests/which all pass.PR created automatically by Jules for task 15770832289820726946 started by @anchapin