Sandbox escape: WebRenderBridgeParent::RecvStartCaptureSequence writes files to attacker-controlled path without validation from compromised content process
The parent-side handler for the StartCaptureSequence IPC message accepts an arbitrary absolute path from a compromised content process and passes it to the WebRender backend, which creates directories and writes capture files there. An attacker who has already compromised the content process could write files to any location the parent process can access, potentially escaping the sandbox.
Originally disclosed on Mozilla
- Fixed in 17 days
- Paid in 24 days
- Disclosed after 17 days
Steps to reproduce:
- A compromised content process sends
PWebRenderBridge::StartCaptureSequenceIPC message with an arbitrary absolute path (e.g.,/tmp/evil) and flags0xf. - The message is defined in
gfx/layers/ipc/PWebRenderBridge.ipdl:81asparent:direction (child→parent), with no access restriction annotations. - The parent-side handler at
gfx/layers/wr/WebRenderBridgeParent.cpp:2226passes the path directly toWebRenderAPI::StartCaptureSequence()with zero validation. - The Rust WebRender backend (
gfx/wr/webrender/src/capture.rs) callsstd::fs::create_dir_all(&root)andFile::create(path), writing scene/frame data to the attacker-chosen path.
Note: Rust's PathBuf::join() with an absolute path argument replaces the base entirely, so the attacker has full control over the destination.
The capture Cargo feature is enabled in release builds (gfx/webrender_bindings/Cargo.toml:32). The IPC symbol PWebRenderBridge::Msg_StartCaptureSequence is present in the Firefox 148.0.2 release binary.
Actual results:
The parent/GPU process creates directories and writes WebRender capture files (.ron, .tree, .png) to the attacker-specified absolute path, with no path validation, no sandbox restriction, and no privilege check on the IPC message.
Expected results:
The RecvStartCaptureSequence handler should either:
- Validate the path (reject absolute paths, reject
..traversal, restrict to profile/temp dir), or - Be removed from the IPDL protocol entirely (only allow chrome-initiated captures via
nsIDOMWindowUtils), or - Use a
[ParentSide]IPDL annotation to prevent content process access.
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
The IPC handler for StartCaptureSequence does not validate the path supplied by the content process before passing it to file-writing code.
Impact
A compromised content process could write WebRender capture files to any absolute path accessible to the parent or GPU process, potentially escaping the sandbox.
What the attacker needed
Compromised content process
The fix
The handler should validate the path, be removed from the IPDL protocol, or be restricted with a ParentSide annotation so the content process cannot invoke it.
How it was found
- A compromised content process sends the StartCaptureSequence IPC message with an arbitrary absolute path and flags.
- The message is defined in the IPDL protocol as a parent-direction message with no access restriction.
- The parent-side handler passes the path directly to the WebRender API without validation.
- The Rust WebRender backend creates directories and files at the attacker-chosen path.
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 separates web page code (the content process) from more privileged code (the parent process) so that a hacked page cannot easily harm the whole system. This report shows that a message from the content process can tell the parent process to write files to any folder on the computer, without checking the path. If an attacker already controls the content process, they could use this to write files outside the sandbox.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.