You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
A change introduced in 3.4.40, can break content security policy when using the toolbar: #36315
The problem is that Symfony now sets {script,style}-src-elem which overrides {script,style}-src, I'll stick with referencing styles but the same problem exists from scripts.
How to reproduce
Given a simple policy of default-src https://example.com; style-src 'self', this permits CSS to be loaded from a file on the same origin.
Uh oh!
There was an error while loading. Please reload this page.
Symfony version(s) affected: 3.4.40
Description
A change introduced in 3.4.40, can break content security policy when using the toolbar: #36315
The problem is that Symfony now sets
{script,style}-src-elem
which overrides{script,style}-src
, I'll stick with referencing styles but the same problem exists from scripts.How to reproduce
Given a simple policy of
default-src https://example.com; style-src 'self'
, this permits CSS to be loaded from a file on the same origin.When the toolbar is enabled Symfony changes the policy to (I removed the script policies for simplicity):
This now blocks CSS being loaded as
style-src-elem
overridesstyle-src
and does not permit'self'
.Possible Solution
If
style-src-elem
does not exist andstyle-src
exists either:style-src
directives like is done fromdefault-src
And apply the same fix for scripts.
Additional context
Whilst investigating this I found another bug with the way the
'none'
token is handled: #36645The text was updated successfully, but these errors were encountered: