Skip to content
Memory corruption Advisory Advanced CVE-2026-19145

Use after free in Translate (CVE-2026-19145)

A use-after-free in Chromium's TranslateAgent can be triggered when synchronous JavaScript execution allows a nested message loop to process a frame deletion IPC, destroying the object while its methods are still on the call stack. An attacker could potentially reclaim the freed memory and hijack the vtable to achieve remote code execution in the renderer.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 59 days

Flapjack, an experimental security project, has identified the following potential security issue. If you're a feature owner CC-ed on this bug, please do your best to review these reports. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.

Overview: A potential Use-After-Free in TranslateAgent can be triggered when synchronous JavaScript execution allows a nested message loop to process frame detachment IPCs. This results in the destruction of TranslateAgent while its methods are still on the call stack. The vulnerability bypasses MiraclePtr because all tracking raw_ptrs are destroyed before the memory is accessed, leading to potential Remote Code Execution in the renderer.

Affected files:

  • components/translate/content/renderer/translate_agent.cc

Estimated timestamp from git blame: Unknown (Google3 checkout)

Description

A potential Use-After-Free (UAF) vulnerability exists in TranslateAgent within the Chromium renderer process. TranslateAgent is a content::RenderFrameObserver that manages page translation. It initiates translation by calling synchronous JavaScript execution APIs (e.g., ExecuteScriptAndGetBoolResult).

When TranslateAgent::TranslatePageImpl calls StartTranslation(), it synchronously executes the Google Translate JavaScript. This script modifies the DOM (e.g., appending stylesheets or altering text nodes). In Blink, DOM modifications synchronously flush the custom element reaction stack. If an attacker controls a custom element affected by these modifications, their connectedCallback is executed synchronously while the ExecuteScript call is still on the stack.

Inside this callback, an attacker can trigger a synchronous Mojo IPC, such as alert() or confirm(). These map to [Sync] mojom calls (e.g., RunModalAlertDialog), which spin up a nested message loop to wait for the browser process's reply. Crucially, this nested loop continues to process incoming IPC messages on the same associated interface group to prevent deadlocks.

If the attacker simultaneously triggers the frame to close from another window, the browser process sends a mojom::Frame::Delete IPC to the renderer. The nested message loop processes this IPC, invoking RenderFrameImpl::FrameDetached, which initiates frame teardown and calls delete this on the RenderFrameImpl.

During destruction, RenderFrameImpl iterates through its observers. ChromeRenderFrameObserver is destroyed first, destroying its raw_ptr<TranslateAgent>. Then, TranslateAgent::OnDestruct() is called, which calls delete this and removes itself from the RenderFrameImpl's ObserverList (which also uses raw_ptr internally).

Because all raw_ptr references to the TranslateAgent are destroyed, MiraclePtr's (BackupRefPtr) reference count drops to 0. The memory is fully released to PartitionAlloc without entering quarantine. The attacker can then reclaim this memory using JavaScript ArrayBuffer allocations.

When the alert() dialog is dismissed, the nested loop unwinds, and ExecuteScriptAndGetBoolResult returns false. Execution resumes in TranslatePageImpl on the freed, attacker-controlled this pointer:

C++
  if (!StartTranslation()) {
    CheckTranslateStatus(); // UAF on 'this'
    return;
  }

CheckTranslateStatus() calls HasTranslationFailed(), which executes ExecuteScriptAndGetBoolResult. This method attempts to access render_frame_ (now controlled by the attacker) and calls the pure virtual method GetWebFrame() on it. This results in a deterministic vtable hijack and potential Remote Code Execution (RCE).

Suggested Steps to Reproduce (Potential)

Note: Our tooling agent does not yet have the ability to run code, so these are theoretical steps based on source code analysis.

  1. Host a malicious web page containing an iframe.
  2. Inside the iframe, register a Custom Element (e.g., <attack-element>) with a connectedCallback.
  3. Set the iframe's language to trigger automatic translation.
  4. When translation begins, the Google Translate script will alter the DOM, synchronously triggering the <attack-element>'s connectedCallback.
  5. Inside the callback, call alert() to spin a nested message loop.
  6. From the parent window (or a Web Worker), navigate or close the iframe, prompting the browser to send a frame deletion IPC.
  7. The renderer's nested loop processes the deletion IPC, destroying the frame and the TranslateAgent, fully freeing its memory.
  8. From the parent window/Worker, rapidly allocate ArrayBuffers of the same size as TranslateAgent to reclaim the memory and fake a vtable.
  9. Dismiss the alert() dialog. The execution unwinds, hits the UAF, and dereferences the fake vtable, executing attacker code.

Suggested Fix

TranslateAgent lacks survival checks after returning from synchronous JavaScript execution. The class should utilize base::WeakPtr to check if it has been destroyed during script execution.

For example, in TranslatePageImpl:

C++
void TranslateAgent::TranslatePageImpl(int count) {
  base::WeakPtr<TranslateAgent> weak_this = weak_method_factory_.GetWeakPtr();
  // ...
  if (!StartTranslation()) {
    if (!weak_this) return; // Check if destroyed during script execution
    CheckTranslateStatus();
    return;
  }
  // ...
}

Similar checks should be applied after any call to ExecuteScript or its variants.

Evaluated with Chrome root at commit: 2155cb00003ec35716a76ed3246eae995f87b7ff


Results so far have been promising, but there can be wrong deductions. Feel free to adjust as follows:

  • If you are familiar with the severity guidelines, you may adjust the severity.
  • If this is a false positive, and there's no work to be done, please close as WAI.
  • If there is work to do here but not a vulnerability, please change the issue type to Task/Bug/FR.

Data from false positives will be used to improve accuracy over time. And please feel free to reach out to me directly if you have concerns or feedback on the project.

The original report as published on the Chromium issue tracker. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

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, TranslateAgent does not check whether it has been destroyed after returning from synchronous JavaScript execution, so it calls methods on a freed object.

Impact

An attacker could potentially achieve remote code execution in the renderer, though the report notes the steps are theoretical and based on source code analysis.

What the attacker needed

Victim visits a malicious page; automatic translation is triggered; attacker can close the iframe

The fix

The class should use base::WeakPtr to check whether it has been destroyed after any synchronous script execution.

How it was found

  1. Host a malicious web page containing an iframe.
  2. Inside the iframe, register a Custom Element with a connectedCallback.
  3. Set the iframe's language to trigger automatic translation.
  4. When translation begins, the Google Translate script alters the DOM, synchronously triggering the connectedCallback.
  5. Inside the callback, call alert() to spin a nested message loop.
  6. From the parent window or a Web Worker, navigate or close the iframe, prompting the browser to send a frame deletion IPC.

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.

A use-after-free happens when a program frees some memory but then keeps using it, like deleting a file and then trying to open it. Here, a translation feature runs JavaScript that can trigger a pop-up dialog, and while that dialog is open, the page can be closed, causing the translation object to be deleted. When the dialog is dismissed, the code tries to use the deleted object, and an attacker who has filled that memory with their own data could take control of the program.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.