From 21dc5996a5275dc9afda64941e21d61ba6904c40 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sun, 19 Feb 2017 19:09:32 +0800 Subject: [PATCH] Security: fix XSS attack on milestone (#977) --- templates/repo/issue/list.tmpl | 8 ++++---- templates/repo/issue/milestones.tmpl | 2 +- templates/repo/issue/view_content.tmpl | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/templates/repo/issue/list.tmpl b/templates/repo/issue/list.tmpl index d00c9aea21..57dd8f4cdb 100644 --- a/templates/repo/issue/list.tmpl +++ b/templates/repo/issue/list.tmpl @@ -33,7 +33,7 @@ @@ -47,7 +47,7 @@ @@ -105,7 +105,7 @@ {{.Title}} {{range .Labels}} - {{.Name}} + {{.Name | Sanitize}} {{end}} {{if .NumComments}} @@ -116,7 +116,7 @@ {{$.i18n.Tr "repo.issues.opened_by" $timeStr .Poster.HomeLink .Poster.Name | Safe}} {{if .Milestone}} - {{.Milestone.Name}} + {{.Milestone.Name | Sanitize}} {{end}} {{if .Assignee}} diff --git a/templates/repo/issue/milestones.tmpl b/templates/repo/issue/milestones.tmpl index 038eaabd8f..e905584316 100644 --- a/templates/repo/issue/milestones.tmpl +++ b/templates/repo/issue/milestones.tmpl @@ -26,7 +26,7 @@
{{range .Milestones}}
  • - {{.Name}} + {{.Name | Sanitize}}
    diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl index bbb8f4f984..6a1099ba24 100644 --- a/templates/repo/issue/view_content.tmpl +++ b/templates/repo/issue/view_content.tmpl @@ -263,7 +263,7 @@ {{.i18n.Tr "repo.issues.new.no_label"}} {{range .Labels}} {{end}} @@ -285,7 +285,7 @@ {{.i18n.Tr "repo.issues.new.open_milestone"}}
    {{range .OpenMilestones}} -
    {{.Name}}
    +
    {{.Name | Sanitize}}
    {{end}} {{end}} {{if .ClosedMilestones}} @@ -295,7 +295,7 @@ {{.i18n.Tr "repo.issues.new.closed_milestone"}}
    {{range .ClosedMilestones}} - {{.Name}} + {{.Name | Sanitize}} {{end}} {{end}}
  • @@ -304,7 +304,7 @@ {{.i18n.Tr "repo.issues.new.no_milestone"}}
    {{if .Issue.Milestone}} - {{.Issue.Milestone.Name}} + {{.Issue.Milestone.Name | Sanitize}} {{end}}