/

CVE-2026-102359

Severity:

HIGH RISK

(7.5)

Path Traversal (CWE-22) in Kroki TikZ Diagram Renderer

CVE-2026-102359

Deferred

Vulnerability type

Category:

Path Traversal / Arbitrary File Read

CWE:

CWE-22

Impact:

Sensitive Information Disclosure

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Kroki's TikZ backend does not block several native TeX file-reading primitives when safe mode is enabled. An unauthenticated requester may submit crafted LaTeX through the TikZ or generic diagram API and cause the renderer to read files accessible to its container user, with their contents potentially returned in the SVG.

Affected context

The issue affects Kroki deployments using the TikZ backend with safe mode enabled before the relevant guard fully restricts TeX file operations. The guard blocks \verbatiminput but allows other native file-reading primitives, while TeX Live's permissive openin_any setting may permit access to files available to the renderer's container user. Disabling shell escape does not prevent these file reads.

Exploit preconditions

  • Attack surface: The TikZ endpoint (POST /tikz/svg) or the generic diagram API.
  • Required access: No authentication is required, according to the vulnerability description.
  • Trigger point: Submission of a TikZ/LaTeX diagram that the renderer processes.
  • Why exploitation is possible: Safe-mode filtering does not cover all native TeX file-reading primitives, and the renderer can access files permitted by its container and TeX configuration.

Why this happens

The TikZ guard blocks a limited set of file-reading constructs rather than enforcing a complete restriction on TeX file access. As a result, native primitives such as \openin, \read, \input, and \include can access files within the renderer's permitted filesystem scope, and the resulting content can appear in rendered output. This is associated with CWE-22: Improper Limitation of a Pathname to a Restricted Directory, because access is not adequately confined to an intended set of files. The -no-shell-escape option limits shell execution but does not restrict these native file operations.

Potential impact

  • An attacker could disclose configuration files, credentials, private keys, or mounted secrets accessible to the container user.
  • Sensitive information could be embedded in the SVG response and exposed to the requester.
  • Disclosure could support follow-on compromise of connected services or accounts.

General mitigation guidance

Defensive patterns include restricting TeX file access rather than relying on a narrow command guard, and using strict filesystem allowlists or equivalent sandboxing for renderer inputs. Configure TeX to deny access beyond explicitly required paths, minimize sensitive files mounted into the container, and run the renderer with least-privilege permissions. Treat submitted diagram text as untrusted input, and do not rely on shell-escape restrictions as a substitute for file-access controls.

How teams detect issues like this

  • Use static analysis and code review to identify incomplete filters around TeX primitives and other file-reading constructs.
  • Review renderer and TeX configuration for permissive filesystem access, including openin_any settings and container mounts.
  • Monitor diagram requests and renderer output for unexpected file references or sensitive content, while avoiding unnecessary logging of submitted secrets.
  • Enforce policies that restrict renderer filesystem access and validate those restrictions in security testing.

Sources

SourceLink
github.comgithub.com/yuzutech/kroki/commit/9108ab5b429b9dc82b76432ccf40d4d7eeba1b30
github.comgithub.com/yuzutech/kroki/releases/tag/v0.31.2
github.comgithub.com/yuzutech/kroki/security/advisories/GHSA-r54f-fq6c-53vw

Frequently asked

questions

The description states that an unauthenticated actor can submit crafted input to the TikZ endpoint or generic diagram API, so an exposed instance may be remotely reachable.

No authentication is required as described. The renderer must be accessible, and the targeted files must be readable by its container user.

Restrict TeX file access with strict allowlists or sandboxing, rather than blocking only selected commands. Limit the files and privileges available to the renderer.

Treat diagram input as untrusted, review all file-access capabilities in the rendering toolchain, apply least privilege, and test filesystem restrictions as part of security checks.

Find out what's already
exploitable in your codebase.