GHSA-x3q2-h9hx-4r4j: Path Traversal

Published Oct 7, 2026
·
Updated

Summary

When the LaTeX backend is configured to render TikZ pictures with the Tectonic engine (LatexBackendOptions(tikzengine="tectonic")), the TikZ body and the document preamble from the input file are compiled by Tectonic without any restriction on TeX's file primitives. A crafted .tex file can read files the process can read and write files at paths the process can write. If the caller also sets tikzengineallowshellescape=True, the document can run shell commands through \write18.

Details

docling/backend/latex/engines/tectonic.py writes the picture source into a temporary document and runs the tectonic binary on it. resolvelocaldependency only decides which files are staged into the temporary directory. It does not limit what TeX opens at compile time, so:

- \input{/abs/path}, \verbatiminput{...} and \openin read arbitrary files, and their content can be typeset into the rendered picture that ends up in the conversion output. For an in-memory DocumentStream, staging is skipped entirely. - \immediate\openout / \write create or overwrite files outside the temporary directory. Neither needs shell escape. Tectonic's --untrusted flag does not block them either.

Separately, the TectonicEngine constructor defaults to allowshellescape=True. The LaTeX backend always passes tikzengineallowshellescape explicitly (default False), so this default only affects code that instantiates TectonicEngine directly.

Affected configurations

- Affected: callers that set tikzengine="tectonic", have a tectonic binary available (on PATH or in the docling cache), and convert untrusted LaTeX. - Not affected: the default configuration (tikzengine=None). docling does not install tectonic automatically, and the CLI exposes no option to enable it.

Impact

Disclosure of local files readable by the process, and creation or overwrite of files writable by the process. Writing to startup or configuration files can lead to code execution. With shell escape enabled, commands run directly.

Proof of concept

latex \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \immediate\openout15=/tmp/docling-tectonic-poc.txt \immediate\write15{written by the input document} \immediate\closeout15 \node {x}; \end{tikzpicture} \end{document}

Converting this file with LatexBackendOptions(tikzengine="tectonic") creates /tmp/docling-tectonic-poc.txt.

Patches

Mitigated in docling 2.132.0 by #4419:

- TectonicEngine now defaults to allowshellescape=False, and without shell escape Tectonic runs with --untrusted and --only-cached. - Before compiling, docling checks the generated document and every staged file. It skips rendering, and keeps the diagram as TikZ code, when the source uses the \openin, \openout, \XeTeXpicfile or \XeTeXpdffile primitives, or names an absolute, home, drive-letter or parent-directory path in \input, \include, \includegraphics, \InputIfFileExists or \graphicspath.

This check is best-effort. It reads the source text, and TeX can open files in ways a text check cannot see, for example through package commands or names built by macros. As documented in the pipeline options reference, untrusted LaTeX rendered with tikzengine="tectonic" should still be processed in an isolated environment.

Workarounds

Upgrade to 2.132.0. For older versions:

- Do not enable tikzengine="tectonic" for untrusted input, or run the conversion in an OS-level sandbox (container, no host mounts, read-only filesystem, no network). - Never set tikzengineallowshellescape=True for untrusted input.

Affected Software

2 affected componentsFixes available
pip/docling-slim>=2.94.0<2.132.0
2.132.0
pip/docling>=2.94.0<2.132.0
2.132.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/docling-slim to a version that resolves this vulnerability.

    Fixed in 2.132.0
  2. Upgrade

    Upgrade pip/docling to a version that resolves this vulnerability.

    Fixed in 2.132.0
  3. Upgrade

    Upgrade docling to a version that resolves this vulnerability.

    Fixed in 2.132.0
  4. Configuration

    Do not enable tikz_engine="tectonic" when processing untrusted LaTeX; use the default tikz_engine=None.

    LaTeX backend tikz_engine = None
  5. Configuration

    Never set tikz_engine_allow_shell_escape=True for untrusted input; keep it set to False.

    LaTeX backend tikz_engine_allow_shell_escape = False
  6. Compensating control

    Process untrusted LaTeX rendered with Tectonic in an OS-level sandbox, such as a container with no host mounts, a read-only filesystem, and no network access.

Event History

Oct 7, 2026
Advisory Published
via GitHub·08:42 PM
Data Sourced
via GitHub·08:42 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Which deployments are exposed?

Deployments that process untrusted or attacker-crafted .tex input with the LaTeX backend configured as LatexBackendOptions(tikz_engine="tectonic") are exposed. The risk includes both the TikZ body and the document preamble supplied by the input file.

2

Does an attacker need shell escape to read or modify files?

No. TeX file primitives such as \input, \openin, \immediate\openout, and \write can read files accessible to the process and create or overwrite files writable by the process without shell escape. Enabling tikz_engine_allow_shell_escape=True additionally allows shell commands through \write18.

3

How can I determine whether my processing path is affected?

Check whether the LaTeX backend is configured to use the Tectonic TikZ engine. In particular, in-memory DocumentStream processing is affected because local dependency staging is skipped entirely; staging dependencies in a temporary directory does not prevent TeX from opening other paths during compilation.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203