Hello extension authors!
As part of an effort to improve Chrome Extension security, cross-origin fetches are being disallowed from content scripts in Chrome Extensions. Cross-Origin Read Blocking (CORB) has already applied to content scripts since M73. We plan to also enable CORS for content script requests starting in M83, which will reach the stable channel around June 9th. We expect most extensions to be unaffected by the CORS change, but there is a chance that some requests initiated from content scripts may start to fail.
Please test your Chrome Extension to make sure it works with the new behavior when Chrome is launched with the following cmdline flags (in 81.0.4035.0 or later):
--enable-features=OutOfBlinkCors,CorbAllowlistAlsoAppliesToOorCors
During the test watch for fetches or XHRs that are initiated by content scripts and blocked by CORS with a DevTools console message similar to:
Access to fetch at 'https://another-site.com/' from origin 'https://example.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
The changes should only affect fetches or XHRs for content types not blocked by CORB (such as images, JavaScript, and CSS), and only if the server does not approve the CORS request with an Access-Control-Allow-Origin response header. If your extension is affected, then please open a bug to add the affected extension to a temporary allowlist.
We plan to enable the CORS changes by default in M83 for Canary and Dev users around March 16th. We plan to ship the changes to the Beta and Stable channel in M83, although we may make adjustments to this plan based on feedback and telemetry results. According to the Chromium Dashboard, the M83 Beta release is tentatively scheduled for May 7th and the M83 Stable release for June 9th.
If your extension is already present on the CORB allowlist, then its behavior will not be affected by the M83 changes (because the same allowlist exempts an extension from both the M73 CORB changes and from the M83 CORS changes). At this point we don’t have a specific timeline for removing extensions from the allowlist. However, since users of allowlisted extensions are at a higher security risk, we encourage extensions to move to the new security model and migrate off of the allowlist as soon as possible. We hope to announce a more specific allowlist timeline after the M83 changes ship to the stable channel.
Fortunately, if your extension is currently present on the CORB allowlist, then the M83 CORS changes may actually help you remove the extension from the allowlist. This is because the server may now send a valid `Access-Control-Allow-Origin` response header based on the page's origin, in which case CORB will not block the response. To see if your extension might be eligible for removal from the allowlist after the M83 changes, test your extension after launching Chrome with the following command-line flags (in 81.0.4035.0 or later):
--enable-features=OutOfBlinkCors,CorbAllowlistAlsoAppliesToOorCors
--force-empty-corb-allowlist
For more details please see: https://www.chromium.org/Home/chromium-security/extension-content-script-fetches
Thank you in advance for your help in keeping Chrome's users secure!
Lukasz Anforowicz and the Chrome Security Architecture team
--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/CAA_NCUHAEB%2BWgzRLiOvMdDEHOUpi%3Dafr11eJXcG-wNHDZBUF_Q%40mail.gmail.com.
Thank you for this heads up.For testing, is it possible to enable those feature flags from chrome://flags or do they need to be enabled from the command line?
Specifically, I remember the out-of-blink-cors flag being available two months ago when I was testing, but I don't see it when I checked today. I was wondering if it has been changed or if it is an issue with my setup.
--
Thanks for the notice, reading the updated guidance for CORS, it seems that the allowlist will be eventually retired on release of manifest V3, however will this place during the migrationary period, or after updates have reached the stable build (or is this not known)?