The Free Software Media System - Server Backend & API
fixes #1075 - XSS in "Active Devices" Panel of Admin Dashboard
Luke2fa34a236b32
diff --git a/MediaBrowser.Server.Implementations/HttpServer/Security/AuthorizationContext.cs b/MediaBrowser.Server.Implementations/HttpServer/Security/AuthorizationContext.csindex 509a00ff9b..75d54a80af 100644--- a/MediaBrowser.Server.Implementations/HttpServer/Security/AuthorizationContext.cs+++ b/MediaBrowser.Server.Implementations/HttpServer/Security/AuthorizationContext.cs@@ -175,11 +175,22 @@ namespace MediaBrowser.Server.Implementations.HttpServer.Securityif (param.Length == 2){- result.Add(param[0], param[1].Trim(new[] { '"' }));+ var value = NormalizeValue (param[1].Trim(new[] { '"' }));+ result.Add(param[0], value);}}return result;}++ private string NormalizeValue(string value)+ {+ if (string.IsNullOrWhiteSpace (value))+ {+ return value;+ }++ return System.Net.WebUtility.HtmlEncode(value);+ }}}