Fix xss on account settings page

This commit is contained in:
Fornax committed 2020-12-24 00:07:40 +01:00
1 parent 0b7515eccd
commit 96ca0ed90f
3 files changed
+6 -4

No files matched your search

+2 -1
View File
@@ -30,7 +30,8 @@
* 2020-12-06 Security researcher Arian Firoozfar reported a cross-site
scripting vulnerability on the file viewer page. The issue was fixed the
following day.
following day. On the 26th another XSS vulnerability was found on the account
settings page, it was fixed later that day.
* 2017-12-04 Security researcher Hangyi reported a cross-site scripting
vulnerability on the file viewer page. The issue was fixed on the 6th.
+2 -2
View File
@@ -16,8 +16,8 @@
<body>
{{template "page_menu" .}}
<div class="page_body" style="padding: 0; top: 0; bottom: 0;">
<iframe id="page_body" src="https://status.pixeldrain.com" class="status_frame"></iframe>
<div id="page_body" class="page_body" style="padding: 0; top: 0; bottom: 0;">
<iframe src="https://status.pixeldrain.com" class="status_frame"></iframe>
</div>
{{template "analytics"}}
</body>
+2 -1
View File
@@ -2,6 +2,7 @@ package webcontroller
import (
"fmt"
"html"
"html/template"
"net/http"
@@ -211,7 +212,7 @@ func (wc *WebController) usernameForm(td *TemplateData, r *http.Request) (f Form
// Request was a success
f.SubmitSuccess = true
f.SubmitMessages = []template.HTML{template.HTML(
"Success! You are now " + f.FieldVal("new_username"),
"Success! You are now " + html.EscapeString(f.FieldVal("new_username")),
)}
}
}