From de3652cdf120bf7bc3a8051766c72e4fc82e67a8 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 22 Aug 2026 10:39:52 -0700 Subject: Mark the cache listing untrusted --- source/cmd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/cmd.c b/source/cmd.c index 97ffc78..27f9db5 100644 --- a/source/cmd.c +++ b/source/cmd.c @@ -116,6 +116,10 @@ static void ls_cache_fn(void) } ctx.page.mimetype = "text/plain"; ctx.page.filename = "ls-cache.txt"; + // The keys printed are visitor-chosen URL bytes, so the page is marked + // untrusted to keep a browser from sniffing an HTML-shaped key into + // markup. + ctx.page.untrusted = 1; cgit_print_http_headers(); cache_ls(ctx.cfg.cache_root); } -- cgit v2.8.0