π‘οΈ Sentinel: [CRITICAL] Fix command injection vulnerability in CoverLetterGenerator#278
π‘οΈ Sentinel: [CRITICAL] Fix command injection vulnerability in CoverLetterGenerator#278
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: The
CoverLetterGeneratorexecutedpdflatex(and thepandocfallback) without the-no-shell-escapeflag. This creates a critical Remote Code Execution (RCE) vulnerability if a user or the AI generates malicious LaTeX code (such as\write18). Additionally, the subprocess calls lacked a timeout, leading to potential Denial of Service (DoS) via infinite compilation loops.π― Impact: An attacker could execute arbitrary system commands via maliciously crafted LaTeX inputs, or freeze the application by inducing infinite PDF compilation processes.
π§ Fix: Added the
-no-shell-escapeflag to thepdflatexcall and--pdf-engine-opt=-no-shell-escapeto thepandoccall. Implemented a strict 30-secondtimeoutusingprocess.communicate(timeout=30), with explicit cleanup logic (catchingsubprocess.TimeoutExpired, callingprocess.kill(), and calling.communicate()again to prevent zombie processes).β Verification: Ran
pytest tests/test_cover_letter_generator.pyand confirmed the new timeout and mock parameter checks pass successfully.PR created automatically by Jules for task 12501750482418027070 started by @anchapin