Closed Bug 1474537 Opened 6 years ago Closed 6 years ago

CSP 'self' should translate to 'self' and not be resolved to actual self URI

Categories

(Core :: DOM: Security, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: ckerschb, Assigned: ckerschb)

References

(Blocks 1 open bug)

Details

(Whiteboard: [domsecurity-active])

Attachments

(1 file)

Currently we are not strictly spec compliant when returning the 'original-policy' in csp reports, because instead of 'self' we return https://foo.com' in case the page is hosted on foo.com.

Instead we should return 'self' whenever 'self' appears in the policy.

This is also needed within Bug 965637 where we need to serialize the CSP.
Assignee: nobody → ckerschb
Blocks: 965637, csp-w3c-3
Status: NEW → ASSIGNED
Priority: -- → P1
Whiteboard: [domsecurity-active]
Hey Dan, please see comment 0 for explanation of the change here - This change actually makes us more spec compliant and fixes a bunch of web platform tests.
Attachment #8990932 - Flags: review?(dveditz)
Comment on attachment 8990932 [details] [diff] [review]
bug_1474537_csp_self_translate_self.patch

Review of attachment 8990932 [details] [diff] [review]:
-----------------------------------------------------------------

Looks great, r=dveditz
Attachment #8990932 - Flags: review?(dveditz) → review+
Pushed by mozilla@christophkerschbaumer.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/113b601a3b59
CSP 'self' should translate to 'self' and not be resolved to actual self URI. r=dveditz
This patch got pushed together with Bug 1475073 which caused a test failure, see:
https://bugzilla.mozilla.org/show_bug.cgi?id=1475073#c11
Flags: needinfo?(ckerschb)
Pushed by mozilla@christophkerschbaumer.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/91f5766f581b
CSP 'self' should translate to 'self' and not be resolved to actual self URI. r=dveditz
https://hg.mozilla.org/mozilla-central/rev/91f5766f581b
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
Duplicate of this bug: 1236221
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: