CVE-2026-45728: Algernon: Single-file mode unconditionally enables debug mode
When Algernon is invoked with a single file path instead of a directory — the documented “quick demo” workflow (algernon foo.lua, algernon page.po2, algernon index.html, algernon mywebsite.alg) — singleFileMode is set to true and debugMode is forcibly enabled with no opt-out:
// engine/config.go:498-502
// Make a few changes to the defaults if we are serving a single file
if ac.singleFileMode {
ac.debugMode = true
ac.serveJustHTTP = true
}
debugMode activates the PrettyError renderer, which on any Lua or template error response dumps:
- The absolute path of the file that errored (
Filenamefield of the error template). - The complete byte contents of that file, HTML-escaped, with the offending line wrapped in
<font style='color: red !important'>…</font>. - The exception or parser error text — which in turn often quotes additional file content (Pongo2 errors include surrounding template lines; Lua tracebacks include argument values).
This response is served with HTTP 200 OK to whoever sent the request that triggered the error. There is no authentication, no rate limit specific to errors, no redaction, and no opt-out short of avoiding single-file invocations entirely. Any client able to reach the server and able to provoke a runtime error in the served script obtains the full server-side source of that script and of any sibling Lua data file consulted during the request.
This combines particularly badly with --prod not being effective: --prod sets productionMode = true and calls ac.debugMode = false inside finalConfiguration, but singleFileMode is computed after --prod in MustServe (line 499 vs finalConfiguration further down) and the forced debugMode = true happens before --prod’s debugMode = false clamp runs — so even an operator who reasoned “I will pass --prod to be safe” gets debug-mode-on if they also pass a single Lua file. Operators routinely combine the two when running Algernon as a system unit (ExecStart=algernon --prod /etc/algernon/site.lua), unaware that single-file detection has overridden their hardening flag.
References
Code Behaviors & Features
Detect and mitigate CVE-2026-45728 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →