WebM Playback should not be allowed in lockdown mode
CVE: CVE-2026-113952 · Safari 27.2 · Released October 26, 2026 Impact: A website may be able to use a media format that should be restricted in Lockdown Mode Apple's description: A logic issue was addressed with improved checks. Credit: Drinor Selmanaj (Sentry)
Medium. The bug grants no primitive on its own. What it does is reopen a parser and decoder surface for exactly the users who asked to have it closed. Any page reaches it reliably, and the impact is capped by whatever latent bug sits behind the WebM demuxer.
Lockdown Mode shrinks the browser's media attack surface by giving each media player an allowlist of permitted container and codec types, and every playback backend is expected to refuse anything outside that list. On Apple platforms one of those backends is MediaPlayerPrivateWebM, WebKit's native WebM player, which demuxes WebM/Matroska bytes with WebKit's own parser before handing samples to the platform renderer. The invariant has two sides. A backend must not advertise support for a forbidden container when the selection layer asks, and it must not begin parsing one when told to load.
The angle: A page can make a Lockdown Mode user's browser parse attacker-supplied WebM bytes, which reopens the demuxer and video/audio decoder surface the mode exists to remove.
Source/WebCore/platform/graphics/cocoa/MediaPlayerPrivateWebM.mm
LayoutTests/media/media-allowed-containers.html
Patch Details
The fix wires the Lockdown Mode allowlists into the Cocoa WebM engine at two points: the capability query and the load entry point.
MediaPlayerPrivateWebM::supportsType() now runs contentTypeMeetsContainerAndCodecTypeRequirements(parameters.type, parameters.allowedMediaContainerTypes, parameters.allowedMediaCodecTypes) before it delegates to SourceBufferParserWebM::isContentTypeSupported(). When the requested content type fails either allowlist, the engine answers MediaPlayer::SupportsType::IsNotSupported. That answer feeds both engine selection and the script-visible canPlayType(). This check covers containers and codecs together.
MediaPlayerPrivateWebM::load() gains a second gate. It first upgrades the engine's weak m_player back-reference to a RefPtr and returns early if the owning player is already gone. It then reads player->allowedMediaContainerTypes(). If an allowlist is present and contains neither video/webm nor audio/webm (compared case-insensitively through a constexpr lambda passed to containsIf), it logs "WebM is not an allowed container type", moves the network state to MediaPlayer::NetworkState::FormatError, and returns. The placement matters. The gate fires before m_assetURL is assigned and before the SourceBufferParserWebM instance is configured (allowLimitedMatroska()), so no resource bytes reach the parser on the rejected path.
This load-time gate checks only the container. It does not consult allowedMediaCodecTypes, so the two layers of the fix are not equivalent. The Analysis below returns to this point.
The ContentTypeUtilities.h import exists to bring in the shared helper. The LayoutTest media/media-allowed-containers.html adds two cases driven through internals.settings.setAllowedMediaContainerTypes:
- With
"video/webm"allowed,canPlayType("video/webm")returns'maybe'and a VP8 WebM file firescanplay. - With only
"video/mp4"allowed,canPlayType("video/webm")returns''and loading the same file must fireerror. Before the fix, this case either advertised WebM as playable or played it.
Background
Lockdown Mode. Lockdown Mode is Apple's opt-in hardening profile for users who expect targeted attacks. It disables or restricts complex web features so that less parsing and decoding code is reachable from untrusted web content. Restricting media formats is one of the levers it uses.
Media allowlists.
WebCore expresses the media restriction as two optional per-player allowlists, allowedMediaContainerTypes and allowedMediaCodecTypes. They are exposed through WebCore settings and carried on both MediaPlayer and the MediaEngineSupportParameters struct handed to capability queries. An absent value means "unrestricted". A present value means only the listed MIME containers and codecs should be accepted. contentTypeMeetsContainerAndCodecTypeRequirements() in ContentTypeUtilities is the shared helper that tests a ContentType (a MIME string plus its codecs= parameters) against both lists at once.
Engine selection.
A <video> or <audio> element owns a MediaPlayer, which is a front end over several interchangeable backends called MediaPlayerPrivate engines (AVFoundation, Media Source Extensions, WebM, and others). For a given content type, MediaPlayer asks each registered engine's supportsType() for a verdict (IsSupported, MayBeSupported, IsNotSupported) and instantiates the best match. HTMLMediaElement.canPlayType() surfaces the same verdict to script as 'probably', 'maybe', or ''. After selection, the chosen engine's load() starts fetching and parsing the resource. In this design the allowlists only take effect if each engine honours the parameters it is handed.
MediaPlayerPrivateWebM.
MediaPlayerPrivateWebM is WebKit's native WebM file player on Cocoa platforms. It demuxes the container with SourceBufferParserWebM, a Matroska/WebM parser that is also used by MSE SourceBuffers. The parser runs on a dedicated work queue and hands parsed audio and video samples to an AudioVideoRenderer for decode and presentation. WebM typically carries VP8/VP9 video and Opus/Vorbis audio.
Analysis
This is a policy-enforcement bypass: one pluggable media backend never read the allowlist it was handed, so it both advertised and executed a container the active policy forbids.
Before (allowlist = ["video/mp4"]): After:
canPlayType / engine selection canPlayType / engine selection
└─► WebM::supportsType() └─► WebM::supportsType()
└─► parser.isContentTypeSupported() └─► allowlist check ──✗─► IsNotSupported
└─► "maybe" (WebM chosen)
WebM::load(url) WebM::load(url)
└─► m_assetURL = url └─► container allowlist ──✗─► FormatError → 'error'
└─► SourceBufferParserWebM ◄── attacker bytes
└─► VP8/VP9/Opus/Vorbis decode
The left column shows both layers that should have stopped a forbidden container, and neither one did. Before the fix, supportsType() checked platform type, remote playback, wireless-target state, and then SourceBufferParserWebM::isContentTypeSupported(). None of those consults parameters.allowedMediaContainerTypes or parameters.allowedMediaCodecTypes. Under an MP4-only allowlist the WebM engine still answered "maybe", which is exactly what the new LayoutTest pins down when it asserts canPlayType("video/webm") == ''. Because engine selection takes each engine's verdict at face value, a non-empty answer is enough for the WebM engine to be instantiated for WebM content.
The second arrow on the left is where the real consequence lies. load() had no gate at all. It assigned m_assetURL and went straight into configuring and feeding the Matroska/WebM demuxer, and from there the VP8/VP9/Opus/Vorbis decode paths. The Lockdown Mode configuration exists precisely to keep that surface unreachable. The page controls every byte of the resource.
A concrete trigger needs nothing beyond ordinary markup and script:
- The victim runs with Lockdown Mode enabled, so the player carries a container allowlist that excludes WebM.
- A page creates a
<video>element and setssrcto an attacker-hosted.webmfile. - Engine selection queries
MediaPlayerPrivateWebM::supportsType(), which ignores the allowlist and returns a positive verdict. MediaPlayerPrivateWebM::load()runs without a gate, and the attacker-controlled container is handed toSourceBufferParserWebM.- Parsed samples flow on to the decoders. Before the fix the test file fires
canplayhere. After the fix it fireserror.
The fix restores the invariant at both points in the right column. supportsType() now refuses through the shared helper, so the WebM engine drops out of selection and canPlayType() tells script the truth. load() independently refuses when the container allowlist excludes WebM, and it does so before the URL is stored or the parser configured. The load-time gate is defense in depth against paths that reach load() without a successful supportsType() decision. Those paths are likely engine choice driven by file extension or a sniffed MIME type rather than an explicit type attribute. Whether such paths exist depends on MediaPlayer's engine-iteration logic, which this commit does not touch.
The two layers are not symmetric. supportsType() enforces both containers and codecs, while load() enforces only containers. If some route reaches load() without a capability query, the container gate still holds, but a WebM file whose tracks use a codec missing from allowedMediaCodecTypes would not be refused at load time. Whether any such route exists is an open audit question, not an established bypass. It is the natural place to look next.
On severity, the vulnerability weakens an attack-surface-reduction boundary, not a memory-safety boundary. Lockdown Mode assumes that formats absent from allowedMediaContainerTypes are never parsed. Before the fix, MediaPlayerPrivateWebM violated that assumption in both supportsType() and load(), and any web page could exploit that reliably. The bug hands over no read, write, or control primitive. The primitive class is surface re-exposure: attacker-controlled bytes reach the WebM demuxer and its decoders in a configuration where they should be unreachable. Its ceiling is bounded entirely by whatever latent memory-safety bugs exist in that parser and decoder stack. A separate bug in that stack would remain reachable for exactly the high-risk population that opted in to remove it.
The bug also does not cross a sandbox boundary on its own. Parsing runs in whichever process hosts the media engine, typically the GPU process when media playback is remoted. A chained parser bug would therefore land in that process's sandbox and would still need its own escape.
The WebM engine never read the allowlist it was handed, so selection could pick it for a forbidden container and load() fed attacker bytes straight into the demuxer.
Insight
Allowlist-style hardening like Lockdown Mode is only as strong as its least-compliant backend. WebCore delegates format policy to each engine's supportsType() instead of filtering centrally before dispatch, so every newly added MediaPlayerPrivate engine is a potential silent hole. Here the WebM engine shipped without the check its sibling engines presumably honour. The fix's extra load-time gate concedes that capability negotiation is not the only door into load(). Because that gate covers containers but not codecs, the defense is now layered but uneven, and the same delegation pattern will produce the next instance of this bug unless enforcement moves above the engine boundary.
Audit directions
-
Advertised vs. enforced policy across backends. Narrow: audit every
MediaPlayerPrivate*::supportsType()andload()underSource/WebCore/platform/graphics, including the AVFObjC engine,MediaPlayerPrivateMediaSourceAVFObjC, the GStreamer engines, and the remote/GPU-process proxies. Confirm that each one callscontentTypeMeetsContainerAndCodecTypeRequirements()or readsallowedMediaContainerTypes. Wider: ask the same question of every place a restricted format list exists, such asMediaSource.isTypeSupported()/addSourceBuffer(), WebCodecsisConfigSupported(), and image-decoder selection. Widest: this is the "advertised capability vs. executed capability" class. It also appears in Chromium Permissions Policy checks that gate the JS-facing API but not the backing service, and in Android permission checks performed in the client API layer but not in the system service. Match tell: a backend whose dispatch or load entry point never references the policy object even though its siblings do. -
Execution-time enforcement weaker than advertisement-time enforcement. Narrow: in
MediaPlayerPrivateWebM, check whether a WebM file carrying a disallowed codec (for example VP9 when only VP8 is allowed) can still reach the decoder through aload()path that bypassessupportsType(). The newload()gate checks containers only. Wider: look for the same two-layer asymmetry in other engines, where codec restrictions apply during capability negotiation but are not re-applied after demux reveals the real track codecs. Widest: any content pipeline that declares a type up front but learns the true type only after parsing must re-validate after discovery. Examples include HTTPContent-Typevs. sniffed bytes and file extension vs. magic number. Match tell: a policy check keyed on a declared MIME string with no corresponding check on parsed track or codec metadata. -
Paths into
load()that skipsupportsType(). Narrow: trace howMediaPlayerreaches an engine'sload()when no explicit type is supplied, for example through extension-based guessing, response MIME sniffing, or fallback to the next engine after a failure. Confirm whether any path skipssupportsType()and therefore depends on per-engine load-time guards like the one added here. Wider: in the same selection logic, check retry and fallback loops for whether they re-querysupportsType()with the currentMediaEngineSupportParametersor reuse a stale verdict. Match tell: an engine-iteration loop that instantiates an engine on fallback or retry without re-queryingsupportsType(). Ceiling: this specific shape is bound to WebCore's multi-engine media selection. The analogous question outside WebKit applies to any plugin-dispatch system that falls back to the "next" handler without re-applying the policy filter.