Closed Bug 1909590 Opened 11 months ago Closed 11 months ago

CSP in meta tag can be bypassed to load files from cross-origin

Categories

(Core :: DOM: Security, defect)

Firefox 128
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: duckhiem, Unassigned, NeedInfo)

Details

(Keywords: reporter-external)

Attachments

(1 file)

User Agent: Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Mobile Safari/537.36

Steps to reproduce:

Use these code lines:

<meta
  http-equiv="Content-Security-Policy"
  content="default-src 'self'; img-src 'none'; child-src 'none';" />
  
<style>

body  {

  background-image: url("https://www.w3schools.com/css/paper.gif");

  background-color: #cccccc;

}

</style>

On Firefox 128 on Android.

The photo from cross-origin still appears in your website.

Actual results:

Use these code lines:

<meta
  http-equiv="Content-Security-Policy"
  content="default-src 'self'; img-src 'none'; child-src 'none';" />
  
<style>

body  {

  background-image: url("https://www.w3schools.com/css/paper.gif");

  background-color: #cccccc;

}

</style>

On Firefox 128 on Android.

The photo from cross-origin still appears in your website.

Expected results:

Following the CSP rules.

Group: firefox-core-security → core-security
Component: Untriaged → DOM: Security
Product: Firefox → Core
Group: core-security → dom-core-security

Like your similar bugs we can't reproduce this on either Desktop or Android. We think your testing machine is broken or hacked. Did you try creating a completely new profile or a different machine like we asked in the other bugs?

At least in this case the CSP is in a meta tag so we can rule out some kind of Proxy that strips headers.

The Style is not applied because your CSP does not have 'unsafe-inline'. If you fix that then the image is blocked. We have no clue why you are not seeing the same thing.

Flags: needinfo?(duckhiem)

There is no longer a preference that disables CSP so I don't understand how your profile apparently does not process CSP at all, but it appears you do not have that feature somehow. We cannot reproduce this, and we haven't heard back that you have tried with a fresh profile or what your list of addons are.

Group: dom-core-security
Status: UNCONFIRMED → RESOLVED
Closed: 11 months ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: