Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.9][Privacy] Block usage of FLoC by default #33212

Merged
merged 28 commits into from
May 18, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
b21aba5
[SECURITY] Block usage of FLoC by default
Hackwar Apr 20, 2021
6c3df61
Update administrator/language/en-GB/en-GB.com_admin.ini
Hackwar Apr 20, 2021
9df3494
Update administrator/language/en-GB/en-GB.com_admin.ini
Hackwar Apr 20, 2021
8074979
Adding FLoC header to htaccess.txt
Hackwar Apr 21, 2021
9b41b75
Merge branch 'j3floc' of github.com:Hackwar/joomla-cms into j3floc
Hackwar Apr 21, 2021
60f78c1
Adding update scripts for Postgres and MSSQL
Hackwar Apr 21, 2021
21f71d0
Update htaccess.txt
Hackwar Apr 21, 2021
e0ce2db
Prevent duplicate Permissions-Policy header
Hackwar Apr 29, 2021
52488f7
Merge branch 'j3floc' of github.com:Hackwar/joomla-cms into j3floc
Hackwar Apr 29, 2021
75acb9e
Moving position of adding the FLoC header to after rendering the output
Hackwar Apr 29, 2021
5d40b38
Update htaccess.txt
Hackwar Apr 29, 2021
b468b84
Add floc header when permissions policy is already set
Hackwar May 18, 2021
d4cc16b
Extend description of floc block in .htaccess
Hackwar May 18, 2021
fcf12bd
Extending explanation in postinstall message
Hackwar May 18, 2021
a7ef7b9
Update administrator/language/en-GB/en-GB.com_admin.ini
HLeithner May 18, 2021
96d90c2
Update htaccess.txt
HLeithner May 18, 2021
6abf5b5
Update libraries/src/Application/CMSApplication.php
HLeithner May 18, 2021
a660cd0
Update htaccess.txt
HLeithner May 18, 2021
69d17b5
Update htaccess.txt
HLeithner May 18, 2021
3e8b5a8
Update administrator/language/en-GB/en-GB.com_config.ini
HLeithner May 18, 2021
1671bf5
Update libraries/src/Application/CMSApplication.php
HLeithner May 18, 2021
187698f
Clean up
Hackwar May 18, 2021
6bb53c7
Clean up
Hackwar May 18, 2021
2292676
Clean up
Hackwar May 18, 2021
f9cfae4
Update administrator/language/en-GB/en-GB.com_admin.ini
Hackwar May 18, 2021
5b7f70d
Update htaccess.txt
Hackwar May 18, 2021
c3c2ec3
Update administrator/language/en-GB/en-GB.com_admin.ini
Hackwar May 18, 2021
1c30880
Clean up
Hackwar May 18, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
INSERT INTO `#__postinstall_messages` (`extension_id`, `title_key`, `description_key`, `language_extension`, `language_client_id`, `type`, `version_introduced`, `enabled`)
VALUES
(700, 'COM_ADMIN_POSTINSTALL_MSG_GOOGLE_FLOC_BLOCKER_TITLE', 'COM_ADMIN_POSTINSTALL_MSG_GOOGLE_FLOC_BLOCKER_DESCRIPTION', 'com_admin', 1, 'message', '3.9.27', 1);
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
INSERT INTO "#__postinstall_messages" ("extension_id", "title_key", "description_key", "language_extension", "language_client_id", "type", "version_introduced", "enabled")
VALUES
(700, 'COM_ADMIN_POSTINSTALL_MSG_GOOGLE_FLOC_BLOCKER_TITLE', 'COM_ADMIN_POSTINSTALL_MSG_GOOGLE_FLOC_BLOCKER_DESCRIPTION', 'com_admin', 1, 'message', '3.9.27', 1);
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
INSERT INTO [#__postinstall_messages] ([extension_id], [title_key], [description_key], [language_extension], [language_client_id], [type], [version_introduced], [enabled])
VALUES
(700, 'COM_ADMIN_POSTINSTALL_MSG_GOOGLE_FLOC_BLOCKER_TITLE', 'COM_ADMIN_POSTINSTALL_MSG_GOOGLE_FLOC_BLOCKER_DESCRIPTION', 'com_admin', 1, 'message', '3.9.27', 1);
13 changes: 13 additions & 0 deletions administrator/components/com_config/model/form/application.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1208,6 +1208,19 @@

</field>

<field
name="block_floc"
type="radio"
label="COM_CONFIG_FIELD_FLOC_BLOCKER_LABEL"
description="COM_CONFIG_FIELD_FLOC_BLOCKER_DESC"
class="btn-group btn-group-yesno"
default="1"
filter="integer"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>

</fieldset>

<fieldset
Expand Down
2 changes: 2 additions & 0 deletions administrator/language/en-GB/en-GB.com_admin.ini
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ COM_ADMIN_PLATFORM_VERSION="Joomla! Platform Version"
COM_ADMIN_POSTINSTALL_MSG_BEHIND_LOAD_BALANCER_ACTION="Enable Behind Load Balancer Setting"
COM_ADMIN_POSTINSTALL_MSG_BEHIND_LOAD_BALANCER_DESCRIPTION="<p>For Joomla sites hosted behind Load Balancers and Reverse Proxies a new Global Configuration setting has been introduced with Joomla 3.9.26</p><p>This setting, when enabled, will allow your Load Balancer/Reverse Proxy to provide the real IP address of your visitors. This IP will then be used in your Action Logs and used for tracking voting on articles (if these features are enabled).</p><p><strong>Only sites behind a Load Balancer/Reverse Proxy will wish to enable this feature.</strong></p>"
COM_ADMIN_POSTINSTALL_MSG_BEHIND_LOAD_BALANCER_TITLE="New Server Setting \"Behind Load Balancer\""
COM_ADMIN_POSTINSTALL_MSG_GOOGLE_FLOC_BLOCKER_DESCRIPTION="Google is introducing a replacement for third party tracking cookies, a feature named Federated Learning of Cohorts (FLoC). You can read more about it <a href="https://github.com/WICG/floc">here</a>. The Joomla! project believes this feature to be problematic and against the interests of our users, both the owners of Joomla!-powered sites, as well as their visitors. We do follow the EFF in their <a href="https://www.eff.org/deeplinks/2021/03/googles-floc-terrible-idea">assessment</a> and have added a feature to block this technology on all Joomla sites. This feature has been enabled by default. If you disagree with this decision and want to allow FLoC for your website, you can disable it from the Global Configuration."
COM_ADMIN_POSTINSTALL_MSG_GOOGLE_FLOC_BLOCKER_TITLE="Block Federated Learning of Cohorts (FLoC)"
COM_ADMIN_POSTINSTALL_MSG_HTACCESS_AUTOINDEX_DESCRIPTION="<p>Before 3.9.22 the default htaccess.txt file contained erroneous code meant for disabling directory listings. The security team recommends to manually apply the necessary changes to any existing .htaccess file, as this file can not be updated automatically.</p><p>The old code:</p><pre>&lt;IfModule autoindex&gt;\n IndexIgnore *\n&lt;/IfModule&gt;</pre><p>The new code:</p><pre>&lt;IfModule mod_autoindex.c&gt;\n IndexIgnore *\n&lt;/IfModule&gt;</pre>"
COM_ADMIN_POSTINSTALL_MSG_HTACCESS_AUTOINDEX_TITLE=".htaccess Update Concerning Directory Listings"
COM_ADMIN_REGISTER_GLOBALS="Register Globals"
Expand Down
2 changes: 2 additions & 0 deletions administrator/language/en-GB/en-GB.com_config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ COM_CONFIG_FIELD_FILTERS_CUSTOM_BLACK_LIST="Custom Blacklist"
COM_CONFIG_FIELD_FILTERS_NO_HTML="No HTML"
COM_CONFIG_FIELD_FILTERS_NO_FILTER="No Filtering"
COM_CONFIG_FIELD_FILTERS_WHITE_LIST="Whitelist"
COM_CONFIG_FIELD_FLOC_BLOCKER_DESC="Send a header to not support the tracking through the FLoC method proposed by Google."
COM_CONFIG_FIELD_FLOC_BLOCKER_LABEL="Block Google FLoC"
COM_CONFIG_FRONTEDITING_DESC="Select if you want inline editing for modules and menu items (support may depend on your template)."
COM_CONFIG_FRONTEDITING_LABEL="Inline Editing"
COM_CONFIG_FRONTEDITING_MENUSANDMODULES="Modules & Menus"
Expand Down
1 change: 1 addition & 0 deletions htaccess.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
## Suppress mime type detection in browsers for unknown types
<IfModule mod_headers.c>
Header always set X-Content-Type-Options "nosniff"
Header always set Permissions-Policy: interest-cohort=()
</IfModule>

## Can be commented out if causes errors, see notes above.
Expand Down
5 changes: 5 additions & 0 deletions libraries/src/Application/CMSApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@ public function enqueueMessage($msg, $type = 'message')
*/
public function execute()
{
if ($this->get('block_floc', 1))

This comment was marked as abuse.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and it should first check to see if anything has already set a header for permissions-policy,

You don't have to do this. This is a NEW key-val and you do want the core settings to take over since there is a GUI exposing the setting! In short, the code is safe as is... My 2c

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment was marked as abuse.

This comment was marked as abuse.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also please remember that this PR is for J3 which is a kinda dead fish...

This comment was marked as abuse.

{
$this->setHeader('Permissions-Policy', 'interest-cohort=()', true);
}

// Perform application routines.
$this->doExecute();

Expand Down