Van1338: Design Flaw in Riot Vanguard: $6,000
A design flaw in Riot Vanguard's use of object callbacks allowed an attacker to obtain a fully privileged handle to the protected Valorant process by repeatedly calling NtOpenProcess. The attacker could then perform operations on the process before Vanguard's periodic check stripped the handle.
BranchesTags
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
Riot Vanguard is the anti-cheat component that ships with Riot Games titles, and in this report the protected target is the Valorant client process. Vanguard protects user-mode processes with ObRegisterCallbacks, a standard Windows mechanism for auditing and modifying the access mask of process handles as they are opened. It pairs this with PsSetCreateProcessNotifyRoutineEx, which is commonly used alongside object callbacks to decide which processes need protection.
The report describes a design flaw in that combination: an arbitrary user could obtain a fully privileged process handle to the protected game process. The author also notes that the same bug is replicable on Easy Anti Cheat. Riot Games awarded a $6,000 bounty for the finding.
Setup
The write-up does not describe a lab setup, tooling versions or account requirements. The proof of concept is a user-mode routine that repeatedly opens a handle to the Valorant process, and the author refers to a PoC video in the repository. The only version mentioned is the Vanguard build that fixed the issue, [redacted].
Finding it
The starting observation is about timing during process creation on Windows. Creating a process is not a single atomic step: UAC prompts and intermediation by PCA (Program Compatibility Assistant) mean several procedures complete before the NtCreateUserProcess system call is reached. The author found that object callbacks can be invoked right before the process callbacks during that creation phase.
Why does that matter? The process that creates another one needs specific mandatory access masks, including PROCESS_VM_READ and PROCESS_VM_WRITE, so that it can perform covert PEB (Process Environment Block) patches. The author found that object callbacks can be invoked right before the process callbacks during the creation phase.
The crux of the bug was therefore straightforward: how quickly can NtOpenProcess be issued against the target?
Exploitation
Step 1: loop on the target process ID
The PoC repeatedly resolves the Valorant process ID and attempts to open a handle with full access, in a tight loop:
void poc()
{
for(;;)
{
auto valorant_pid = GetValorantProcessId();
OBJECT_ATTRIBUTES oa = {};
InitializeObjectAttributes(&oa, NULL, 0, NULL, NULL);
HANDLE handle;
CLIENT_ID cid = {};
cid.UniqueProcess = valorant_pid;
// Increase possibility: Direct to syscall to avoid redundant proxy calls in kernelbase.
NtOpenProcess(&handle, PROCESS_ALL_ACCESS, &oa, &cid);
// ... sanity checks ...
}
}
GetValorantProcessId() supplies the target PID, which is placed in CLIENT_ID.UniqueProcess. The call requests PROCESS_ALL_ACCESS, so any handle that survives the object callback carries every right the caller could want. The comment explains the choice of NtOpenProcess directly rather than a higher-level wrapper: going straight to the system call avoids redundant proxy calls in kernelbase, which shortens the path and raises the chance of landing inside the unprotected window. The sanity checks after the call are elided in the snippet.
Step 2: use the leaked handle before the periodic check
Vanguard does not ignore leaked handles. One of its resident system threads periodically inspects the handle table of every process in each session. Even a fully privileged handle, once acquired, is patched by Vanguard and its access mask is stripped through direct kernel object manipulation, in a manner analogous to the method used by KSystemInformer. The limitation is the interval: the gap between periodic checks was not short enough to preempt handle leaks, so the actor still had substantial time to carry out an operation with the leaked handle before it was neutered.
Root cause
The flaw is in the design of the callback combination: object callbacks can be invoked right before the process callbacks during process creation. The periodic handle-table sweep is a detection and remediation measure, not a prevention measure, and its interval leaves a usable window.
Impact
An arbitrary user could acquire a fully privileged process handle to the protected Valorant process, An arbitrary user could acquire a fully privileged process handle to the protected Valorant process. The window is bounded by Vanguard's periodic check, so the attacker has substantial but not unlimited time. The same technique is reported to work against Easy Anti Cheat.
Fix
The bug was patched in early Riot Vanguard [redacted]. The conceivable patch, as the author describes it, is to protect the process in an object callback instead of a process callback.
That fix came with complications. Because Windows process creation is complex, Valorant can no longer operate in compatibility mode. In addition, under specific environments, assigning process protection on object callbacks can render a process non-executable. The offender is svchost.exe (pcasvc.dll): the PCA component intermediates process creation with "Run this program as an administrator" and fails if some mandatory access masks have been stripped.
Bonus: image marker for Vanguard protection
The author also notes a special marker in the DOS header of protected process images. Vanguard scrutinises this marker and then performs embedded signature verification; if the signature belongs to Riot Games, Inc. the process is internally added to Vanguard's protected list.
Variants to test
The report says the same bug is replicable on Easy Anti Cheat. A positive result is a handle that survives the sanity checks and remains usable long enough to perform an operation on the target.
The report does not describe other variants.
What happened, in plain words
Riot Games makes a game called Valorant, and it ships with a piece of software called Riot Vanguard. Vanguard is an anti-cheat: it runs alongside the game and tries to stop people from cheating. One of the things it does is protect the game's process (the running copy of the game in memory) so that other programs cannot reach into it and tamper with it.
A security researcher, Kento Oki (@kento932376), found a design flaw in the way Vanguard does that protection. The flaw meant that an arbitrary user could acquire a fully privileged handle to the protected game process. A handle is a kind of permission slip that lets one program interact with another; a fully privileged one lets the holder do essentially anything to the target, including reading and writing its memory. Riot Games paid a $6,000 bounty for the finding, and the bug was fixed in an early build of Vanguard numbered [redacted].
The author also says the same bug can be reproduced against Easy Anti Cheat, another anti-cheat product used by other games.
This article walks through the report from the beginning, explaining each idea as it comes up. You do not need any security background to follow it: if you can use a browser and a computer, you can read this.
Background: what Vanguard is protecting, and how
Processes and handles
When you start a program, the operating system creates a process for it. A process is the running instance of a program: it has its own memory, its own threads of execution, and an identity (a process ID, or PID, a number the system uses to refer to it).
Programs often need to interact with other processes. Windows does not let them do that freely. Instead, a program asks the operating system to open a handle to the target process. A handle is a small reference that the system hands back, and it comes with an access mask: a set of permissions saying what the holder is allowed to do. For example, one permission might allow reading the target's memory, another might allow writing to it. The most permissive request is PROCESS_ALL_ACCESS, which asks for every right at once.
A useful comparison: a handle is like a visitor badge at an office. The badge says which doors you may open. The access mask is the list of doors printed on the badge. PROCESS_ALL_ACCESS is a badge that opens every door in the building.
Object callbacks and process callbacks
Windows gives security software a way to watch these handle requests. It is called ObRegisterCallbacks. When any program asks to open a handle to a process, the system runs the registered callback first, and that callback can inspect the request and change the access mask before the handle is actually granted. In the office comparison, it is a security guard standing at the door who can cross doors off your badge before you get it.
There is a second mechanism, PsSetCreateProcessNotifyRoutineEx, which lets software be told when a new process is created. Anti-cheat products commonly use the two together: the process callback tells them a new process has appeared, and the object callback lets them police handle requests to it.
An API (Application Programming Interface) is simply a defined way for one piece of software to ask another to do something. ObRegisterCallbacks and PsSetCreateProcessNotifyRoutineEx are both Windows APIs: documented functions that software can call to register its interest in these events.
The design flaw
The report's central observation is about timing. Creating a process on Windows is not one single instant. Several steps happen first: for example, the User Account Control (UAC) prompt that asks whether you really want to run something as administrator, and the Program Compatibility Assistant (PCA), a Windows component that steps in when a program seems to need special compatibility handling. Only after all of that does the system reach the actual system call that creates the process, NtCreateUserProcess.
The author found that during this sequence, the object callbacks (the guard at the door) can run before the process callbacks (the notification that a new process exists). That ordering is the flaw. The author found that object callbacks can run before the process callbacks during process creation, and that this ordering is the flaw.
Why would an attacker want those permissions in the first place? The report explains that the process which creates another one needs specific mandatory access masks, including PROCESS_VM_READ and PROCESS_VM_WRITE, so that it can perform covert PEB patches. The PEB (Process Environment Block) is a data structure inside every Windows process that holds information about that process; patching it means modifying that information, which is one way to influence how a program behaves. Reading and writing another process's memory is exactly what cheating tools want to do, and exactly what an anti-cheat wants to prevent.
So the whole bug comes down to one practical question: how quickly can the attacker issue the request to open the handle, NtOpenProcess, against the target?
The proof of concept
The report includes a short proof of concept (PoC), a small program that demonstrates the bug. It is written in C, a common programming language for this kind of low-level work. Here it is exactly as published:
void poc()
{
for(;;)
{
auto valorant_pid = GetValorantProcessId();
OBJECT_ATTRIBUTES oa = {};
InitializeObjectAttributes(&oa, NULL, 0, NULL, NULL);
HANDLE handle;
CLIENT_ID cid = {};
cid.UniqueProcess = valorant_pid;
// Increase possibility: Direct to syscall to avoid redundant proxy calls in kernelbase.
NtOpenProcess(&handle, PROCESS_ALL_ACCESS, &oa, &cid);
// ... sanity checks ...
}
}
Line by line, in plain words:
void poc()declares a function calledpoc(short for proof of concept).voidmeans it does not return a value.for(;;)is an infinite loop: the code inside the braces repeats forever, as fast as the computer can manage. The point is to try the operation over and over, because the attacker only needs to succeed once, during the brief unprotected window.auto valorant_pid = GetValorantProcessId();asks a helper function for the process ID of the running Valorant game and stores it in a variable calledvalorant_pid. The helper itself is not shown in the report.OBJECT_ATTRIBUTES oa = {};creates a small structure (a bundle of related values) that Windows expects when you open an object. The= {}part sets it to all zeros to start with.InitializeObjectAttributes(&oa, NULL, 0, NULL, NULL);fills that structure in with default values. The&means "the address of", so the function can modify the structure in place. PassingNULLfor the name means the target is identified by process ID rather than by a name.HANDLE handle;declares a variable to receive the handle that Windows will hand back.CLIENT_ID cid = {};creates another structure, this one used to say which process you are interested in.cid.UniqueProcess = valorant_pid;puts the Valorant process ID into that structure, so the request is aimed at the game.- The comment
// Increase possibility: Direct to syscall to avoid redundant proxy calls in kernelbase.explains a deliberate choice. A system call (syscall) is the lowest-level way a program asks the operating system kernel to do something. Normally a program calls a friendlier wrapper function, which does some extra work and then makes the system call. Here the author skips the wrapper and callsNtOpenProcessdirectly, because fewer steps means less time spent, and less time spent means a better chance of landing inside the unprotected window. NtOpenProcess(&handle, PROCESS_ALL_ACCESS, &oa, &cid);is the actual attempt: open a handle to the process identified incid, asking forPROCESS_ALL_ACCESS, with the attributes inoa, and store the result inhandle.- The comment
// ... sanity checks ...marks where the author would check whether the handle is valid and has the rights wanted. Those checks are left out of the snippet.
Because the loop runs continuously, the program is effectively hammering on the door, hoping that one of its attempts slips through in the moment before Vanguard's protection takes effect.
Vanguard's periodic check
Vanguard does not simply ignore a handle that slips through. The report explains that one of Vanguard's resident system threads periodically inspects the handle table of every process in each session. A thread is a unit of execution inside a process; a resident thread is one that stays running in the background. The handle table is the system's record of every handle a process currently holds.
When Vanguard finds a fully privileged handle to a protected process, it patches it: it strips the access mask through direct kernel object manipulation. In plain terms, it reaches into the operating system's own records and crosses the doors off the badge after the fact. The report compares this to the method used by KSystemInformer, a system-information tool.
This is a detection and clean-up measure, not a prevention measure. The problem is the interval between checks. The report states that the gap was not short enough to preempt handle leaks, so the attacker still had substantial time to carry out an operation with the leaked handle before it was neutered. In the office comparison: the guard does not stop you at the door, but walks the corridors every so often and confiscates badges that should not exist. If you can get through a door before the next patrol, you still get to use the room for a while.
The fix, and the pain it caused
The bug was patched in early Riot Vanguard [redacted]. The report describes the conceivable patch as protecting the process in an object callback instead of a process callback.
That fix came with complications. Because Windows process creation is complex, Valorant can no longer operate in compatibility mode. Compatibility mode is a Windows feature that lets older or awkward programs run by pretending to be on an older version of Windows or by adjusting how they are launched.
There is a second complication. Under specific environments, assigning process protection on object callbacks can render a process non-executable, meaning it cannot start at all. The report names the offender as svchost.exe (pcasvc.dll). svchost.exe is a generic Windows host process that runs many system services, and pcasvc.dll is the module implementing the Program Compatibility Assistant. The PCA component intermediates process creation with the option "Run this program as an administrator", and it fails if some mandatory access masks have been stripped. The PCA component intermediates process creation with "Run this program as an administrator" and will fail if some mandatory access masks were stripped.
Bonus: the image marker
The report ends with an extra observation. Protected process images carry a special marker in their DOS header. The DOS header is a small structure at the very start of every Windows executable file; it is a leftover from the days of MS-DOS, and Windows still expects it to be there. Vanguard scrutinises this marker and then performs embedded signature verification. A digital signature is a cryptographic stamp that proves who produced a file and that it has not been altered. If the signature belongs to Riot Games, Inc. the process is internally added to Vanguard's protected list.
In everyday terms: Vanguard checks for a particular stamp on the envelope, then verifies the signature underneath it, and only then treats the letter as official.
Glossary
- Access mask: the set of permissions attached to a handle, saying what the holder may do with the target.
- API (Application Programming Interface): a defined way for one piece of software to ask another to do something; here, documented Windows functions that software can call.
- Bounty: a reward paid by a company to someone who reports a security problem to it.
- Callback: a function that software registers with the operating system so that it is run automatically when a particular event happens.
- Compatibility mode: a Windows feature that adjusts how a program is launched so that older or awkward programs can run.
- Digital signature: a cryptographic stamp proving who produced a file and that it has not been altered.
- DOS header: a small structure at the start of every Windows executable file, a leftover from MS-DOS that Windows still expects.
- Easy Anti Cheat: another anti-cheat product, used by games other than Valorant, which the report says is also affected.
- Handle: a reference handed out by the operating system that lets one program interact with another object, such as a process.
- Handle table: the system's record of every handle a process currently holds.
- Kernel: the core of the operating system, which manages memory, processes and hardware on behalf of programs.
- KSystemInformer: a system-information tool whose method of stripping access masks the report compares Vanguard's clean-up to.
NtCreateUserProcess: the Windows system call that actually creates a process.NtOpenProcess: the Windows system call that opens a handle to an existing process.ObRegisterCallbacks: the Windows API that lets software register a callback which runs when a handle is opened, and can modify the requested access mask.- Object callback: a callback registered through
ObRegisterCallbacks, which runs when a handle to an object is requested. - PCA (Program Compatibility Assistant): a Windows component that steps in when a program seems to need special compatibility handling, including the "Run this program as an administrator" option.
- PEB (Process Environment Block): a data structure inside every Windows process holding information about that process; patching it means modifying that information.
- PID (process ID): the number the operating system uses to identify a running process.
- PoC (proof of concept): a small program or demonstration showing that a security problem is real.
- Process: the running instance of a program, with its own memory, threads and identity.
- Process callback: a callback registered through
PsSetCreateProcessNotifyRoutineEx, which runs when a process is created. PROCESS_ALL_ACCESS: the access mask that requests every possible right over a process.PROCESS_VM_READ/PROCESS_VM_WRITE: access mask rights that allow reading from and writing to another process's memory.PsSetCreateProcessNotifyRoutineEx: the Windows API that lets software register a callback which runs when a process is created.- Resident thread: a thread that stays running in the background inside a process.
- Riot Vanguard: the anti-cheat software that ships with Riot Games titles such as Valorant.
svchost.exe: a generic Windows host process that runs many system services.- System call (syscall): the lowest-level way a program asks the operating system kernel to do something.
- Thread: a unit of execution inside a process.
- UAC (User Account Control): the Windows prompt that asks whether you really want to run something with administrator rights.
- Valorant: the Riot Games title whose client process is the protected target in this report.