Object lifecycle issue in WebShare (CVE-2026-8517)
A race condition in the Windows Web Share API allows concurrent releases of a reference-counted object from different threads, causing a double-free in the browser process. This could potentially be exploited for sandbox escape and remote code execution.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 45 days
Project Fortify, an experimental security project, has identified the following potential security issue.
Overview: A race condition exists in the Windows Web Share API where OutputStreamWriteOperation incorrectly inherits from base::RefCounted instead of base::RefCountedThreadSafe. Concurrent releases across the Chrome IO thread and WinRT background threads can trigger a double-free in the browser process. This could potentially be leveraged for sandbox escape and Remote Code Execution.
Affected files:
chrome/browser/webshare/win/share_operation.cc
Estimated timestamp from git blame: 2020-10-28
Vulnerability Details
Initial logic and parameters for the Web Share API are validated. The IPC routing from the renderer to the browser process and the instantiation of OutputStreamWriteOperation proceed per standard Windows share mechanisms. The core architectural flaw lies in the class inheritance: OutputStreamWriteOperation (in chrome/browser/webshare/win/share_operation.cc) derives from the non-thread-safe base::RefCounted rather than base::RefCountedThreadSafe.
Standard processing applies during the cross-thread handoff between the Chrome IO thread (handling file blob writing) and the OS-managed WinRT background threads (handling the IStreamedFileDataRequestedHandler COM object).
Because base::RefCounted relies on a non-atomic uint32_t for its reference count, concurrent destruction of the scoped_refptr instances on the IO thread and the WinRT thread bypasses thread-safety. Both threads simultaneously execute the out-of-line ReleaseImpl(), non-atomically decrement the counter, and subsequently reload ref_count_ from memory. Both threads observe ref_count_ == 0 and independently execute the destructor, resulting in a double-free in the highly privileged browser process.
Because the frees occur on separate threads, PartitionAlloc routes the pointers into separate ThreadCaches, bypassing FreeList corruption detection and cleanly exposing the memory to overlapping allocations.
Potential Attacker Steps
(Note: These are suggested/potential steps, our tooling agent doesn't yet have the ability to run code.)
- Host a malicious page that constructs a file array and invokes
navigator.share(). - Standard UI interaction processing applied (user selects a share target).
- Exploit overlapping PartitionAlloc ThreadCaches resulting from the concurrent double-free to achieve type confusion on the reallocated object.
- Hijack control flow (e.g., via
writer_delegate_virtual calls) to achieve arbitrary code execution and a full sandbox escape.
Suggested Fix
In chrome/browser/webshare/win/share_operation.cc, update the class definition to use atomic reference counting:
class OutputStreamWriteOperation
: public base::RefCountedThreadSafe<OutputStreamWriteOperation> {
...
friend class base::RefCountedThreadSafe<OutputStreamWriteOperation>;
...
Evaluated with Chrome root at commit: a9cbf6e8b275fe4147435aa905f3b7f5a656f5f0
Results from so far have been promising, but there can be wrong deductions. If this proves to be a false positive, please close as WAI; 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.
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 the class OutputStreamWriteOperation uses a non-thread-safe reference count (base::RefCounted) instead of a thread-safe one, so concurrent releases from different threads can both delete the object.
Impact
This could potentially be leveraged for sandbox escape and remote code execution, though the report notes the steps are suggested and not yet executed.
What the attacker needed
Windows platform; Victim visits malicious page; Victim selects a share target
The fix
The class should be changed to use atomic reference counting via base::RefCountedThreadSafe.
How it was found
- Host a malicious page that constructs a file array and invokes navigator.share().
- The user selects a share target through standard UI interaction.
- Exploit overlapping PartitionAlloc ThreadCaches from the concurrent double-free to achieve type confusion on the reallocated object.
- Hijack control flow (e.g., via writer_delegate_ virtual calls) to achieve arbitrary code execution and a full sandbox escape.
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 reference count is like a tally of how many parts of a program are using an object; when the count reaches zero, the object is deleted. Here, two threads (independent paths of execution) can both see the count as zero at the same time and both try to delete the object, which is a double-free. This can corrupt memory and let an attacker run their own code.
What is Race condition?
Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.