Harden CSRF/CSP and add hash version upgrades
This commit is contained in:
@@ -136,7 +136,7 @@ app.Use(async (ctx, next) =>
|
||||
headers["Referrer-Policy"] = "no-referrer";
|
||||
headers["Permissions-Policy"] = "camera=(), geolocation=(), microphone=()";
|
||||
headers["Content-Security-Policy"] =
|
||||
"default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com data:; img-src 'self' data: https: http:; connect-src 'self'; object-src 'none'; frame-ancestors 'none'; base-uri 'self'; form-action 'self'";
|
||||
"default-src 'self'; script-src 'self'; style-src 'self' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; img-src 'self' data: https:; connect-src 'self'; object-src 'none'; frame-ancestors 'none'; base-uri 'self'; form-action 'self'";
|
||||
return Task.CompletedTask;
|
||||
});
|
||||
|
||||
@@ -152,6 +152,7 @@ if (!string.IsNullOrWhiteSpace(basePath))
|
||||
app.UseGlobalExceptionLogging();
|
||||
app.UseAuthentication();
|
||||
app.UseMiddleware<EnsurePlayerExistsMiddleware>();
|
||||
app.UseMiddleware<CsrfProtectionMiddleware>();
|
||||
app.UseAuthorization();
|
||||
app.UseMiddleware<StateChangeNotificationMiddleware>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user