CVE-2026-102359

Kroki: TikZ Secure Mode Local File Read via LaTeX File I/O Primitives

Published Nov 6, 2026 CVSS 3.1 · 7.5 High EPSS < 1% KEV · Not listed
Description
Kroki creates diagrams from textual descriptions. Prior to 0.31.2, the TikZ backend's tikz/tikz2svg guard used when KROKI_SAFE_MODE is enabled blocks only \verbatiminput while allowing native TeX file-read primitives including \openin, \read, \input, and \include. TeX Live's permissive openin_any setting remains active, so an unauthenticated actor can submit crafted LaTeX to POST /tikz/svg or the generic diagram API and cause the renderer to read any file accessible to the Kroki container user. The file contents are rendered into the returned SVG, which may disclose mounted secrets, configuration data, credentials, private keys, or process environment data. The -no-shell-escape option prevents shell execution but does not restrict these native file operations. This issue is fixed in version 0.31.2.

Analysis

AI-generated

Technical impact

The vulnerability resides in the TikZ backend of the Kroki diagram service; when KROKI_SAFE_MODE is enabled the guard only blocks the \verbatiminput primitive, but it still permits native TeX file‑read operations such as \openin, \read, \input, and \include. This oversight lets an attacker craft LaTeX payloads that cause the renderer to read any file the container user can access. The read file contents are rendered directly into the returned SVG, potentially exposing sensitive data such as secrets, credentials, configuration files, or private keys.

Affected Systems

The issue affects the open‑source Kroki diagram server produced by Yuzutech. All releases before 0.31.2 are vulnerable, including 0.31.1 and earlier. The problem is present when the backend is configured with KROKI_SAFE_MODE enabled, which was intended to restrict I/O but misses the critical primitives.

Risk and Exploitability

The CVSS score of 7.5 signals medium‑high severity. No EPSS data is supplied and the vulnerability is not catalogued in CISA KEV, pointing to a moderate but not negligible exploitation likelihood. An attacker only needs the ability to POST a crafted LaTeX document to the /tikz/svg endpoint or the generic diagram API; no authentication is required. Because the backend runs with the container’s filesystem permissions, a successful payload can read arbitrary files, making the risk significant if the container spirit mounts susceptible directories.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Kroki to version 0.31.2 or later
  • If an immediate upgrade is not feasible, restrict external access to the diagram API so that only trusted users can submit diagrams
  • Run the Kroki service in a minimal‑privilege container and avoid mounting sensitive directories into the container’s filesystem

Generated by OpenCVE AI on November 6, 2026 at 18:57 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Yuzutech
Yuzutech kroki
Vendors & Products Yuzutech
Yuzutech kroki
Type Values Removed Values Added
Description Kroki creates diagrams from textual descriptions. Prior to 0.31.2, the TikZ backend's tikz/tikz2svg guard used when KROKI_SAFE_MODE is enabled blocks only \verbatiminput while allowing native TeX file-read primitives including \openin, \read, \input, and \include. TeX Live's permissive openin_any setting remains active, so an unauthenticated actor can submit crafted LaTeX to POST /tikz/svg or the generic diagram API and cause the renderer to read any file accessible to the Kroki container user. The file contents are rendered into the returned SVG, which may disclose mounted secrets, configuration data, credentials, private keys, or process environment data. The -no-shell-escape option prevents shell execution but does not restrict these native file operations. This issue is fixed in version 0.31.2.
Title Kroki: TikZ Secure Mode Local File Read via LaTeX File I/O Primitives
Weaknesses CWE-22
References
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N'}

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Nov 11, 2026, 3:13 AM
Reserved
Sep 28, 2026, 10:38 PM
Status
Deferred
Published
Nov 6, 2026, 6:17 PM
Modified
Nov 12, 2026, 10:11 PM