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

Use after free in Digital Credentials (CVE-2026-13026)

A use-after-free vulnerability exists in the desktop implementation of the digital credentials safety interstitial, where a WebContents reference is used after it may have been destroyed during a modal dialog display. An attacker could potentially trigger a browser crash or memory corruption by causing the WebContents to be destroyed while the interstitial is being shown.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 21 days

Project Fortify, 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: DigitalIdentitySafetyInterstitialControllerDesktop::ShowInterstitialImpl takes a content::WebContents by reference and uses it again after calling ShowWebModal(). On macOS, exiting fullscreen synchronously during modal display can trigger a nested run loop that processes a tab close, leading to immediate destruction of the WebContents. Consequently, the subsequent call to Observe() dereferences a dangling WebContents& reference, triggering a Use-After-Free (UAF) in the browser process.

Affected files:

  • chrome/browser/ui/views/digital_credentials/digital_identity_safety_interstitial_controller_desktop.cc
  • chrome/browser/ui/views/digital_credentials/digital_identity_safety_interstitial_controller_desktop.h

Estimated timestamp from git blame: 2024-08-20

Detailed Writeup

Root Cause Analysis

A potential Use-After-Free (UAF) vulnerability exists in the desktop implementation of the digital credentials safety interstitial.

In DigitalIdentitySafetyInterstitialControllerDesktop::ShowInterstitialImpl (defined in chrome/browser/ui/views/digital_credentials/digital_identity_safety_interstitial_controller_desktop.cc), the content::WebContents object is taken by reference (content::WebContents& web_contents) and dereferenced again after ShowWebModal() returns, without any liveness verification:

C++
void DigitalIdentitySafetyInterstitialControllerDesktop::ShowInterstitialImpl(
    content::WebContents& web_contents,
    bool was_request_aborted) {
  ...
  dialog_widget_ = constrained_window::ShowWebModal(
      dialog_model_builder.Build(), &web_contents); // <--- Can synchronously destroy web_contents
  extensions::SecurityDialogTracker::GetInstance()->AddSecurityDialog(
      dialog_widget_);

  close_on_navigation_observer_ = std::make_unique<CloseOnNavigationObserver>();
  close_on_navigation_observer_->Observe(web_contents); // <--- UAF: web_contents may be dangling
}

Inside CloseOnNavigationObserver::Observe(), it immediately calls web_contents.GetWeakPtr() which performs a virtual call on the deleted WebContents instance:

C++
void DigitalIdentitySafetyInterstitialControllerDesktop::CloseOnNavigationObserver::Observe(
    content::WebContents& web_contents) {
  web_contents_ = web_contents.GetWeakPtr(); // <--- Virtual call via freed vtable
  ...
}

Synchronous Destruction Path

When ShowWebModal is called, it blocks the web contents interaction. If the tab is currently in HTML fullscreen mode (content::FullscreenMode::kContent), the browser forces it to exit fullscreen via web_contents->ExitFullscreen(true) to ensure that the interstitial dialog is shown with proper window decorations.

On macOS, exiting native fullscreen spins a synchronous AppKit nested message/event loop inside -[NSWindow toggleFullScreen:]. If a tab close or detach request is processed during this synchronous event spin, the WebContentsImpl is destroyed immediately. When control returns up the stack, constrained_window::ShowWebModalDialogViews passes its CHECK(weak_widget) because the views widget close is posted asynchronously, and ShowInterstitialImpl continues execution with a dangling web_contents reference.

Since this reference is held on the stack, it is not protected by MiraclePtr/BackupRefPtr.

Suggested/Potential Replay Steps

Note: These are potential steps. Our security review tools do not currently have the capability to execute proof-of-concept exploit code locally.

  1. On macOS, a script-opened tab (closable via script) is navigated to an attacker-controlled origin.
  2. The user initiates HTML fullscreen via a gesture (document.documentElement.requestFullscreen()).
  3. The user initiates a high-risk digital credentials request via a gesture, triggering the safety interstitial dialog path.
  4. While the macOS native fullscreen exit animation runs (which spins the nested run loop), a script-initiated close or detach event (window.close()) is processed.
  5. The WebContents is synchronously destroyed, leaving the web_contents reference in ShowInterstitialImpl dangling.
  6. The browser crashes or encounters a memory safety violation (UAF) upon executing Observe(web_contents).

Suggested Fix

To resolve this issue, verify the liveness of the WebContents before accessing it after the ShowWebModal call. The controller class already maintains a weak pointer to the WebContents (web_contents_), which is set inside ShowInterstitial:

C++
  if (!web_contents_) {
    return;
  }
  close_on_navigation_observer_ = std::make_unique<CloseOnNavigationObserver>();
  close_on_navigation_observer_->Observe(*web_contents_);

Evaluated with Chrome root at commit: 9ebf4302210513a012c901d87a2668b3aadf8cc1


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

Impact

The vulnerability could lead to a browser crash or memory corruption, potentially allowing an attacker to execute arbitrary code in the browser process.

What the attacker needed

MacOS; user gesture for fullscreen; user gesture for digital credentials request; script-opened tab

The fix

The issue should be fixed by verifying the liveness of the WebContents using a weak pointer before accessing it after the ShowWebModal call.

How it was found

  1. On macOS, a script-opened tab is navigated to an attacker-controlled origin.
  2. The user initiates HTML fullscreen via a gesture.
  3. The user initiates a high-risk digital credentials request via a gesture, triggering the safety interstitial dialog path.
  4. While the macOS native fullscreen exit animation runs, a script-initiated close or detach event is processed.
  5. The WebContents is synchronously destroyed, leaving the reference dangling.
  6. The browser crashes or encounters a memory safety violation upon executing Observe(web_contents).

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.

This report describes a memory safety bug in Chrome's browser process. When a special security dialog is shown, the code keeps a reference to the web page's internal object, but that object can be destroyed while the dialog is opening, so later use of the reference accesses freed memory. This can crash the browser or potentially allow an attacker to run malicious code.

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.