mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 14:38:04 -06:00
Add form-action to CSP
This option restricts all form submissions to the WebUI's origin. qBittorrent only ever submits forms to the origin, so this is intended as a security measure.
This commit is contained in:
@@ -534,7 +534,7 @@ Http::Response WebApplication::processRequest(const Http::Request &request, cons
|
|||||||
header(Http::HEADER_X_XSS_PROTECTION, "1; mode=block");
|
header(Http::HEADER_X_XSS_PROTECTION, "1; mode=block");
|
||||||
header(Http::HEADER_X_CONTENT_TYPE_OPTIONS, "nosniff");
|
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';");
|
QString csp = QLatin1String("default-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; script-src 'self' 'unsafe-inline'; object-src 'none'; form-action 'self';");
|
||||||
if (m_isClickjackingProtectionEnabled) {
|
if (m_isClickjackingProtectionEnabled) {
|
||||||
header(Http::HEADER_X_FRAME_OPTIONS, "SAMEORIGIN");
|
header(Http::HEADER_X_FRAME_OPTIONS, "SAMEORIGIN");
|
||||||
csp += QLatin1String(" frame-ancestors 'self';");
|
csp += QLatin1String(" frame-ancestors 'self';");
|
||||||
|
|||||||
Reference in New Issue
Block a user