Skip to content

Commit df03581

Browse files
authored
Merge commit from fork
1 parent dce3b94 commit df03581

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Umbraco.Web.Common/Views/UmbracoViewPage.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,10 @@ public void WriteUmbracoContent(TagHelperOutput tagHelperOutput)
142142
string.Format(
143143
ContentSettings.PreviewBadge,
144144
HostingEnvironment.ToAbsolute(Core.Constants.System.DefaultUmbracoPath),
145-
Context.Request.GetEncodedUrl(),
145+
System.Web.HttpUtility.HtmlEncode(Context.Request.GetEncodedUrl()), // Belt and braces - via a browser at least it doesn't seem possible to have anything other than
146+
// a valid culture code provided in the querystring of this URL.
147+
// But just to be sure of prevention of an XSS vulnterablity we'll HTML encode here too.
148+
// An expected URL is untouched by this encoding.
146149
UmbracoContext.PublishedRequest?.PublishedContent?.Key);
147150
}
148151
else

0 commit comments

Comments
 (0)