Closed Bug 1781759 Opened 3 years ago Closed 2 years ago

cross-origin Mp4 Videos not played when loaded as document in iFrame

Categories

(Core :: Audio/Video: Playback, defect, P1)

Firefox 102
Unspecified
All
defect

Tracking

()

VERIFIED FIXED
106 Branch
Tracking Status
firefox-esr91 --- wontfix
firefox-esr102 105+ verified
firefox103 --- wontfix
firefox104 --- verified
firefox105 --- verified
firefox106 --- verified

People

(Reporter: jonathan.fuchs, Assigned: karlt)

References

(Regression)

Details

(Keywords: regression)

Attachments

(3 files)

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

Steps to reproduce:

Embedded a video in an iFrame. Format is mp4. If I play the video with a normal video tag it works fine but not if its inside an iFrame. See below

https://jsfiddle.net/jonny_fux/d2b6c5af/11/

Actual results:

Error: No Video with supported format and MIME type found

Expected results:

The video should be played. That works in Safari and Chromium Browsers.

Status: UNCONFIRMED → NEW
Component: Untriaged → Audio/Video: Playback
Ever confirmed: true
OS: Unspecified → All
Product: Firefox → Core
See Also: → 1781063
Keywords: regression
Regressed by: CVE-2022-31736
Severity: -- → S3
Priority: -- → P3

:karlt, since you are the author of the regressor, bug 1735923, could you take a look?
For more information, please visit auto_nag documentation.

Flags: needinfo?(karlt)
Assignee: nobody → karlt
Status: NEW → ASSIGNED
Flags: needinfo?(karlt)
See Also: → 1783540

Using "Select an iframe as the currently targeted document" in the Web Developer Tools Console, document.getElementsByTagName("video")[0].error.message is "NS_ERROR_CONTENT_BLOCKED (0x805e0006) - opaque and non-opaque responses".

Summary: Mp4 Videos not played in iFrame → cross-origin Mp4 Videos not played when loaded as document in iFrame
See Also: → 1783601

When the media resource is loaded as a document, the response from the initial
document load gets reused, as an optimization, as an emulated load for the
resource of the media host element in the generated HTML document.
https://searchfox.org/mozilla-central/rev/5644fae86d5122519a0e34ee03117c88c6ed9b47/dom/html/VideoDocument.cpp#114
https://html.spec.whatwg.org/multipage/browsing-the-web.html#read-media
The loadingPrincipal of the initial channel comes from the parent document,
and so is not useful to determine whether the response is cross-origin with
the media element.

This change makes the cross-origin test on the initial document load
consistent with subsequent requests on the same resource and non-document
loads, which already use the node principal for the loadingPrincipal.
https://searchfox.org/mozilla-central/rev/1061fae5e225a99ef5e43dbdf560a91a0c0d00d1/dom/media/ChannelMediaResource.cpp#750
https://searchfox.org/mozilla-central/rev/4f2984be127d2e7c788cf1848d63dca63022beec/dom/html/HTMLMediaElement.cpp#1708

Depends on D154039

The severity field for this bug is relatively low, S3. However, the bug has 5 See Also bugs.
:karlt, could you consider increasing the bug severity?

For more information, please visit auto_nag documentation.

Flags: needinfo?(karlt)
Severity: S3 → S2
Flags: needinfo?(karlt)
Priority: P3 → P1
Pushed by ktomlinson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4f56c42c36e7 factor out ChannelMediaResource::MediaElement() helper r=chunmin https://hg.mozilla.org/integration/autoland/rev/69937c47da4b use media element node principal instead of channel loading principal for cross-origin resource test r=padenot https://hg.mozilla.org/integration/autoland/rev/b820ae7bac8d Test cross origin load of media document in parts r=chunmin
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/35568 for changes under testing/web-platform/tests
Regressions: 1786445
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 106 Branch
Upstream PR merged by moz-wptsync-bot
See Also: 1783540

Comment on attachment 9288955 [details]
Bug 1781759 use media element node principal instead of channel loading principal for cross-origin resource test r?edenchuang

Beta/Release Uplift Approval Request

  • User impact if declined: Some videos or audio do not play sometimes or always when loaded into a cross-origin iframe.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: No
  • 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): The change is small and affects only media loaded as a document, which is currently often refusing to play.
  • String changes made/needed: None.
  • Is Android affected?: Yes
Attachment #9288955 - Flags: approval-mozilla-beta?
Attachment #9288954 - Flags: approval-mozilla-beta?
Attachment #9288956 - Flags: approval-mozilla-beta?

Comment on attachment 9288954 [details]
Bug 1781759 factor out ChannelMediaResource::MediaElement() helper r?chunmin

Approved for 105.0b3.

Attachment #9288954 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #9288955 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #9288956 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

[Tracking Requested - why for this release]:
Regression on 102 branch.

ESR91 is affected but https://fx-trains.herokuapp.com/release/?version=esr says there are no more ESR91 releases to come.

Comment on attachment 9288955 [details]
Bug 1781759 use media element node principal instead of channel loading principal for cross-origin resource test r?edenchuang

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: This fixes a regression introduced in 102.
  • User impact if declined: Some videos or audio do not play sometimes or always when loaded into a cross-origin iframe.
  • Fix Landed on Version: 106 and uplifted to 105
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): The change is small and affects only media loaded as a document, which is currently often refusing to play.
Attachment #9288955 - Flags: approval-mozilla-esr102?
Attachment #9288954 - Flags: approval-mozilla-esr102?
Attachment #9288956 - Flags: approval-mozilla-esr102?

Comment on attachment 9288955 [details]
Bug 1781759 use media element node principal instead of channel loading principal for cross-origin resource test r?edenchuang

Beta/Release Uplift Approval Request

  • User impact if declined: Most videos or audio do not play sometimes or always when loaded into a cross-origin iframe.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: No
  • 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): The change is small and affects only media loaded as a document, which is currently often refusing to play.
  • String changes made/needed: None.
  • Is Android affected?: Yes
Attachment #9288955 - Flags: approval-mozilla-release?
Attachment #9288954 - Flags: approval-mozilla-release?
Attachment #9288956 - Flags: approval-mozilla-release?
QA Whiteboard: [qa-triaged]

Hello,
I managed to reproduce this issue on FIrefox 104.0(build ID: 20220818191623) on Ubuntu 22.04, using the STR and URL from the Description. Verified as fixed on FIrefox 105.0b4(build ID: 20220828190315) and Nightly 106.0a1(build ID: 20220828210513) on Ubuntu 22.04, macOS 12, WIndows 10.

Comment on attachment 9288954 [details]
Bug 1781759 factor out ChannelMediaResource::MediaElement() helper r?chunmin

Approved for 102.3esr.

Attachment #9288954 - Flags: approval-mozilla-esr102? → approval-mozilla-esr102+
Attachment #9288955 - Flags: approval-mozilla-esr102? → approval-mozilla-esr102+
Attachment #9288956 - Flags: approval-mozilla-esr102? → approval-mozilla-esr102+

Hello,
I confirm this fix is verified on Firefox 102.3.0esr(build ID: 20220829144321) on macOS 12, Ubuntu 22.04, Windows 10.

Status: RESOLVED → VERIFIED
Flags: qe-verify+

Comment on attachment 9288954 [details]
Bug 1781759 factor out ChannelMediaResource::MediaElement() helper r?chunmin

Approved for 104.0.2

Attachment #9288954 - Flags: approval-mozilla-release? → approval-mozilla-release+
Attachment #9288955 - Flags: approval-mozilla-release? → approval-mozilla-release+
Attachment #9288956 - Flags: approval-mozilla-release? → approval-mozilla-release+
Flags: qe-verify+

I have verified the fix on Firefox 104.0.2 (20220901135416)

QA Whiteboard: [qa-triaged]
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: