1-click Remote Code Execution via Twitch Embed
Originally disclosed on Bugcrowd
- Accepted in 30 hours
- Fixed in 48 days
- Disclosed after 48 days
Summary by JayTaelien
attacker page
-> Discord Twitch rich embed
-> Twitch force_manifest_node parser gap
-> inline HLS master to attacker media playlist, which lets you set a custom stitched-ad OMID verifier script (this gets JS execution)
-> inherited-origin Discord popout
-> V8 RegExp UAF to stable compressed-cage read/write
-> Response(128) native-pointer leak, JSPI stack-control primitive, native ROP
-> barriered Electron IPC-wrapper export (proof via the Calculator launch step)
-> detached main-process WebDAV file-dialog activation to Windows WebClient demand-start
-> Discord clip-file TOCTOU to updater .exe control
-> cmd.exe /d /k echo success
IPC calls used in order for sandbox escape in TOCTOU:
DISCORD_APP_GET_PATHDISCORD_FILE_MANAGER_SHOW_OPEN_DIALOGDISCORD_DEBUG_STASH_CLIP_DECIDER_DATADISCORD_FILE_MANAGER_CREATE_DIRECTORY_IF_NOT_EXISTSDISCORD_DEBUG_STASH_CLIP_DECIDER_DATA(again)DISCORD_MOVE_CLIP+DISCORD_DEBUG_STASH_CLIP_DECIDER_DATA(concurrent)DISCORD_UPDATE_CLIP_METADATADISCORD_DEBUG_STASH_CLIP_DECIDER_DATADISCORD_DELETE_CLIPDISCORD_NATIVE_MODULES_FINISH_UPDATER_BOOTSTRAP
Context
The target is the Discord desktop application, listed in the program data as "Web & Desktop App". The report describes a chain that starts in a web page controlled by the attacker and ends in a shell on the victim's Windows machine, launched through the Electron client. The entry point is the Twitch rich embed that Discord renders: the embed parses Twitch media metadata, and the report identifies a parser gap around the force_manifest_node field that lets an attacker influence the HLS master playlist the embed consumes.
The chain then moves through the Discord popout window, a V8 regular-expression use-after-free, a native-pointer leak, a JSPI stack-control primitive, native ROP, an Electron IPC-wrapper export, a WebDAV file-dialog activation, a clip-file TOCTOU against the updater, and finally a command shell. The report's summary presents the whole path as a single sequence; each stage is a precondition for the next.
Setup
The report does not describe the accounts, roles, tools or exact versions used. What it does establish as preconditions, from the chain itself:
- The victim runs the Discord desktop client on Windows, since the final stages depend on Windows WebClient demand-start and on the updater
.exe. - The attacker can cause the client to render a Twitch rich embed, starting from an attacker-controlled page.
- The attacker hosts an HLS master playlist and a media playlist, and can set a stitched-ad OMID verifier script in the latter.
- The client build is vulnerable to the V8 RegExp use-after-free described, and exposes the JSPI and IPC surfaces the chain relies on.
No endpoint, header, version number or account detail beyond this appears in the report.
Finding it
The researcher's summary lists a gap in the Twitch embed's parsing of force_manifest_node as the first stage of the chain. Because the embed follows the manifest the field points at, an attacker who controls the manifest can supply an inline HLS master playlist that references an attacker media playlist. The media playlist allows a custom stitched-ad OMID verifier script to be set, and that script is executed as JavaScript. The report treats this as the first code-execution primitive, running inside the embed's context.
The chain then uses a Discord popout window that inherits the origin of the embedding context, so the JavaScript obtained in the embed is not confined to the embed. That inherited-origin popout is the bridge from the Twitch parser gap into Discord's own renderer.
Exploitation
Step 1: Attacker page to Twitch rich embed
The chain begins on an attacker-controlled page and moves to a Discord Twitch rich embed. The report does not include the page markup or the link used. The embed is the component that performs the Twitch manifest fetch and parse.
Step 2: force_manifest_node parser gap
The Twitch embed parses force_manifest_node, and the parser gap lets the attacker direct the embed to an inline HLS master playlist under attacker control. The report gives no request or response for this step; the summary states only the field and the outcome.
Step 3: Inline HLS master to attacker media playlist with a custom OMID verifier
The attacker's master playlist points at an attacker media playlist. In that media playlist the attacker sets a custom stitched-ad OMID verifier script. The report states that this yields JavaScript execution. The playlist contents are not reproduced in the report.
Step 4: Inherited-origin Discord popout
The JavaScript runs in a Discord popout window that inherits the origin of the embedding context. This is what turns the embed-level execution into execution in a Discord origin, which the later stages require.
Step 5: V8 RegExp use-after-free to compressed-cage read/write
Inside the renderer the researcher uses a V8 RegExp use-after-free and turns it into stable read and write within the compressed cage. The report names the primitive but does not include the trigger, the regular expression, or the heap layout.
Step 6: Response(128) leak, JSPI stack control, native ROP
A Response(128) is used to leak a native pointer. The researcher then uses a JSPI stack-control primitive and builds a native ROP chain. The report does not give the leaked value, the ROP gadgets, or the JSPI calls.
Step 7: Barriered Electron IPC-wrapper export
The ROP chain reaches a barriered Electron IPC-wrapper export. The report gives the Calculator launch step as proof that this export was reached and used. The specific wrapper and the barrier are not named beyond this description.
Step 8: Detached main-process WebDAV file-dialog activation
From the main process the chain activates a detached WebDAV file dialog, which triggers Windows WebClient demand-start. The report does not include the dialog path or the WebDAV URL.
Step 9: Clip-file TOCTOU to updater .exe control
A time-of-check to time-of-use condition on a Discord clip file is used to gain control of the updater .exe.
Step 10: Command execution
The chain ends with:
cmd.exe /d /k echo success
This is the proof command: cmd.exe is started with /d to skip AutoRun commands and /k to keep the window open after running echo success.
IPC calls used in order for the sandbox escape in the TOCTOU
The report lists the IPC calls in the order they are used:
DISCORD_APP_GET_PATHDISCORD_FILE_MANAGER_SHOW_OPEN_DIALOGDISCORD_DEBUG_STASH_CLIP_DECIDER_DATADISCORD_FILE_MANAGER_CREATE_DIRECTORY_IF_NOT_EXISTSDISCORD_DEBUG_STASH_CLIP_DECIDER_DATA(again)DISCORD_MOVE_CLIP+DISCORD_DEBUG_STASH_CLIP_DECIDER_DATA(concurrent)DISCORD_UPDATE_CLIP_METADATADISCORD_DEBUG_STASH_CLIP_DECIDER_DATADISCORD_DELETE_CLIPDISCORD_NATIVE_MODULES_FINISH_UPDATER_BOOTSTRAP
The report gives no arguments, return values or responses for any of these calls. What the sequence shows is the shape of the TOCTOU: the clip decider data is stashed repeatedly around file-manager and clip operations, moved concurrently with a stash, and the sequence ends by finishing the updater bootstrap, which is where the updater .exe comes under attacker control.
Root cause
The report identifies the initial mistake as a parser gap in the Twitch embed's handling of force_manifest_node, which allows an attacker-supplied inline HLS master playlist to be followed to an attacker media playlist. The media playlist's stitched-ad OMID verifier script is then executed, giving JavaScript execution in the embed. The inherited-origin popout means that execution is not isolated from Discord's own origin, so the renderer-level exploitation that follows is reachable.
On the client side, the report points to the V8 RegExp use-after-free as the memory-corruption bug, and to the IPC surface around clip handling and the updater bootstrap as the sandbox-escape path. The repeated stashing of clip decider data around file operations, and the concurrent move plus stash, are what create the TOCTOU window on the clip file that leads to updater .exe control.
Why existing defences did not stop the chain is only implied: the embed's manifest handling accepted the attacker's playlist, the popout inherited the origin, and the IPC calls in the listed order were accepted by the main process.
Impact
Under the conditions above, an attacker who can get a Twitch link rendered as a rich embed in front of a Windows Discord desktop user can chain the parser gap, renderer exploitation and IPC sequence to run a command through cmd.exe on the victim's machine. The chain ends with the command cmd.exe /d /k echo success. The program rated the report critical and paid a bounty of 5,500 USD.
Fix
The defects it identifies are the force_manifest_node parsing in the Twitch embed, the inherited-origin popout, the V8 RegExp use-after-free, and the clip/updater IPC sequence. Which of these were patched, and how, is not described.
Variants to test
- Other rich embeds that fetch and parse media manifests: look for fields that select a manifest node or playlist URL, and check whether an attacker-supplied inline master playlist is followed. A positive result is the embed loading an attacker media playlist.
- Stitched-ad or OMID verifier script fields in media playlists: check whether a custom verifier script is executed. A positive result is JavaScript running in the embed context.
- Popout or detached windows opened from embeds: check whether they inherit the embedding origin. A positive result is script from the embed reaching the host application's origin.
- V8 RegExp use-after-free patterns: check whether a crafted regular expression produces a stable read/write primitive in the compressed cage. A positive result is reliable read and write without a crash.
Responseobjects used for pointer leaks: check whether aResponse(128)or similar exposes a native pointer. A positive result is a stable leak usable for ROP.- Electron IPC wrappers with barriers: check whether a barriered wrapper export can be reached from the renderer. A positive result is a native action such as launching Calculator.
- WebDAV file dialogs in the main process: check whether a detached dialog triggers Windows WebClient demand-start. A positive result is an outbound WebDAV request from the client.
- Clip-file handling around the updater: check whether stashing clip decider data around file operations, including a concurrent move and stash, opens a TOCTOU window on the updater
.exe. A positive result is control of the updater binary.
Hunting notes
This kind of bug tends to hide where a chat or social client renders third-party rich embeds and follows manifest or playlist URLs from them, and where popout windows inherit the embedding origin. The signals during recon are embed fields that select a manifest node, media playlists that accept custom verifier scripts, and popout windows that keep the host origin. On the client side, the signals are IPC handlers around file dialogs, clip files and updater bootstrap, especially where the same state is stashed repeatedly around file operations. The researcher showed impact by carrying the chain all the way to cmd.exe /d /k echo success and by listing the IPC calls in the order used for the sandbox escape.
What happened, in plain words
A security researcher found a way to make the Discord desktop application on Windows run a command of their choosing, starting from an attacker-controlled page and a Twitch rich embed. The report was submitted to Bugcrowd, rated critical, and paid a bounty of 5,500 USD.
The path is long, and each stage depends on the one before it. In short: a web page the attacker controls causes Discord to show a Twitch link as a rich embed (the little preview card with a video). That embed reads a media description file from Twitch, and a gap in how it reads one particular field lets the attacker swap in their own media description. That description can carry a small script, and the script runs as JavaScript. The script then reaches a Discord popout window that shares the same origin, so the attacker now has code running in Discord's own context. From there the researcher used a memory bug in V8 (the JavaScript engine inside Discord), leaked a memory address, built a chain of native instructions, reached an internal Electron function, opened a file dialog that talks to a WebDAV server, and finally abused a timing problem with clip files to take control of the updater program. The proof is a command prompt running echo success.
Below, each step is explained from scratch, in the same order as the technical description, with the same commands and the same list of internal calls.
Context
The target is the Discord desktop application. The program data lists the asset as "Web & Desktop App". Discord's desktop app is built with Electron, a framework that lets a company write a desktop program using web technology: HTML, CSS and JavaScript, displayed by the same engine a browser uses. That matters here, because many of the bugs in this chain are web-engine bugs, not classic Windows program bugs.
The chain starts on a web page the attacker controls and ends in a shell (a command prompt) on the victim's Windows machine. The entry point is the Twitch rich embed. Discord draws a preview card, called an embed, for a Twitch link. For Twitch, that card can include a video player, and the player needs a description of where the video stream lives. That description is called a manifest.
The report identifies a gap in how the embed parses a field called force_manifest_node. Because of that gap, an attacker can influence which manifest the embed consumes. The manifest format used here is HLS (HTTP Live Streaming), which describes a stream in two layers: a master playlist that lists variant streams, and media playlists that list the actual chunks of video. If an attacker can supply their own master playlist, they can point it at their own media playlist.
After that, the chain moves through the Discord popout window, a V8 regular-expression use-after-free, a native-pointer leak, a JSPI stack-control primitive, native ROP, an Electron IPC-wrapper export, a WebDAV file-dialog activation, a clip-file TOCTOU against the updater, and finally a command shell. The report presents the whole path as a single sequence, and each stage is a precondition for the next: if any one stage fails, the later ones cannot happen.
Setup
The report does not describe the accounts, roles, tools or exact versions used. What it does establish as preconditions, from the chain itself:
- The victim runs the Discord desktop client on Windows, because the final stages depend on Windows WebClient demand-start and on the updater
.exe. - The attacker can cause the client to render a Twitch rich embed, starting from an attacker-controlled page.
- The attacker hosts an HLS master playlist and a media playlist, and can set a stitched-ad OMID verifier script in the latter.
- The client build is vulnerable to the V8 RegExp use-after-free described, and exposes the JSPI and IPC surfaces the chain relies on.
A few of those terms deserve a plain explanation before we go further.
- Rich embed: the preview card a chat app draws for a link. To draw it, the app fetches data from the linked site and renders it. That means the linked site, or something pretending to be it, gets to influence what the app processes.
- HLS master playlist and media playlist: a master playlist is like a table of contents that says which versions of a stream exist; a media playlist is like the list of pages, naming the actual video chunks. If you control the table of contents, you control which pages get read.
- Stitched-ad OMID verifier script: in video advertising, OMID is a standard for measuring whether an ad was actually seen. A stitched ad is an ad inserted into the stream itself. A verifier script is a piece of JavaScript used to check the measurement. If a media playlist can name a verifier script, and the player runs it, then whoever writes the playlist gets to run JavaScript.
- WebClient demand-start: Windows has a built-in feature that can open files over WebDAV, a way of exposing files over HTTP. When something asks for a WebDAV path, Windows starts the WebClient service on demand. That gives an attacker a way to make the machine talk to a server they control.
- Updater
.exe: the program Discord uses to update itself. If an attacker can control that file, they can control what gets run.
No endpoint, header, version number or account detail beyond this appears in the report.
Finding it
The researcher's summary lists a gap in the Twitch embed's parsing of force_manifest_node as the first stage of the chain. Because the embed follows the manifest the field points at, an attacker who controls the manifest can supply an inline HLS master playlist that references an attacker media playlist. The media playlist allows a custom stitched-ad OMID verifier script to be set, and that script is executed as JavaScript. The report treats this as the first code-execution primitive, running inside the embed's context.
In plain terms: a gap in how the embed parses force_manifest_node lets an attacker influence which manifest the embed consumes. The attacker's description then carries a script, and the player runs it. That is the first moment the attacker gets code running inside Discord's process, even if only in a small corner of it.
The chain then uses a Discord popout window that inherits the origin of the embedding context, so the JavaScript obtained in the embed is not confined to the embed. An origin is the combination of scheme, host and port that a browser uses to decide which pages may touch each other's data. Normally a page from one origin cannot read another origin's content. If a popout window inherits the origin of whatever embedded it, then script that started in the embed is treated as if it belonged to the host. That inherited-origin popout is the bridge from the Twitch parser gap into Discord's own renderer.
Exploitation
Step 1: Attacker page to Twitch rich embed
The chain begins on an attacker-controlled page that causes Discord to render a Twitch rich embed. The report does not include the page markup or the link used. The embed is the component that performs the Twitch manifest fetch and parse.
Why this step matters: the attacker needs a way to get the embed in front of the victim. A page they control is the starting point the report gives. Everything after this depends on that embed existing.
Step 2: force_manifest_node parser gap
The Twitch embed parses force_manifest_node, and the parser gap lets the attacker direct the embed to an inline HLS master playlist under attacker control. The report gives no request or response for this step; the summary states only the field and the outcome.
Why this step matters: this is where the attacker takes over the stream description. Instead of Twitch's own manifest, the embed ends up reading one the attacker wrote. From here on, the attacker decides what the player sees.
Step 3: Inline HLS master to attacker media playlist with a custom OMID verifier
The attacker's master playlist points at an attacker media playlist. In that media playlist the attacker sets a custom stitched-ad OMID verifier script. The report states that this yields JavaScript execution. The playlist contents are not reproduced in the report.
Why this step matters: this is the first code execution. The verifier script is meant to be a small measurement helper, but it is JavaScript, and it runs. The attacker now has a foothold inside the embed's context.
Step 4: Inherited-origin Discord popout
The JavaScript runs in a Discord popout window that inherits the origin of the embedding context. This is what turns the embed-level execution into execution in a Discord origin, which the later stages require.
Why this step matters: without this, the script would be stuck in a sandboxed corner. Because the popout inherits the origin, the script is treated as part of Discord itself, and can reach the interfaces the later stages need.
Step 5: V8 RegExp use-after-free to compressed-cage read/write
Inside the renderer the researcher uses a V8 RegExp use-after-free and turns it into stable read and write within the compressed cage. The report names the primitive but does not include the trigger, the regular expression, or the heap layout.
Some background. V8 is the JavaScript engine, the part of the program that reads and runs JavaScript. A regular expression (regexp) is a pattern used to search text. A use-after-free is a memory bug: the program frees a piece of memory, then keeps using it as if it were still there. If an attacker can arrange for something else to be placed in that freed memory, they can influence what the program reads or writes. The compressed cage is a V8 design where JavaScript objects live in a reserved region of memory and are referred to by short offsets rather than full addresses. Getting read and write inside that cage is a big step: it means the attacker can inspect and change JavaScript objects at will.
Why this step matters: this is the memory-corruption stage. It turns a scripting foothold into the ability to manipulate the engine's own data.
Step 6: Response(128) leak, JSPI stack control, native ROP
A Response(128) is used to leak a native pointer. The researcher then uses a JSPI stack-control primitive and builds a native ROP chain. The report does not give the leaked value, the ROP gadgets, or the JSPI calls.
Background. A pointer is a number that says where something lives in memory. A leak is a way of getting the program to reveal such a number, which is essential for defeating address randomisation, the defence that shuffles memory locations so an attacker cannot guess them. Response is a web API object that represents an HTTP response; constructing one with a size argument is a normal thing to do, and here it is used in an unusual way to expose a native pointer. JSPI stands for JavaScript Promise Integration, a mechanism for letting JavaScript call into native code that may pause and resume. A stack-control primitive means the attacker can influence the call stack, the structure that records which function called which. ROP, return-oriented programming, is a technique where an attacker chains together small existing code fragments (gadgets) to make the program do something it was not designed to do, without writing new code from scratch.
Why this step matters: the cage read/write is not enough on its own. The attacker needs real memory addresses and a way to steer execution. The leak provides the addresses, and the JSPI primitive plus the ROP chain provide the steering.
Step 7: Barriered Electron IPC-wrapper export
The ROP chain reaches a barriered Electron IPC-wrapper export. The report gives the Calculator launch step as proof that this export was reached and used. The specific wrapper and the barrier are not named beyond this description.
Background. Electron apps are split into two parts: the renderer, which displays the web content, and the main process, which has full access to the operating system. They talk over IPC, inter-process communication, a structured message channel. An IPC wrapper is the code that exposes a call from one side to the other. A barrier is a check placed in front of such a call, meant to stop the renderer from invoking something it should not. Reaching a barriered wrapper export means the attacker got past that check and made the main process do something on their behalf. The Calculator launch is the visible proof: the calculator program started, which only the main process could have done.
Why this step matters: this is the crossing from the web side into the operating-system side. Up to here the attacker was inside the renderer; now they can ask the main process to act.
Step 8: Detached main-process WebDAV file-dialog activation
From the main process the chain activates a detached WebDAV file dialog, which triggers Windows WebClient demand-start. The report does not include the dialog path or the WebDAV URL.
Background. A file dialog is the window that lets a user pick a file. A detached dialog is one that is no longer attached to a normal window, which can change how it behaves. If the dialog points at a WebDAV location, Windows starts the WebClient service on demand to reach it. That gives the attacker a way to make the victim's machine make a network request to a server the attacker controls, and to interact with files over that channel.
Why this step matters: this is how the chain gets from "running code in the main process" to "interacting with the file system and the network in a way Windows treats specially". It sets up the file-timing trick that follows.
Step 9: Clip-file TOCTOU to updater .exe control
A time-of-check to time-of-use condition on a Discord clip file is used to gain control of the updater .exe.
Background. A TOCTOU is a race condition. The program checks something (for example, that a file is safe or in the right place), and then uses it later. If an attacker can change the thing between the check and the use, the check no longer means anything. Here the thing being changed is a Discord clip file, and the target is the updater .exe. If the attacker can swap what the updater is about to run, they control what gets executed.
Why this step matters: this is the last step before command execution. It converts file-system access into control of a program that Windows will run.
Step 10: Command execution
The chain ends with:
cmd.exe /d /k echo success
Line by line:
cmd.exeis the Windows command interpreter, the program behind the classic command prompt./dtells it to skip AutoRun commands, the commands Windows would otherwise run automatically at startup from the registry. Skipping them makes the run predictable./ktells it to keep the window open after running the command, instead of closing immediately.echo successis the command itself: it prints the wordsuccess.
So the whole line starts a command prompt, avoids any automatic startup commands, prints success, and leaves the window open so the researcher can see the result. It is the proof that the chain reached code execution on the victim's machine.
IPC calls used in order for the sandbox escape in the TOCTOU
The report lists the IPC calls in the order they are used:
DISCORD_APP_GET_PATHDISCORD_FILE_MANAGER_SHOW_OPEN_DIALOGDISCORD_DEBUG_STASH_CLIP_DECIDER_DATADISCORD_FILE_MANAGER_CREATE_DIRECTORY_IF_NOT_EXISTSDISCORD_DEBUG_STASH_CLIP_DECIDER_DATA(again)DISCORD_MOVE_CLIP+DISCORD_DEBUG_STASH_CLIP_DECIDER_DATA(concurrent)DISCORD_UPDATE_CLIP_METADATADISCORD_DEBUG_STASH_CLIP_DECIDER_DATADISCORD_DELETE_CLIPDISCORD_NATIVE_MODULES_FINISH_UPDATER_BOOTSTRAP
What each name suggests, in plain words:
DISCORD_APP_GET_PATHasks the main process for a path, presumably where the app lives or stores things.DISCORD_FILE_MANAGER_SHOW_OPEN_DIALOGopens the file picker dialog. This is the dialog that, in the previous step, points at WebDAV.DISCORD_DEBUG_STASH_CLIP_DECIDER_DATAstores some clip-related decision data. It appears four times, which is the interesting part: the same state is saved repeatedly around file operations.DISCORD_FILE_MANAGER_CREATE_DIRECTORY_IF_NOT_EXISTScreates a directory if it is not already there, a normal file-manager operation.DISCORD_MOVE_CLIPmoves a clip file. It is called concurrently with a stash, meaning the two happen at overlapping times.DISCORD_UPDATE_CLIP_METADATAupdates information about a clip.DISCORD_DELETE_CLIPdeletes a clip.DISCORD_NATIVE_MODULES_FINISH_UPDATER_BOOTSTRAPfinishes the updater's bootstrap, the startup sequence that prepares the updater to run.
The report gives no arguments, return values or responses for any of these calls. What the sequence shows is the shape of the TOCTOU: the clip decider data is stashed repeatedly around file-manager and clip operations, moved concurrently with a stash, and the sequence ends by finishing the updater bootstrap, which is where the updater .exe comes under attacker control.
Why this step matters: this is the sandbox escape. The renderer is supposed to be limited; the main process is not. By making the main process perform this particular sequence, with the timing overlap, the attacker gets the main process to act on files in a way that ends with control of the updater.
Root cause
The report identifies the initial mistake as a parser gap in the Twitch embed's handling of force_manifest_node, which allows an attacker-supplied inline HLS master playlist to be followed to an attacker media playlist. The media playlist's stitched-ad OMID verifier script is then executed, giving JavaScript execution in the embed. The inherited-origin popout means that execution is not isolated from Discord's own origin, so the renderer-level exploitation that follows is reachable.
On the client side, the report points to the V8 RegExp use-after-free as the memory-corruption bug, and to the IPC surface around clip handling and the updater bootstrap as the sandbox-escape path. The repeated stashing of clip decider data around file operations, and the concurrent move plus stash, are what create the TOCTOU window on the clip file that leads to updater .exe control.
Why existing defences did not stop the chain is only implied: the embed's manifest handling accepted the attacker's playlist, the popout inherited the origin, and the IPC calls in the listed order were accepted by the main process.
Impact
Under the conditions above, an attacker who can get a Twitch link rendered as a rich embed in front of a Windows Discord desktop user can chain the parser gap, renderer exploitation and IPC sequence to run a command through cmd.exe on the victim's machine. The chain ends with the command cmd.exe /d /k echo success. The program rated the report critical and paid a bounty of 5,500 USD.
Fix
The defects it identifies are the force_manifest_node parsing in the Twitch embed, the inherited-origin popout, the V8 RegExp use-after-free, and the clip/updater IPC sequence. Which of these were patched, and how, is not described.
Variants to test
- Other rich embeds that fetch and parse media manifests: look for fields that select a manifest node or playlist URL, and check whether an attacker-supplied inline master playlist is followed. A positive result is the embed loading an attacker media playlist.
- Stitched-ad or OMID verifier script fields in media playlists: check whether a custom verifier script is executed. A positive result is JavaScript running in the embed context.
- Popout or detached windows opened from embeds: check whether they inherit the embedding origin. A positive result is script from the embed reaching the host application's origin.
- V8 RegExp use-after-free patterns: check whether a crafted regular expression produces a stable read/write primitive in the compressed cage. A positive result is reliable read and write without a crash.
Responseobjects used for pointer leaks: check whether aResponse(128)or similar exposes a native pointer. A positive result is a stable leak usable for ROP.- Electron IPC wrappers with barriers: check whether a barriered wrapper export can be reached from the renderer. A positive result is a native action such as launching Calculator.
- WebDAV file dialogs in the main process: check whether a detached dialog triggers Windows WebClient demand-start. A positive result is an outbound WebDAV request from the client.
- Clip-file handling around the updater: check whether stashing clip decider data around file operations, including a concurrent move and stash, opens a TOCTOU window on the updater
.exe. A positive result is control of the updater binary.
Hunting notes
This kind of bug tends to hide where a chat or social client renders third-party rich embeds and follows manifest or playlist URLs from them, and where popout windows inherit the embedding origin. The signals during recon are embed fields that select a manifest node, media playlists that accept custom verifier scripts, and popout windows that keep the host origin. On the client side, the signals are IPC handlers around file dialogs, clip files and updater bootstrap, especially where the same state is stashed repeatedly around file operations. The researcher showed impact by carrying the chain all the way to cmd.exe /d /k echo success and by listing the IPC calls in the order used for the sandbox escape.
Glossary
- API: a defined set of calls one program offers to another, like a menu of things you are allowed to ask for.
- Barrier (in an IPC wrapper): a check placed in front of an inter-process call to stop the renderer from invoking something it should not.
- Bootstrap: the startup sequence that prepares a program to run.
- Clip: a short recorded video segment in Discord.
- Compressed cage: a V8 design where JavaScript objects live in a reserved memory region and are referred to by short offsets instead of full addresses.
- Concurrent: happening at overlapping times rather than strictly one after another.
- Demand-start: a Windows service starting automatically the first time something needs it.
- Detached dialog: a file dialog window that is no longer attached to a normal parent window.
- Electron: a framework for building desktop applications with web technology; it splits the app into a renderer and a main process.
- Embed (rich embed): the preview card a chat app draws for a link, built from data fetched from the linked site.
- Gadget: a small existing code fragment reused in a ROP chain.
- HLS: HTTP Live Streaming, a format that describes a stream with a master playlist and media playlists.
- IPC: inter-process communication, the message channel between the renderer and the main process in Electron.
- IPC wrapper: the code that exposes a call from one side of IPC to the other.
- JSPI: JavaScript Promise Integration, a mechanism for letting JavaScript call native code that may pause and resume.
- Leak: getting a program to reveal a memory address or other internal value it should not disclose.
- Main process: the Electron part with full access to the operating system.
- Manifest: a file describing where a media stream's parts live.
- Master playlist: the HLS file that lists which variant streams exist.
- Media playlist: the HLS file that lists the actual chunks of a stream.
- OMID: a standard for measuring whether an online ad was actually seen.
- Origin: the combination of scheme, host and port that a browser uses to decide which pages may access each other's data.
- Parser gap: a flaw in the code that reads a file or value, letting an attacker influence the result.
- Pointer: a number that says where something lives in memory.
- Primitive: a small, reliable capability (such as read or write) that an attacker builds larger attacks from.
- Renderer: the Electron part that displays web content, normally sandboxed from the operating system.
- ROP (return-oriented programming): chaining small existing code fragments to make a program do something it was not designed to do.
- Sandbox escape: getting out of the restricted environment a program runs untrusted content in.
- Stitched ad: an advertisement inserted directly into a media stream.
- TOCTOU: time-of-check to time-of-use, a race condition where something is checked and then changed before it is used.
- Updater: the program that updates an application, here a Windows
.exe. - Use-after-free: a memory bug where a program frees memory and then keeps using it.
- V8: the JavaScript engine that runs JavaScript in Chromium-based software, including Electron apps.
- Verifier script: a piece of JavaScript used to check ad measurement, here supplied through a media playlist.
- WebClient: the Windows feature that opens files over WebDAV and starts on demand.
- WebDAV: a way of exposing files over HTTP.