Security
- Send a
Content-Security-Policy: script-src 'none'; object-src 'none'header on every response, so that a script injected in a diagram (for instance through a diagram library that does not escape user input) cannot run on the Kroki origin when the SVG is opened directly or embedded in an<iframe>. The policy can be changed, or removed, withKROKI_CONTENT_SECURITY_POLICY(#2281) - Prevent unauthenticated remote code execution on
/tikz/svgvia\special{ps:...}, which was still possible despite the previous fix: because of a bug indvisvgm3.6 (mgieseki/dvisvgm#306), the--no-specials=psoption was silently ignored, so PostScript specials were still handed off to Ghostscript. PostScript specials (ps:,ps::,pst:,",!,header=,psfile=,pdffile=...) are now removed from the DVI file before it is passed todvisvgm - Prevent a reflected cross-site scripting (XSS) on
/goat/svgvia thesvg-color-dark-schemeandsvg-color-light-schemeoptions: GoAT inserts their values as-is into a<style>element of the SVG, so a value containing</style><script>...injected an executable script in the diagram. These options now only accept CSS color values (for instance:#FFF,redorrgb(0, 0, 0)), other values are rejected with a 400 error - Prevent a reflected cross-site scripting (XSS) on
/dbml/svgvia the tableurlsetting: the DBML renderer turned its value into a link on the table header without checking the URL scheme, so ajavascript:URL ran a script when the header was clicked. Links whose scheme is nothttp,httpsormailto(relative links are still allowed) are now removed from the diagram - Prevent BlockDiag, SeqDiag, ActDiag, NwDiag, PacketDiag and RackDiag diagrams from making the server fetch an arbitrary URL (SSRF, e.g. against internal services or cloud metadata endpoints) or read a local image file: a node's
iconorbackgroundnaming a URL or a file was fetched or read, and embedded in the output, regardless ofKROKI_SAFE_MODE. Unless Kroki is running inUNSAFEmode, blockdiag now runs with its new--no-external-imagesflag and ignores these images
Added
- Allow selecting the TALA layout engine, bundled since D2 0.9.0, with the D2
layoutoption (layout=tala). The option previously only acceptedelkand silently fell back to the defaultdagrelayout for any other value (#2272)
Changed
- Compile the server for Java 21 and document Java 21 as the minimum version for the manual install. Java 21 was already required at runtime since Structurizr 6, which is compiled for Java 21: on an older Java version, the server failed to start with an
UnsupportedClassVersionError(#2276)
Fixed
- Apply the Symbolator
library-nameoption, which was never recognized by Symbolator because of a trailing space in the argument name. As documented, the option requirestitleto be set and is ignored otherwise. The documentation of thetitleoption is also fixed: it is a flag that adds the component name above the symbol, any value is ignored (#2277)
Diagram libraries
- Update BlockDiag, SeqDiag, ActDiag, NwDiag, PacketDiag and RackDiag to 3.4.3
What's Changed
- feat(d2): allow the TALA layout engine with the layout option by @ggrossetie in #2272
- docs: restart companion containers after a reboot in Compose examples by @ggrossetie in #2273
- build: compile the server for Java 21 by @ggrossetie in #2276
- test: wait for the HTTP responses in ServerTest by @ggrossetie in #2278
- fix(symbolator): apply the library-name option by @ggrossetie in #2277
- feat: send a Content-Security-Policy header to forbid scripts by @ggrossetie in #2281
- docs: document third-party companion containers and how to extend Kroki by @ggrossetie in #2279
- refactor: describe diagram options with DiagramOption by @Assaviv in #2274
- docs(changelog): list the blockdiag update under Diagram libraries by @ggrossetie in #2282
New Contributors
Full Changelog: v0.35.0...v0.36.0