mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-31 20:58:07 -06:00
Revise cookie 'secure flag' enable condition
The localhost is 'potentially trustworthy' and RFC 6265 allows setting secure flag in this case. Also check `X-Forwarded-Proto` header value to support reverse proxy usage. Note: for reverse proxy users, now the `X-Forwarded-Proto` header is expected to be sent to qbt otherwise the `secure` flag might be set erroneously. https://datatracker.ietf.org/doc/html/rfc6265#section-4.1.2.5 https://w3c.github.io/webappsec-secure-contexts/#is-origin-trustworthy Closes #21250. PR #21260.
This commit is contained in:
@@ -1273,7 +1273,6 @@ void OptionsDialog::loadWebUITabOptions()
|
||||
// Security
|
||||
m_ui->checkClickjacking->setChecked(pref->isWebUIClickjackingProtectionEnabled());
|
||||
m_ui->checkCSRFProtection->setChecked(pref->isWebUICSRFProtectionEnabled());
|
||||
m_ui->checkSecureCookie->setEnabled(pref->isWebUIHttpsEnabled());
|
||||
m_ui->checkSecureCookie->setChecked(pref->isWebUISecureCookieEnabled());
|
||||
m_ui->groupHostHeaderValidation->setChecked(pref->isWebUIHostHeaderValidationEnabled());
|
||||
m_ui->textServerDomains->setText(pref->getServerDomains());
|
||||
@@ -1315,7 +1314,6 @@ void OptionsDialog::loadWebUITabOptions()
|
||||
|
||||
connect(m_ui->checkClickjacking, &QCheckBox::toggled, this, &ThisType::enableApplyButton);
|
||||
connect(m_ui->checkCSRFProtection, &QCheckBox::toggled, this, &ThisType::enableApplyButton);
|
||||
connect(m_ui->checkWebUIHttps, &QGroupBox::toggled, m_ui->checkSecureCookie, &QWidget::setEnabled);
|
||||
connect(m_ui->checkSecureCookie, &QCheckBox::toggled, this, &ThisType::enableApplyButton);
|
||||
connect(m_ui->groupHostHeaderValidation, &QGroupBox::toggled, this, &ThisType::enableApplyButton);
|
||||
connect(m_ui->textServerDomains, &QLineEdit::textChanged, this, &ThisType::enableApplyButton);
|
||||
|
||||
@@ -3675,7 +3675,7 @@ Specify an IPv4 or IPv6 address. You can specify "0.0.0.0" for any IPv
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkSecureCookie">
|
||||
<property name="text">
|
||||
<string>Enable cookie Secure flag (requires HTTPS)</string>
|
||||
<string>Enable cookie Secure flag (requires HTTPS or localhost connection)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
Reference in New Issue
Block a user