diff options
context:
space:
mode:
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Mark the cache listing untrusted
Diffstat (limited to 'source')
-rw-r--r--source/cmd.c4
1 file changed, 4 insertions, 0 deletions
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);
}