diff --git a/src/webui/webapplication.cpp b/src/webui/webapplication.cpp index bde61c83f..983f9caaf 100644 --- a/src/webui/webapplication.cpp +++ b/src/webui/webapplication.cpp @@ -533,11 +533,14 @@ Http::Response WebApplication::processRequest(const Http::Request &request, cons header(Http::HEADER_X_XSS_PROTECTION, "1; mode=block"); header(Http::HEADER_X_CONTENT_TYPE_OPTIONS, "nosniff"); + QString csp = QLatin1String("default-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; script-src 'self' 'unsafe-inline'; object-src 'none';"); if (m_isClickjackingProtectionEnabled) { header(Http::HEADER_X_FRAME_OPTIONS, "SAMEORIGIN"); - header(Http::HEADER_CONTENT_SECURITY_POLICY, "default-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; script-src 'self' 'unsafe-inline'; object-src 'none';"); + csp += QLatin1String(" frame-ancestors 'self';"); } + header(Http::HEADER_CONTENT_SECURITY_POLICY, csp); + return response(); }