Closed Bug 1735856 (CVE-2022-22745) Opened 3 years ago Closed 3 years ago

Securitypolicyviolation leaks cross-origin information into parent for frame-ancestors violations

Categories

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

Firefox 92
defect

Tracking

()

RESOLVED FIXED
97 Branch
Tracking Status
firefox-esr91 96+ fixed
firefox95 --- wontfix
firefox96 + fixed
firefox97 + fixed

People

(Reporter: jannis, Assigned: robwu)

References

Details

(Keywords: csectype-sop, sec-moderate, Whiteboard: [domsecurity-active][adv-main96+][adv-esr91.5+])

Attachments

(2 files, 1 obsolete file)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:92.0) Gecko/20100101 Firefox/92.0

Steps to reproduce:

Visit https://demo.websec.saarland/static/csp_frame.html
Define a securitypolicyviolation handler and frame an document that sets frame-ancestors that blocks the framing

Actual results:

A securitypolicyviolation event is thrown on the parent page

Expected results:

No securitypolicyviolation should be thrown as this leaks cross-origin information.
See https://bugs.chromium.org/p/chromium/issues/detail?id=1186611&q=frame-ancestors&can=1 for the discussion and fix in chromium.

Group: core-security → dom-core-security
Summary: Securitypolicyviolation leaks cross-origin information for frame-ancestors violations → Securitypolicyviolation leaks cross-origin information into parent for frame-ancestors violations

On the demo page it looks like the whole navigation URL (in this case "https://bad.demo.websec.saarland/echo/?content-security-policy=frame-ancestors%20%27self%27") is leaked to the parent -- although that URL is already known to the parent in this case since there's no redirect involved. Have to make sure that's not confounding the results.

Confirmed by modifying the testcase to load https://bit.ly/3m4Qop7 in the frame. The SecurityPolicyViolationEvent sent to the parent page contains the final post-redirect https://bad.demo.websec.saarland documentURI.

Even if it were the pre-redirect URL, we shouldn't be throwing a violation event from one document's CSP at another document! All the parent gets to learn is that the framed content didn't load through the onerror/onload frame events, not why or which document.

Status: UNCONFIRMED → NEW
Ever confirmed: true

The severity field is not set for this bug.
:ckerschb, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(ckerschb)

Niklas, can you please take a look - would be good to get this one resolved!

Assignee: nobody → ngogge
Severity: -- → S1
Status: NEW → ASSIGNED
Flags: needinfo?(ckerschb) → needinfo?(ngogge)
Priority: -- → P1
Priority: P2 → P1
Whiteboard: [domsecurity-active]
Severity: S1 → S2
Priority: P2 → --
Priority: -- → P2

I'm taking this to avoid impacting bug 1745566.

Assignee: ngogge → rob
Flags: needinfo?(ngogge)
Priority: P2 → P1
Group: dom-core-security → core-security-release
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 97 Branch

The patch landed in nightly and beta is affected.
:robwu, is this bug important enough to require an uplift?
If not please set status_beta to wontfix.

For more information, please visit auto_nag documentation.

Flags: needinfo?(rob)

Comment on attachment 9255902 [details]
Bug 1735856 - Don't trigger violation events for frame-ancestors

Beta/Release Uplift Approval Request

  • User impact if declined: Cross-origin infoleak when websites specify the frame-ancestors CSP directive.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Covered by unit tests (an existing web platform test). A risk of uplifting is that requesting an uplift now could draw attention to this bug.
  • String changes made/needed:
Flags: needinfo?(rob)
Attachment #9255902 - Flags: approval-mozilla-beta?

Comment on attachment 9255902 [details]
Bug 1735856 - Don't trigger violation events for frame-ancestors

Approved for 96.0b9

Attachment #9255902 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

I would like to note that this was temporarily backed out during build failure investigation and reintroduced for 96.0b9.
Backout link

Reintroduced in:
https://hg.mozilla.org/releases/mozilla-beta/rev/ed5213c215a7

QA Whiteboard: [post-critsmash-triage]
Flags: qe-verify-

Do we need this on ESR also? It grafts cleanly.

Flags: needinfo?(rob)

Comment on attachment 9255902 [details]
Bug 1735856 - Don't trigger violation events for frame-ancestors

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: Easily exploitable cross-origin info leak when websites use the frame-ancestors CSP directive.
  • User impact if declined:
  • Fix Landed on Version:
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Covered by unit tests (an existing web platform test).
Flags: needinfo?(rob)
Attachment #9255902 - Flags: approval-mozilla-esr91?
Whiteboard: [domsecurity-active] → [domsecurity-active][adv-main96+]

My advisory draft currently just calls you "Jannis" like your Bugzilla handle, please let me know if any other name or full name would be preferable.

Flags: needinfo?(jannis)
Attached file advisory.txt (obsolete) —

Comment on attachment 9255902 [details]
Bug 1735856 - Don't trigger violation events for frame-ancestors

Approved for 91.5esr.

Attachment #9255902 - Flags: approval-mozilla-esr91? → approval-mozilla-esr91+

(In reply to Frederik Braun [:freddy] from comment #16)

My advisory draft currently just calls you "Jannis" like your Bugzilla handle, please let me know if any other name or full name would be preferable.

I would prefer my full name: Jannis Rautenstrauch

Flags: needinfo?(jannis)
Whiteboard: [domsecurity-active][adv-main96+] → [domsecurity-active][adv-main96+][adv-esr91.5+]
Attached file advisory.txt
Attachment #9257677 - Attachment is obsolete: true
Alias: CVE-2022-22745
Group: core-security-release
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: