github yuzutech/kroki v0.37.0

41 minutes ago

Added

  • Serve an OpenAPI description of the HTTP API at /openapi.json, generated from the diagram types and options available on the server (#2270)
  • Add the type of the error (diagram-error, unsupported-format, timeout...) and, when the diagram library reports it, the line (and column) of the error in the diagram source to JSON error responses. PlantUML, Structurizr and Mermaid errors include a line (#2296)

Changed

  • The Mermaid, BPMN, Excalidraw and diagrams.net companion images are now based on alpine instead of node:alpine, and only include the node binary: npm, npx, Yarn and corepack are no longer available. If you build an image on top of one of them and install packages, install them in a node:alpine stage and copy the result, or add the npm Alpine package (#2283)

Fixed

  • The line reported in PlantUML error messages is now the line of the diagram source: it was off by one when the diagram started with @startuml, or when the theme option was used, and did not account for leading blank lines and inlined C4 includes (#2296)
  • The lines reported in Mermaid error messages are now lines of the diagram source: Mermaid ignores comment lines and leading blank lines when counting lines (#2296)
  • Return a 503 Service Unavailable error, instead of 400 Bad Request, when a companion service is overloaded (#2296)
  • Fix a crash of UMLet on some linux/arm64 hosts, where any diagram containing text returned a 400 Bad Request error, by building the UMLet and ditaa binaries with GraalVM 25.0.5 (#2299)
  • Fix ditaa and UMLet diagrams failing on x86-64 CPUs without AVX2 (x86-64-v2 and older): their native binaries are now built for any x86-64 CPU (#2303)

Security

  • Prevent bytefield diagrams from executing arbitrary commands on the server (unauthenticated remote code execution). bytefield-svg evaluates the diagram source with sci, whose sandbox exposes aget/aset; a diagram could rebind the native CallSite.getThis as a property getter, walk Error.prepareStackTrace to a frame receiver that is the global object, reach process and child_process, and run a command. This bypassed the existing --disallow-code-generation-from-strings mitigation, which only blocks eval/new Function. The bytefield binary now freezes Error.prepareStackTrace so diagram code can no longer obtain CallSite objects (closing the escape, including the exfiltration of process.env), and the server runs it under the Node.js Permission Model (--permission), so even an unknown future escape cannot spawn a child process, access the filesystem, or start a worker (GHSA-hwvq-g72h-v55j)
  • Update the Java runtime of the server image to Eclipse Temurin 21.0.13.1, which fixes CVE-2026-114938 ("Java4Shell"), a memory corruption in the HotSpot AVX-512 Base64 decoder that can lead to remote code execution (#2306)
  • Render TikZ SVGs with dvisvgm from a directory that contains only the sanitized DVI file. In secure mode an untrusted TikZ diagram could write a virtual font (.vf) into its working directory, shadowing an installed one; dvisvgm would then resolve it and execute the PostScript specials embedded in its character packets through Ghostscript, bypassing the DVI sanitizer (which only rewrites the top-level DVI) and allowing arbitrary command execution (GHSA-h3hf-44rq-5jfq)
  • Remove the npm CLI from the Mermaid, BPMN, Excalidraw and diagrams.net companion images. npm never runs in these containers, but vulnerability scanners reported the packages it bundles, for instance undici, glob, minimatch, brace-expansion and ip-address (#2283)
  • Install @excalidraw/excalidraw, react and react-dom as development dependencies in the Excalidraw companion: they are only used to build the browser bundle, and are no longer copied into the runtime image, where vulnerability scanners reported some of their dependencies, for instance lodash-es and nanoid (#2285)
  • Prevent D2 diagrams from reading any file readable by the server (for instance /etc/passwd or /proc/self/environ, which holds the server environment variables) and from making the server fetch an arbitrary URL (SSRF, e.g. against internal services): an icon or an image naming a local file or a URL was read or fetched by d2, and embedded in the SVG, regardless of KROKI_SAFE_MODE. Unless Kroki is running in UNSAFE mode, d2 now runs with --bundle=false and with a new --allow-local-files=false flag, added by a patch applied when building D2 from source: images are kept as links in the SVG, and importing a file is an error (GHSA-w5wj-qr95-xm33)

Diagram libraries

  • Update bytefield-svg to 1.12.0 (#2290)
  • Update Graphviz to 16.1.1 (#2293)

What's Changed

New Contributors

Full Changelog: v0.36.0...v0.37.0

Don't miss a new kroki release

NewReleases is sending notifications on new releases.