🛡️ Sentinel: [CRITICAL] Fix LaTeX RCE vulnerability - #443
Conversation
…pilation 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. |
Reviewer's GuideAdds explicit LaTeX shell-escape hardening to all PDF generation paths by updating pdflatex/pandoc subprocess invocations and documenting the RCE class of vulnerability in the Sentinel security log. Sequence diagram for hardened LaTeX PDF compilationsequenceDiagram
actor User
participant CoverLetterGenerator
participant PdfConverter
participant subprocess
participant pdflatex
participant pandoc
User->>CoverLetterGenerator: generate_cover_letter
CoverLetterGenerator->>CoverLetterGenerator: _compile_pdf
CoverLetterGenerator->>subprocess: Popen(pdflatex -interaction=nonstopmode -no-shell-escape)
subprocess->>pdflatex: pdflatex -no-shell-escape
pdflatex-->>CoverLetterGenerator: PDF success or failure
CoverLetterGenerator->>PdfConverter: _compile_pdflatex / _compile_pandoc
PdfConverter->>subprocess: Popen(pdflatex -interaction=nonstopmode -no-shell-escape)
subprocess->>pdflatex: pdflatex -no-shell-escape
pdflatex-->>PdfConverter: PDF success or failure
PdfConverter->>subprocess: Popen(pandoc --pdf-engine=xelatex --pdf-engine-opt=-no-shell-escape)
subprocess->>pandoc: pandoc --pdf-engine-opt=-no-shell-escape
pandoc-->>PdfConverter: PDF success or failure
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
…pilation Co-authored-by: anchapin <6326294+anchapin@users.noreply.github.com>
🚨 Severity: CRITICAL
💡 Vulnerability: LaTeX compilation commands (pdflatex and pandoc) lacked the
-no-shell-escapeflag, allowing potential Remote Code Execution (RCE) from untrusted LaTeX documents.🎯 Impact: An attacker could execute arbitrary shell commands on the server generating the PDFs.
🔧 Fix: Added
-no-shell-escapeand--pdf-engine-opt=-no-shell-escapeto all PDF compilation subprocess calls.✅ Verification: Ensured the tests pass and code is formatted correctly.
PR created automatically by Jules for task 18166002057815175540 started by @anchapin
Summary by Sourcery
Harden LaTeX PDF generation against remote code execution by disabling shell escapes in all compilation paths and documenting the vulnerability and mitigation steps.
Enhancements:
Documentation: