#3288·zola

XSS/missing sanitization on the build error screen's source view

Author: nyanpasu64Created Sep 26, 2026Updated Sep 27, 2026
Labelsbug

Bug Report

Environment

Zola version: 0.23.6

Expected Behavior

When a build error occurs and source code is shown on-screen, it's properly escaped and visible as plaintext.

Current Behavior

HTML tags are injected into output as-is, resulting in formatting errors up through JS execution.

Image

I don't think there's a security boundary being crossed here (considering you can inject arbitrary HTML into successful Zola output), but it makes the "Zola Build Error" screen harder to read when you have stray hypertext (eg. <br>, images, the like) rendering in a source code viewer.

Step to reproduce

  • Run zola serve
  • Edit a page with an invalid Tera invocation containing HTML tags, eg.
{{ <img src=error onerror=alert(1)> }}