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
<p>An <code class="idl"><a data-link-type="idl" href="#audiodecoder" id="ref-for-audiodecoder⑥">AudioDecoder</a></code>, when its tab is audibly playing audio.</p>
<p>The primary security impact is that features of this API make it easier for an
6618
+
<div class="non-normative">
6619
+
This section is non-normative.
6620
+
<p>The primary security impact is that features of this API make it easier for an
6619
6621
attacker to exploit vulnerabilities in the underlying platform codecs.
6620
6622
Additionally, new abilities to configure and control the codecs can allow for
6621
6623
new exploits that rely on a specific configuration and/or sequence of control
6622
6624
operations.</p>
6623
-
<p>Platform codecs are historically an internal detail of APIs like <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/media.html#htmlmediaelement" id="ref-for-htmlmediaelement">HTMLMediaElement</a></code>, <a data-link-type="biblio" href="#biblio-webaudio" title="Web Audio API">[WEBAUDIO]</a>, and <a data-link-type="biblio" href="#biblio-webrtc" title="WebRTC: Real-Time Communication in Browsers">[WebRTC]</a>. In this way, it has always
6625
+
<p>Platform codecs are historically an internal detail of APIs like <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/media.html#htmlmediaelement" id="ref-for-htmlmediaelement">HTMLMediaElement</a></code>, <a data-link-type="biblio" href="#biblio-webaudio" title="Web Audio API">[WEBAUDIO]</a>, and <a data-link-type="biblio" href="#biblio-webrtc" title="WebRTC: Real-Time Communication in Browsers">[WebRTC]</a>. In this way, it has always
6624
6626
been possible to attack the underlying codecs by using malformed media
6625
6627
files/streams and invoking the various API control methods.</p>
6626
-
<p>For example, you can send any stream to a decoder by first wrapping that stream
6628
+
<p>For example, you can send any stream to a decoder by first wrapping that stream
6627
6629
in a media container (e.g. mp4) and setting that as the <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/media.html#dom-media-src" id="ref-for-dom-media-src">src</a></code> of an <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/media.html#htmlmediaelement" id="ref-for-htmlmediaelement①">HTMLMediaElement</a></code>. You can then cause the underlying video decoder to
6628
6630
be <code class="idl"><a data-link-type="idl" href="#dom-videodecoder-reset" id="ref-for-dom-videodecoder-reset①">reset()</a></code> by setting a new value for <code><video>.currentTime</code>.</p>
6629
-
<p>WebCodecs makes such attacks easier by exposing low level control when inputs
6631
+
<p>WebCodecs makes such attacks easier by exposing low level control when inputs
6630
6632
are provided and direct access to invoke the codec control methods. This also
6631
6633
affords attackers the ability to invoke sequences of control methods that were
6632
6634
not previously possible via the higher level APIs.</p>
6633
-
<p>The Working Group expects User Agents to mitigate this risk by extensively
6635
+
<p>The Working Group expects User Agents to mitigate this risk by extensively
6634
6636
fuzzing their implementation with random inputs and control method invocations.
6635
6637
Additionally, User Agents are encouraged to isolate their underlying codecs in
6636
6638
processes with restricted privileges (sandbox) as a barrier against successful
6637
6639
exploits being able to read user data.</p>
6638
-
<p>An additional concern is exposing the underlying codecs to input mutation race
6639
-
conditions. Specifically, it <em class="rfc2119">SHOULD</em> not be possible for
6640
-
a site to mutate a codec input or output while the underlying codec is still
6641
-
operating on that data. This concern is mitigated by ensuring that input and
<p>The primary privacy impact is an increased ability to fingerprint users by
6645
6648
querying for different codec capabilities to establish a codec feature profile.
6646
6649
Much of this profile is already exposed by existing APIs. Such profiles are very
6647
6650
unlikely to be uniquely identifying, but can be used with other metrics to
6648
6651
create a fingerprint.</p>
6649
-
<p>An attacker can accumulate a codec feature profile by calling <code>IsConfigSupported()</code> methods with a number of different configuration
6652
+
<p>An attacker can accumulate a codec feature profile by calling <code>IsConfigSupported()</code> methods with a number of different configuration
6650
6653
dictionaries. Similarly, an attacker can attempt to <code>configure()</code> a codec with
6651
6654
different configuration dictionaries and observe which configurations are
6652
6655
accepted.</p>
6653
-
<p>Attackers can also use existing APIs to establish much of the codec feature
6656
+
<p>Attackers can also use existing APIs to establish much of the codec feature
6654
6657
profile. For example, the <a data-link-type="biblio" href="#biblio-media-capabilities" title="Media Capabilities">[media-capabilities]</a> <code class="idl"><a data-link-type="idl" href="https://w3c.github.io/media-capabilities/#dom-mediacapabilities-decodinginfo" id="ref-for-dom-mediacapabilities-decodinginfo">decodingInfo()</a></code> API
6655
6658
describes what types of decoders are supported and its <code class="idl"><a data-link-type="idl" href="https://w3c.github.io/media-capabilities/#dom-mediacapabilitiesinfo-powerefficient" id="ref-for-dom-mediacapabilitiesinfo-powerefficient">powerEfficient</a></code> attribute can signal when a decoder uses hardware acceleration. Similarly, the <a data-link-type="biblio" href="#biblio-webrtc" title="WebRTC: Real-Time Communication in Browsers">[WebRTC]</a> <code class="idl"><a data-link-type="idl" href="https://w3c.github.io/webrtc-pc/#dom-rtcrtpsender-getcapabilities" id="ref-for-dom-rtcrtpsender-getcapabilities">getCapabilities()</a></code> API can be used to determine what
6656
6659
types of encoders are supported and the <code class="idl"><a data-link-type="idl" href="https://w3c.github.io/webrtc-pc/#widl-RTCPeerConnection-getStats-Promise-RTCStatsReport--MediaStreamTrack-selector" id="ref-for-widl-RTCPeerConnection-getStats-Promise-RTCStatsReport--MediaStreamTrack-selector">getStats()</a></code> API can
6657
6660
be used to determine when an encoder uses hardware acceleration. WebCodecs will
6658
6661
expose some additional information in the form of low level codec features.</p>
6659
-
<p>A codec feature profile alone is unlikely to be uniquely identifying. Underlying
6662
+
<p>A codec feature profile alone is unlikely to be uniquely identifying. Underlying
6660
6663
codecs are often implemented entirely in software (be it part of the User Agent
6661
6664
binary or part of the operating system), such that all users who run that
6662
6665
software will have a common set of capabilities. Additionally, underlying codecs
outliers (some users can be running outdated versions of software codecs or use
6667
6670
a rare mix of custom assembled hardware), but most of the time a given codec
6668
6671
feature profile is shared by a large group of users.</p>
6669
-
<p>Segmenting groups of users by codec feature profile still amounts to a bit of
6672
+
<p>Segmenting groups of users by codec feature profile still amounts to a bit of
6670
6673
entropy that can be combined with other metrics to uniquely identify a user.
6671
6674
User Agents <em class="rfc2119">MAY</em> partially mitigate this by returning an
6672
6675
error whenever a site attempts to exhaustively probe for codec capabilities.
6673
6676
Additionally, User Agents <em class="rfc2119">MAY</em> implement a "privacy
6674
6677
budget", which depletes as authors use WebCodecs and other identifying APIs.
6675
6678
Upon exhaustion of the privacy budget, codec capabilities could be reduced to a
6676
6679
common baseline or prompt for user approval.</p>
6677
-
<h2 class="heading settled" data-level="14" id="best-practices-developers"><span class="secno">14. </span><span class="content">Best Practices for Authors Using WebCodecs</span><a class="self-link" href="#best-practices-developers"></a></h2>
6678
-
<div class="non-normative">
6679
-
This section is non-normative.
6680
-
<p>While WebCodecs internally operates on background threads, authors working with
6680
+
<h2 class="heading settled" data-level="14" id="best-practices-developers"><span class="secno">14. </span><span class="content">Best Practices for Authors Using WebCodecs</span><a class="self-link" href="#best-practices-developers"></a></h2>
6681
+
<div class="non-normative">
6682
+
This section is non-normative.
6683
+
<p>While WebCodecs internally operates on background threads, authors working with
6681
6684
realtime media or in contended main thread environments are encouraged to ensure their
6682
6685
media pipelines operate in worker contexts entirely independent of the main
6683
6686
thread where possible. For example, realtime media processing of <code class="idl"><a data-link-type="idl" href="#videoframe" id="ref-for-videoframe⑦①">VideoFrame</a></code>s
6684
6687
are generally to be done in a worker context.</p>
6685
-
<p>The main thread has significant potential for high contention and jank that can
6688
+
<p>The main thread has significant potential for high contention and jank that can
6686
6689
go unnoticed in development, yet degrade inconsistently across devices and User
6687
6690
Agents in the field -- potentially dramatically impacting the end user
6688
6691
experience. Ensuring the media pipeline is decoupled from the main thread helps
6689
6692
provide a smooth experience for end users.</p>
6690
-
<p>Authors using the main thread for their media pipeline ought to be sure of
6693
+
<p>Authors using the main thread for their media pipeline ought to be sure of
6691
6694
their target frame rates, main thread workload, how their application will be
6692
6695
embedded, and the class of devices their users will be using.</p>
<dd>Anne van Kesteren; et al. <a href="https://html.spec.whatwg.org/multipage/"><cite>HTML Standard</cite></a>. Living Standard. URL: <a href="https://html.spec.whatwg.org/multipage/">https://html.spec.whatwg.org/multipage/</a>
7898
7903
<dt id="biblio-infra">[INFRA]
7899
7904
<dd>Anne van Kesteren; Domenic Denicola. <a href="https://infra.spec.whatwg.org/"><cite>Infra Standard</cite></a>. Living Standard. URL: <a href="https://infra.spec.whatwg.org/">https://infra.spec.whatwg.org/</a>
<dd>Cullen Jennings; et al. <a href="https://w3c.github.io/webrtc-pc/"><cite>WebRTC: Real-Time Communication in Browsers</cite></a>. URL: <a href="https://w3c.github.io/webrtc-pc/">https://w3c.github.io/webrtc-pc/</a>
7916
7917
<dt id="biblio-webrtc-svc">[WebRTC-SVC]
7917
7918
<dd>Bernard Aboba. <a href="https://w3c.github.io/webrtc-svc/"><cite>Scalable Video Coding (SVC) Extension for WebRTC</cite></a>. URL: <a href="https://w3c.github.io/webrtc-svc/">https://w3c.github.io/webrtc-svc/</a>
<dd><a href="https://www.itu.int/rec/T-REC-H.273/en"><cite>Coding-independent code points for video signal type identification</cite></a>. December 2016. URL: <a href="https://www.itu.int/rec/T-REC-H.273/en">https://www.itu.int/rec/T-REC-H.273/en</a>
<dd>Cullen Jennings; et al. <a href="https://w3c.github.io/webrtc-pc/"><cite>WebRTC: Real-Time Communication in Browsers</cite></a>. URL: <a href="https://w3c.github.io/webrtc-pc/">https://w3c.github.io/webrtc-pc/</a>
0 commit comments