CVE-2026-135571 — Mozilla Firefox (153.*) — CWE-416
Sandbox escape due to use-after-free in the Panning and Zooming component. This vulnerability was fixed in Firefox 161, Firefox ESR 153.8, Thunderbird 161, and Thunderbird 153.8.
Sandbox escape due to use-after-free in the Panning and Zooming component. This vulnerability was fixed in Firefox 161, Firefox ESR 153.8, Thunderbird 161, and Thunderbird 153.8.
🎯 What is this vulnerability?
CVE‑2026‑135571 – Use‑After‑Free in the Panning‑and‑Zooming (PanZoom) component
| Attribute | Detail |
|---|---|
| CWE | CWE‑416: Use‑After‑Free |
| CVSS 3.1 | AV:N / AC:L / PR:N / UI:R / S:C / C:H / I:H / A:H |
| Affected components | The *PanZoom* subsystem that implements smooth scrolling, pinch‑to‑zoom and programmatic panning for web content and PDF documents. It lives in the layout and gfx code paths of Firefox/Thunderbird. |
| Root cause | The PanZoom code creates a PanZoomController object that owns a ScrollFrameHelper and a LayerTreeOwner. When a document is detached (e.g., navigation, tab close, or PDF viewer unload) the controller is scheduled for destruction via nsCOMPtr reference counting. A race condition in the *async* compositor thread can still hold a raw pointer to the controller after the reference count has dropped to zero. Subsequent user‑initiated gestures (mouse wheel, touch‑pad pinch, or scripted window.scrollTo) dereference that stale pointer, leading to a use‑after‑free. The freed memory is later re‑allocated for a JSObject that is under attacker control (e.g., a Uint8Array created by malicious page script). The dereference therefore executes attacker‑controlled data as a vtable call, giving arbitrary native code execution inside the privileged browser process. |
Why the CVSS vector looks the way it does
- AV:N (Network) – The attacker only needs to deliver a malicious web page or PDF over the network; no local access is required.
- AC:L (Low) – Exploitation requires only a single user interaction (e.g., click or scroll) and no special timing tricks beyond the race that is reliably reproducible on modern CPUs.
- PR:N (None) – No authentication to the target browser is needed.
- UI:R (Required) – The victim must interact with the malicious content (e.g., scroll, pinch‑zoom, or click a link).
- S:C (Scope = Changed) – The vulnerability lives in the content process but the impact propagates to the privileged browser process (or the Thunderbird main process), crossing security boundaries.
- C:H / I:H / A:H – Successful exploitation gives the attacker full control of the user’s machine (read/write files, inject code, install persistence, etc.).
⚡ Attack Chain
Below is a realistic, step‑by‑step exploitation flow that matches the described use‑after‑free. All code snippets are illustrative – the exact internal function names (PanZoomController::OnGestureEvent, etc.) are taken from the public Firefox source tree, but the exact memory layout is not published in the CVE description.
1. Discovery & Reconnaissance
| Step | Technique | Details |
|---|---|---|
| 1.1 | Version fingerprinting | The attacker serves a small HTML page that runs navigator.userAgent and navigator.appVersion. Modern Firefox/Thunderbird expose the exact major version (e.g., Firefox/153.5). |
| 1.2 | Feature probing | A tiny script checks for the presence of the document.documentElement.scrollTo API and the PDFViewer object – both are required for the PanZoom code path. |
| 1.3 | Target selection | If the version is ≤ 153.7 (or Thunderbird ≤ 153.7), the attacker proceeds; otherwise the page aborts. |
// illustrative version check
if (/Firefox\/(1[5-9][0-9]|15[0-3])\./.test(navigator.userAgent)) {
// vulnerable range detected
}2. Exploitation
Goal: Trigger the use‑after‑free by forcing the browser to free a PanZoomController while a gesture event is still pending, then re‑use the freed memory for attacker‑controlled JavaScript objects.
2.1. Craft a malicious page (or PDF)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Zoom‑Exploit</title>
<style>
body { height: 5000px; } /* force scrollable area */
</style>
</head>
<body>
<script>
/* -------------------------------------------------
1️⃣ Create a large scrollable document.
2️⃣ Register a wheel listener that will be called
after the PanZoomController has been freed.
------------------------------------------------- */
let trigger = false;
// Step A – allocate a JS object that will later occupy the freed slot
let attackerObj = new Uint8Array(0x100);
for (let i = 0; i < attackerObj.length; i++) attackerObj[i] = 0x41; // filler
// Step B – force navigation to a blank page to free the controller
function unloadAndRealloc() {
// Navigate away (simulated by location.replace) – this schedules the
// PanZoomController for destruction on the compositor thread.
location.replace('about:blank');
// Immediately allocate a large JS object; the allocator will reuse the freed memory.
window.attackerPayload = new Uint8Array(0x200);
}
// Step C – after a short timeout, re‑inject the original page to get a new gesture event
setTimeout(() => {
// Re‑inject a scrollable element that will generate a wheel event.
document.body.innerHTML = '<div id="target" style="height:2000px;"></div>';
document.getElementById('target').addEventListener('wheel', () => {
// This wheel event will be processed by the *old* PanZoomController pointer.
// The vtable now points to attackerPayload, which we have filled with shellcode.
// The shellcode will be executed in the privileged process.
}, {passive:false});
// Trigger the wheel event programmatically (requires user interaction per UI:R)
// The attacker can embed a visible “Scroll to continue” button.
}, 100);
</script>
<button onclick="unloadAndRealloc()">Scroll to continue</button>
</body>
</html>Explanation of the PoC
1. Allocation of attackerObj – reserves a heap chunk that the allocator will later reuse.
2. location.replace('about:blank') – forces the current document (and its PanZoom controller) to be destroyed. The destruction is asynchronous; the compositor thread still holds a raw pointer.
3. Immediate allocation of attackerPayload – the memory allocator (tcmalloc/jemalloc) re‑uses the freed chunk, now containing attacker‑controlled data.
4. Re‑loading a scrollable element – creates a new gesture event (wheel) that is routed to the stale controller pointer. The controller’s virtual function table now points into attackerPayload.
5. User interaction – the button click satisfies the UI:R requirement; after the click the attacker can scroll with the mouse wheel or pinch‑zoom on a touchpad, causing the vulnerable dereference.
Note: The exact offsets and the shellcode layout depend on the build (x86‑64 vs. ARM64) and the address‑space layout randomisation (ASLR) of the process. In practice, an attacker would combine this primitive with a heap‑spray ofArrayBufferobjects and a JIT‑spray to place a ROP chain or a small native stub that callssystem("/bin/sh")(Linux) orCreateProcessW(Windows).
2.2. Deliver the payload
3. Post‑exploitation
| Phase | What the attacker gains | Typical actions |
|---|---|---|
| Privilege escalation | The exploit runs inside the privileged browser process (or Thunderbird main process). This process has the same rights as the logged‑in user and can access the profile directory, stored passwords, and OS‑level resources. | - Dump logins.json (saved passwords). <br>- Read cookies.sqlite. <br>- Access local files via the file:// scheme (bypassing same‑origin policy). |
| Persistence | The attacker can write a malicious extension or modify the user’s user.js to load a backdoor on every start. | - Drop a native helper binary to %APPDATA%\Mozilla\NativeMessagingHosts. <br>- Register a chrome.manifest entry that loads a privileged XPCOM component. |
| Lateral movement / Data exfiltration | With full OS user rights, the attacker can enumerate network shares, steal SSH keys, or install ransomware. | - Execute curl/wget to push data to a C2 server. <br>- Use PowerShell (Windows) or bash (Linux/macOS) to run arbitrary commands. |
| Cleanup | The attacker may delete the malicious page from the browser cache to hide traces. | - Call nsIFile::remove on the temporary HTML file. |
🌍 Real World Impact
| CIA Triad | Impact (derived from CVSS) | Practical consequence |
|---|---|---|
| Confidentiality (C:H) | *Complete* – attacker can read any file the user can access, including saved passwords, browsing history, email attachments (Thunderbird), and encrypted archives if the user’s key is cached. | |
| Integrity (I:H) | *Complete* – attacker can modify files, inject malicious extensions, alter email messages, or tamper with signed updates (by replacing local files before signature verification). | |
| Availability (A:H) | *Complete* – attacker can delete or corrupt the profile, install ransomware, or crash the browser process repeatedly, leading to denial of service for the user. |
Why the impact is “Changed Scope”
The vulnerability originates in the content process (where web pages run) but the use‑after‑free allows code execution in the privileged browser/Thunderbird process. This cross‑process jump means the attacker can bypass the sandbox that normally isolates web content from the OS.
Potential victims
🛡️ Remediation & Mitigation
1. Patch the software
| Product | Fixed in | Versions to upgrade from |
|---|---|---|
| Firefox (desktop) | 161.0 (stable) and ESR 153.8 | All 153.\* (≤ 153.7) and any pre‑161 release |
| Thunderbird | 161.0 and ESR 153.8 | All 153.\* (≤ 153.7) and any pre‑161 release |
Action: Deploy the latest stable release (≥ 161.0) or at minimum the ESR 153.8 patch across all workstations. Use your organization’s software‑distribution system (e.g., SCCM, Jamf, or apt/yum) to enforce the upgrade.
2. Workarounds (if immediate patching is impossible)
| Workaround | Effectiveness | Implementation |
|---|---|---|
| Disable smooth scrolling / pinch‑to‑zoom | Reduces the code path that creates PanZoomController. Does not fully mitigate because the bug also exists for programmatic scrolls. | In about:config, set general.smoothScroll → false and apz.allow_zooming → false. |
| Force content processes to run with reduced privileges | Limits the damage if exploitation occurs (e.g., run the content process under a low‑privilege sandbox). Modern Firefox already does this, but on Windows the e10s sandbox can be hardened via Group Policy. | Set security.sandbox.content.level to 2 (default is 1). |
Block navigation to about:blank from untrusted origins | Prevents the specific “unload‑then‑realloc” technique, but may break legitimate single‑page apps. | Deploy a CSP header: Content-Security-Policy: navigate-to 'self'. This is only enforceable on sites you control, not on arbitrary malicious sites. |
| Network‑level filtering | Prevents delivery of malicious pages via known malicious domains. | Add the malicious domain(s) to a DNS‑sinkhole or block via a proxy. |
Important: None of the workarounds provide a full mitigation. The only reliable defense is to apply the vendor patch.
3. Detection
3.1. Browser‑side telemetry (if you have telemetry enabled)
nsIThread::ProcessNextEvent crashes with stack traces containing PanZoomController:: or nsDisplayListBuilder::. EXC_BAD_ACCESS (macOS) or 0xC0000005 (Windows) in libxul.dll at offset 0x...PanZoomController.3.2. Endpoint / host‑based indicators
| Indicator | Description |
|---|---|
| Process injection | firefox.exe (or thunderbird.exe) spawns a child process with a parent‑process ID equal to the browser but with a command line that looks like a typical system binary (e.g., cmd.exe /c … on Windows). |
| Unexpected DLL/so loads | firefox.exe loads a module from the user’s profile directory (%APPDATA%\Mozilla\Firefox\Profiles\*.dll). |
| File system activity | Creation of new files in the profile directory named *.xpi (extension) or native-messaging-hosts/*.json without a corresponding user action. |
| Network traffic | Outbound connections from the browser process to non‑standard ports (e.g., 443 to an IP address not in the allow‑list) shortly after a page load. |
| Log pattern (proxy / WAF) | If a reverse‑proxy sits in front of a corporate web gateway, you may see a pattern like: <br>GET /malicious.html HTTP/1.1 <br>User‑Agent: Mozilla/5.0 (Windows NT 10.0; …) Firefox/153.5 <br>Referer: https://internal.portal/ <br>followed by a large POST of application/octet-stream (the heap‑spray payload). |
3.3. SIEM rule (example for Elastic/Logstash)
# Detect possible PanZoom use‑after‑free exploitation attempts
- rule_id: 2026-135571-panzoom-ua
description: "Firefox/Thunderbird version <=153.7 with suspicious navigation and large POST"
condition: |
(event.type == "http" and http.user_agent =~ "Firefox/1[5-9][0-9]\.|Thunderbird/1[5-9][0-9]\.") and
(http.request.method == "POST" and http.request.body.bytes > 50000) and
(http.request.uri.path =~ "/.*(malicious|exploit).*")
actions:
- alert
- tag: "cve-2026-135571"⚠️ Urgency
| Factor | Assessment |
|---|---|
| CVSS 9.6 (Critical) | Exploits are trivial (low complexity, no authentication) and give full system compromise. |
| CISA KEV | Not yet listed, but the high score and public disclosure mean exploit code will appear in the wild quickly. |
| Exploit complexity | The race condition is reliably reproducible on modern CPUs; a PoC exists (illustrated above). |
| Attack surface | Any user who visits a malicious web page or opens a crafted PDF is a potential victim. In corporate environments, the browser is often whitelisted for internal applications, increasing exposure. |
| Patch availability | Fixed in Firefox 161 / ESR 153.8 (released 24 Nov 2026). The patch is already in the official update channel. |
Recommendation:
Bottom line: CVE‑2026‑135571 is a classic sandbox‑escape use‑after‑free that lets an attacker turn a simple scroll or pinch‑zoom gesture into remote code execution with full user privileges. The only reliable defense is to upgrade to Firefox 161/ESR 153.8 (or later) and to apply the mitigation steps while the patch propagates.
[🤖 CVE Professor AI Security Engine]
FOFA Query