Missing ExternalImageId/PipelineId namespace ownership validation in WebRenderBridgeParent allows cross-process surface import and pipeline hijack from compromised renderer
Three missing-authorization bugs in Firefox's GPU/compositor process let a compromised content process import foreign shared surfaces to read cross-origin pixels, hijack another process's RenderTexture registry entries, and overwrite foreign async image pipeline state. This defeats Fission site isolation at the rendering layer.
Originally disclosed on Mozilla
- Fixed in 2 months
- Paid in 3 months
- Disclosed after 2 months
## Summary
Three related missing-authorization bugs in the GPU/compositor process allow a compromised content process to (1) import foreign shared surfaces and read cross-origin pixels, (2) hijack another process's RenderTexture registry entries, and (3) overwrite foreign async image pipeline state. All three share the same root cause: per-operation ExternalImageId/PipelineId namespace ownership is not validated even though the validation function exists and is correctly applied on adjacent code paths.
This defeats Fission site isolation at the rendering layer.
## Root Cause (shared)
Firefox assigns each content process a monotonically increasing namespace (upper 32 bits of ExternalImageId and PipelineId). The function `OwnsExternalImageId()` exists at `CompositorManagerChild.h:72` and is correctly enforced on some paths (e.g., `RecvAddSharedSurface`, `RecvRemoveSharedSurface`, `SharedSurfacesHolder::Get`), but is never called on the three vulnerable paths described below.
## Bug 1: Cross-origin shared surface import via AddSharedExternalImage (sec-high)
### Vulnerable code
`WebRenderBridgeParent::AddSharedExternalImage()` at `gfx/layers/wr/WebRenderBridgeParent.cpp:845`:
```cpp
bool WebRenderBridgeParent::AddSharedExternalImage(
wr::ExternalImageId aExtId, wr::ImageKey aKey,
wr::TransactionBuilder& aResources) {
if (!MatchesNamespace(aKey)) { // checks ImageKey only
MOZ_ASSERT_UNREACHABLE("...");
return true;
}
// ... no OwnsExternalImageId(aExtId) check ...
RefPtr<DataSourceSurface> dSurf = SharedSurfacesParent::Acquire(aExtId); // line 860
// returns actual pixel data for ANY ExternalImageId
```
The same gap exists in `UpdateSharedExternalImage()` at line 948.
### Validated path (comparison)
`CompositorManagerParent::RecvAddSharedSurface()` at `CompositorManagerParent.cpp:301`:
```cpp
if (!OwnsExternalImageId(aId)) {
return IPC_FAIL_NO_REASON(this);
}
```
`SharedSurfacesHolder::Get()` at `SharedSurfacesParent.h:144`:
```cpp
if (extNamespace != mNamespace) {
MOZ_ASSERT_UNREACHABLE("Wrong namespace?");
return NS_ERROR_NOT_AVAILABLE;
}
```
### Attack
A compromised content process sends `RecvUpdateResources()` with a valid own IdNamespace (passes message-level check at line 1034), containing `OpAddSharedExternalImage(victim_ext_id, own_image_key)`. The parent validates only the ImageKey namespace (destination), not the ExternalImageId namespace (source). `SharedSurfacesParent::Acquire` returns the victim's `DataSourceSurface` — actual pixel data in shared memory.
### Impact
Cross-origin pixel disclosure. SharedSurfaces contain decoded images, canvas data, WebGL textures, and SVG renders from all content processes. Attacker imports a foreign surface into their own display list and renders it. This defeats Fission site isolation at the rendering layer.
### Namespace predictability
Namespaces are assigned by `GPUProcessManager::AllocateNamespace()` (`GPUProcessManager.cpp:1668`), which is `++mNextNamespace`. Resource IDs within a namespace are also sequential (`++mResourceId`). Brute-force enumeration of ~1000 IDs is practical — `SharedSurfacesParent::Acquire` returns null on miss with no side effect.
## Bug 2: RenderTexture registry hijack via PTexture ExternalImageId spoofing (sec-high)
### Vulnerable code
`ContentCompositorBridgeParent::AllocPTextureParent()` at `ContentCompositorBridgeParent.cpp:423`:
```cpp
PTextureParent* ContentCompositorBridgeParent::AllocPTextureParent(
..., const wr::MaybeExternalImageId& aExternalImageId) {
// NO OwnsExternalImageId(aExternalImageId) check
return TextureHost::CreateIPDLActor(
this, ..., aExternalImageId); // line 452-454
}
```
Same gap in `ImageBridgeParent::AllocPTextureParent()` at `ImageBridgeParent.cpp:317`.
### Attack
1. Attacker sends `PTexture` constructor with `ExternalImageId = victim_id` (IPDL parameter, fully child-controlled)
2. Parent creates `WebRenderTextureHost` storing the spoofed ID
3. Compositing triggers `EnsureRenderTexture()` → stores spoofed ID on inner `BufferTextureHost`
4. `RegisterExternalImage(victim_id, attacker_tex)` → `emplace` is no-op (key exists, debug-only assert at `RenderThread.cpp:1037`)
5. Attacker destroys PTexture → inner `TextureHost::Finalize()` → `MaybeDestroyRenderTexture()` → `UnregisterExternalImage(victim_id)` removes the VICTIM's entry from `mRenderTextures` (lookup by key only at `RenderThread.cpp:1066`, no ownership check)
6. Attacker creates new PTexture with same ID → `RegisterExternalImage` succeeds → hijack
### Impact
Cross-process texture substitution. WebRender resolves the victim's ImageKey to attacker-controlled texture data. Enables UI spoofing, content injection, and GPU process instability.
## Bug 3: Async image pipeline takeover via PipelineId spoofing (sec-high)
### Vulnerable code
`WebRenderBridgeParent::ProcessWebRenderParentCommands()` at `WebRenderBridgeParent.cpp:1622`:
```cpp
case WebRenderParentCommand::TOpAddPipelineIdForCompositable: {
const OpAddPipelineIdForCompositable& op = ...;
AddPipelineIdForCompositable(op.pipelineId(), ...); // NO PipelineId ownership check
break;
}
```
Same for `TOpUpdateAsyncImagePipeline` (line 1643) and `TOpUpdatedAsyncImagePipeline` (line 1661).
### Validated path (comparison, same function)
`TOpAddCompositorAnimations` at line 1687-1694:
```cpp
if ((data.id() >> 32) != (uint64_t)OtherPid()) {
gfxCriticalNote << "TOpAddCompositorAnimations bad id";
success = false;
continue;
}
```
Animation IDs are explicitly validated against the sender PID. PipelineIds are not.
### Attack
1. Attacker sends `RecvParentCommands()` with valid IdNamespace (passes message check at line 1585)
2. Inside: `OpAddPipelineIdForCompositable(victim_pipeline_id, attacker_handle, owner)`
3. `AsyncImagePipelineManager::AddAsyncImagePipeline()` at `AsyncImagePipelineManager.cpp:164` uses `InsertOrUpdate()` (line 175) — silently overwrites victim's pipeline entry in release builds (MOZ_ASSERT-only duplicate check at line 172)
4. `SetEmptyDisplayList()` blanks victim pipeline
5. Attacker sends `OpUpdateAsyncImagePipeline` / `OpUpdatedAsyncImagePipeline` with victim PipelineId to inject attacker content
### Shared manager
Child WebRenderBridgeParent instances share the root's `AsyncImagePipelineManager` (`ContentCompositorBridgeParent.cpp:187`). No per-bridge isolation.
### Impact
Cross-process async image pipeline blanking and content substitution. Victim's canvas/video/image pipeline is replaced with attacker content under the same compositor root.
## Inconsistency Matrix
| Path | ID Type | Validation | Status |
|------|---------|-----------|--------|
| `RecvAddSharedSurface` | ExternalImageId | `OwnsExternalImageId()` | �
Validated |
| `RecvRemoveSharedSurface` | ExternalImageId | `OwnsExternalImageId()` | �
Validated |
| `SharedSurfacesHolder::Get` | ExternalImageId | namespace check | �
Validated |
| `TOpAddCompositorAnimations` | AnimationId | PID check (line 1690) | �
Validated |
| **`AddSharedExternalImage`** | **ExternalImageId** | **MatchesNamespace(key) only** | ❌ **Missing** |
| **`UpdateSharedExternalImage`** | **ExternalImageId** | **MatchesNamespace(key) only** | ❌ **Missing** |
| **`AllocPTextureParent` (CCBP)** | **ExternalImageId** | **none** | ❌ **Missing** |
| **`AllocPTextureParent` (IBP)** | **ExternalImageId** | **none** | ❌ **Missing** |
| **`OpAddPipelineIdForCompositable`** | **PipelineId** | **none** | ❌ **Missing** |
| **`OpUpdateAsyncImagePipeline`** | **PipelineId** | **none** | ❌ **Missing** |
| **`OpUpdatedAsyncImagePipeline`** | **PipelineId** | **none** | ❌ **Missing** |
## Steps to Reproduce
These bugs require a compromised content process (standard sandbox escape threat model). Source code analysis demonstrates the vulnerability:
1. Clone mozilla-central (verified at HEAD as of 2026-03-16)
2. Confirm validation is absent:
- `grep -n "OwnsExternalImageId" gfx/layers/wr/WebRenderBridgeParent.cpp` → 0 results
- `grep -n "OwnsExternalImageId" gfx/layers/ipc/ContentCompositorBridgeParent.cpp` → 0 results
- `grep -n "OwnsExternalImageId" gfx/layers/ipc/ImageBridgeParent.cpp` → 0 results
3. Confirm validation IS present on adjacent paths:
- `grep -n "OwnsExternalImageId" gfx/layers/ipc/CompositorManagerParent.cpp` → lines 301, 318
- `grep -n "OtherPid" gfx/layers/wr/WebRenderBridgeParent.cpp` → line 1690 (animation ID only)
4. Confirm SharedSurfacesParent::Acquire has no caller check:
- Read `gfx/layers/ipc/SharedSurfacesParent.cpp:130-146` → raw hashtable lookup
5. Confirm RenderThread registry has no ownership check:
- Read `gfx/webrender_bindings/RenderThread.cpp:1060-1086` → erase by key only
6. Confirm AsyncImagePipelineManager::AddAsyncImagePipeline overwrites:
- Read `gfx/layers/wr/AsyncImagePipelineManager.cpp:164-175` → InsertOrUpdate
## Suggested Fix
### Bug 1 — AddSharedExternalImage / UpdateSharedExternalImage
Add ExternalImageId namespace validation before `SharedSurfacesParent::Acquire`:
```cpp
// In WebRenderBridgeParent::AddSharedExternalImage, after MatchesNamespace(aKey):
uint32_t extNamespace = static_cast<uint32_t>(wr::AsUint64(aExtId) >> 32);
if (extNamespace != mIdNamespace) {
gfxCriticalNote << "AddSharedExternalImage: wrong ExternalImageId namespace";
return false;
}
```
### Bug 2 — AllocPTextureParent
Add ExternalImageId ownership check:
```cpp
// In ContentCompositorBridgeParent::AllocPTextureParent:
if (aExternalImageId.isSome()) {
uint32_t extNamespace = static_cast<uint32_t>(wr::AsUint64(aExternalImageId.ref()) >> 32);
if (extNamespace != mCompositorManager->GetNamespace()) {
NS_ERROR("AllocPTextureParent: wrong ExternalImageId namespace");
return nullptr;
}
}
```
Same for `ImageBridgeParent::AllocPTextureParent`.
### Bug 3 — PipelineId commands
Add PipelineId ownership check, matching the existing animation ID pattern:
```cpp
// In ProcessWebRenderParentCommands, for each PipelineId-bearing command:
if ((wr::IsUint64(op.pipelineId()) >> 32) != mIdNamespace) {
gfxCriticalNote << "PipelineId namespace mismatch in parent command";
success = false;
continue;
}
```
## Verification Against Latest Source
Verified against mozilla-central HEAD as of 2026-03-16:
- `gfx/layers/wr/WebRenderBridgeParent.cpp` — no namespace check on ExternalImageId or PipelineId in any of the identified paths
- `gfx/layers/ipc/ContentCompositorBridgeParent.cpp:423-455` — no ExternalImageId validation
- `gfx/layers/ipc/ImageBridgeParent.cpp:317-324` — no ExternalImageId validation
- `gfx/layers/wr/AsyncImagePipelineManager.cpp:164-175` — InsertOrUpdate with MOZ_ASSERT only
- `gfx/webrender_bindings/RenderThread.cpp:1060-1086` — UnregisterExternalImage by key only
## Environment
- macOS 26.4 Beta (Darwin 25.4.0, Apple M2 Pro)
- mozilla-central source tree (verified 2026-03-16)
- Searchfox cross-referenced for validation
```Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the per-operation ExternalImageId and PipelineId namespace ownership is not validated on three code paths, even though a validation function exists and is used on adjacent paths.
Impact
A compromised content process could read cross-origin pixels, substitute textures across processes, and blank or replace another process's async image pipeline, defeating Fission site isolation at the rendering layer.
What the attacker needed
Compromised content process
The fix
The report suggests adding namespace ownership checks before acquiring shared surfaces, before creating texture actors, and before processing pipeline commands, matching the existing validation pattern.
How it was found
- Clone the Firefox source tree.
- Search for the ownership validation function in the three vulnerable files and confirm it is absent.
- Search for the same function in adjacent files and confirm it is present there.
- Read the shared surface acquisition code and confirm it performs a raw lookup with no caller check.
- Read the render thread registry code and confirm it erases entries by key only.
- Read the async image pipeline manager code and confirm it uses an insert-or-update that overwrites existing entries.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Firefox splits web pages into separate processes so one site cannot read another's data. The code that shares images and drawing instructions between these processes is supposed to check that each process only touches its own resources, but three paths skip that check. If an attacker can already run code inside one content process, they can use these gaps to read pixels from other sites or replace another process's images.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.