Skip to content
Memory corruption Disclosed report Advanced

Buffer overrun in Steam SILK voice decoder

A buffer overrun in the Steam SILK voice decoder allows an attacker to overwrite stack memory by sending a crafted voice payload. This can crash other clients and potentially lead to remote code execution.

slidybat Follow

Originally disclosed on HackerOne

Bounty$7,500 Critical 9.1 View original
  • Triaged in 15 days
  • Fixed in 2 months
  • Paid in 2 months
  • Disclosed after 4 months

#Vulnerability The SteamWorks SDK has a function available named DecompressVoice(), which takes as input some compressed voice data, and returns the raw audio data.

The format for the input voice data is as follows:

8 bytes - steamid
1 byte - payload type
2 bytes - payload size
<payload data>
4 bytes - CRC checksum

There are numerous payload types available, including Opus PLC, Opus, SILK, Raw and Silence. The bug being considered here is specific to the SILK decoder.

The pseudo-code for the SILK decoder is:

C++
unsigned int VoiceEncoder_SILK::Decode( const char* pPayloadData, size_t nPayloadSize, char* pDestBuffer, size_t nDestBufferSize )
{
	m_decControl.API_sampleRate = m_nSampleRate;
	int nSamplesInFrame = 20 * m_nSampleRate / 1000;
	int nBytesInFrame = 2 * nSamplesInFrame;
	
	const char* pPayloadCurr = pPayloadData;
	const char* pPayloadEnd = pPayloadData + pPayloadSize;
	
	char* pDestCurr = pDestBuffer;
	char* pDestEnd = pDestBuffer + nDestBufferSize;
	
	while ( pPayloadCurr < pPayloadEnd )
	{
		unsigned short nSize = *(short*)pPayloadCurr;
		pPayloadCurr += 2;
		if ( nSize == 0xFFFF )
		{
			return ( pDestCurr - pDestBuffer ) / 2;
		}
		
		if ( nSize )
		{
			//  [1] Make sure we're not reading past end of our input
			if ( pPayloadCurr + nSize > pPayloadEnd )
				break;
			
			//  [2] Make sure we have enough room in output for a full frame
			if ( pDestCurr + 2 * nBytesInFrame > pDestEnd )
				break;
			
			// Zero out the frame
			memset( pDestCurr, 0, nBytesInFrame );
			
			do
			{
				unsigned short nDecodedSamples = ( pDestCurr - pDestBuffer ) / 2;
				SKP_Silk_SDK_Decode( m_pDecoder, &m_decControl, 0, pPayloadCurr, nSize, pDestCurr, &nDecodedSamples );
				
				pPayloadCurr += nSize;
				pDestCurr += 2 * nDecodedSamples;
				
				Assert( m_decControl.moreInternalDecoderFrames == 0 ); // [3] We shouldn't get this condition in normal contexts
			}
			while ( m_decControl.moreInternalDecoderFrames );
		}
		else
		{
			pDestCurr += nBytesInFrame;
		}
	}
	
	return ( pDestCurr - pDestBuffer ) / 2;
}

Some important things to note:

  • At [1], a bounds check is performed to ensure we don't read outside the bounds of the input buffer
  • At [2], a bounds check is performed to ensure we don't write outside the bounds of the output buffer
  • At [3], an assert is performed that m_decControl.moreInternalDecoderFrames == 0, however, without running with a debugger attached, this assertion is ignored.

The bug has to do with the do/while loop with m_decControl.moreInternalDecoderFrames. Inside the loop, pPayloadCurr and pDestCurr are both incremented, but the bounds checks at [1] and [2] aren't repeated.

This means that if m_decControl.moreInternalDecoderFrames is true, then we can increment pDestCurr past the end of the destination buffer, and overwrite stack data.

#Exploiting the vulnerability For the PoC, I chose to show this bug working in CS:GO, but any service that also uses the DecompressVoice function is also vulnerable. We can use this bug to crash Steam/CS:GO for any players on the server that our voices are transmitted to.

Note that the PoC simply overwrites the stack with garbage data which leads to a crash, however it is entirely possible for an attacker to overwrite the return pointer on the stack with meaningful data that results in RCE. Doing so requires quite a lot of setup work with the payload to get SILK to decode it to a valid ROP chain, so I simply went with the crash for an easier PoC.

One of the challenges to getting this working is to keep the payload size small. CS:GO has a rate-limit on voice data, so the entire voice packet must be kept under 512 bytes.

To accomplish this, we can build a voice payload that does this:

  • First, set nSize in the payload to 0 multiple times to get pDestCurr closer to pDestEnd (just over 1 frame away).
  • Next, trigger a call to SKP_Silk_SDK_Decode that also sets m_decControl.moreInternalDecoderFrames to true. At this point, pDestCurr will be incremented by 1 frame, and there will now be less than 1 frame of room in the dest buffer.
  • Trigger another call to SKP_Silk_SDK_Decode. Since m_decControl.moreInternalDecoderFrames is true, no bounds check is performed. This time there isn't enough room for a frame in the dest buffer and the decode function will overwrite the stack past pDestBuffer.

Attached is a compiled version of a public cheat (CSGOSimple) that adds a console command (send_voice_packet) to send the voice payloads from a file to the server.

A file that implements this payload is attached as voice_payload, which can be fed to the send_voice_packet command to replicate the PoC. NOTE: Unrelated for replicating the PoC, but this payload is missing the SteamID/CRC data mentioned above. It is expected to be passed into CP2PVoiceSingleton::DecompressVoice() directly, or have the SteamID/CRC added before calling it.

#Replication steps

  1. Start CS:GO on device A with -insecure launch param and join a server (any empty vanilla server will do, I have one at s1.slidyb.at if needed).
  2. Extract CSGOSimple.zip from the attachments onto device A and run injector.exe. Ensure that it has injected into the CS:GO process successfully by checking if the send_voice_packet command exists.
  3. Start CS:GO on device B and join the same server.
  4. Run send_voice_packet path\to\voice_payload in the CS:GO console on device A, where path\to\voice_payload is the absolute path to the voice_payload file without the C:. For example, if the file as at C:\Users\me\Desktop\voice_payload, then you would use the command send_voice_packet Users\me\Desktop\voice_payload.
  5. Steam and CS:GO should both crash on device B.

Impact

This bug affects any service using the SteamWorks DecompressVoice function, which includes Steam itself and most Source engine titles. It can be used on any other client that can hear voice data from the attacker, including on official Valve matchmaking servers in Source games.

In the best case, it is possible for an attacker to utilize the bug as a DoS to crash other clients, and in the worst case it can lead to RCE by using ROP.

The original report as published on HackerOne, by slidybat. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 6 min read.

Context

The SteamWorks SDK exposes a function called DecompressVoice(), documented on the Steam partner site, which takes compressed voice data as input and returns raw audio data. The bug affects any service that uses this function, which the researcher states includes Steam itself and most Source engine titles.

The input format the decoder expects is:

Text
8 bytes - steamid
1 byte - payload type
2 bytes - payload size
<payload data>
4 bytes - CRC checksum

Several payload types exist: Opus PLC, Opus, SILK, Raw and Silence. This report concerns the SILK decoder only.

Setup

The proof of concept was run against CS:GO, chosen as one example of a service that calls DecompressVoice. Two devices are needed, both running CS:GO and joined to the same server. Device A runs the game with the -insecure launch parameter and carries the modified client; device B is the victim. The researcher notes that any empty vanilla server will do, and mentions one at s1.slidyb.at if needed.

The tooling is a compiled build of the public CSGOSimple cheat, which adds a console command send_voice_packet that sends voice payloads read from a file to the server. A second attachment, voice_payload, contains the crafted payload. The payload deliberately omits the SteamID and CRC fields described above: it is meant to be passed straight into CP2PVoiceSingleton::DecompressVoice(), or to have the SteamID and CRC added before that call.

Finding it

The researcher read the pseudo-code of the SILK decoder and looked at how it walks the input and output buffers:

C++
unsigned int VoiceEncoder_SILK::Decode( const char* pPayloadData, size_t nPayloadSize, char* pDestBuffer, size_t nDestBufferSize )
{
	m_decControl.API_sampleRate = m_nSampleRate;
	int nSamplesInFrame = 20 * m_nSampleRate / 1000;
	int nBytesInFrame = 2 * nSamplesInFrame;

	const char* pPayloadCurr = pPayloadData;
	const char* pPayloadEnd = pPayloadData + pPayloadSize;

	char* pDestCurr = pDestBuffer;
	char* pDestEnd = pDestBuffer + nDestBufferSize;

	while ( pPayloadCurr < pPayloadEnd )
	{
		unsigned short nSize = *(short*)pPayloadCurr;
		pPayloadCurr += 2;
		if ( nSize == 0xFFFF )
		{
			return ( pDestCurr - pDestBuffer ) / 2;
		}

		if ( nSize )
		{
			//  [1] Make sure we're not reading past end of our input
			if ( pPayloadCurr + nSize > pPayloadEnd )
				break;

			//  [2] Make sure we have enough room in output for a full frame
			if ( pDestCurr + 2 * nBytesInFrame > pDestEnd )
				break;

			// Zero out the frame
			memset( pDestCurr, 0, nBytesInFrame );

			do
			{
				unsigned short nDecodedSamples = ( pDestCurr - pDestBuffer ) / 2;
				SKP_Silk_SDK_Decode( m_pDecoder, &m_decControl, 0, pPayloadCurr, nSize, pDestCurr, &nDecodedSamples );

				pPayloadCurr += nSize;
				pDestCurr += 2 * nDecodedSamples;

				Assert( m_decControl.moreInternalDecoderFrames == 0 ); // [3] We shouldn't get this condition in normal contexts
			}
			while ( m_decControl.moreInternalDecoderFrames );
		}
		else
		{
			pDestCurr += nBytesInFrame;
		}
	}

	return ( pDestCurr - pDestBuffer ) / 2;
}

Three points in that listing matter:

  1. At [1], a bounds check ensures the decoder does not read past the end of the input buffer.
  2. At [2], a bounds check ensures there is room in the output buffer for a full frame before writing.
  3. At [3], an assert checks that m_decControl.moreInternalDecoderFrames == 0. Without a debugger attached, that assertion is ignored.

The flaw sits in the do/while loop driven by m_decControl.moreInternalDecoderFrames. Inside the loop both pPayloadCurr and pDestCurr are advanced, but the checks at [1] and [2] are not repeated. If m_decControl.moreInternalDecoderFrames comes back true, the loop runs again and pDestCurr can be pushed past the end of the destination buffer, overwriting stack data.

Exploitation

The PoC demonstrates the bug in CS:GO by crashing Steam and the game on every player on the server who receives the attacker's voice. The researcher is explicit that the PoC only overwrites the stack with garbage, producing a crash, and that turning this into RCE by placing a meaningful return pointer requires substantial setup work so that SILK decodes the payload into a valid ROP chain. The crash was chosen for an easier PoC.

A practical constraint shapes the payload: CS:GO rate-limits voice data, so the whole voice packet must stay under 512 bytes. The payload is built in three stages:

  1. Set nSize in the payload to 0 several times, which moves pDestCurr closer to pDestEnd, to just over one frame away.
  2. Trigger a call to SKP_Silk_SDK_Decode that also sets m_decControl.moreInternalDecoderFrames to true. pDestCurr is then incremented by one frame, leaving less than one frame of room in the destination buffer.
  3. Trigger another call to SKP_Silk_SDK_Decode. Because m_decControl.moreInternalDecoderFrames is true, no bounds check runs, there is no longer enough room for a frame, and the decode function writes past pDestBuffer into the stack.

Step 1: prepare device A

Start CS:GO on device A with the -insecure launch parameter and join a server. Any empty vanilla server works.

Step 2: load the modified client

Extract CSGOSimple.zip from the attachments onto device A and run injector.exe. Confirm the injection succeeded by checking that the send_voice_packet command exists in the console.

Step 3: join with the victim

Start CS:GO on device B and join the same server.

Step 4: send the payload

From the CS:GO console on device A, run:

Text
send_voice_packet path\to\voice_payload

Here path\to\voice_payload is the absolute path to the voice_payload file with the C: stripped. For a file at C:\Users\me\Desktop\voice_payload, the command is:

Text
send_voice_packet Users\me\Desktop\voice_payload

Step 5: observe the result

Steam and CS:GO should both crash on device B.

Root cause

The bounds checks at [1] and [2] guard only the first iteration of the decode loop. The loop condition is m_decControl.moreInternalDecoderFrames, a value set by the SILK decoder itself, and each iteration advances pDestCurr by the number of decoded samples without re-checking it against pDestEnd. The only guard against the multi-frame case is the Assert at [3], which is ignored without a debugger attached. A payload that makes the decoder report more internal frames therefore drives writes past the end of the destination buffer.

Impact

It can be triggered against any client that can hear the attacker's voice data, including on official Valve matchmaking servers in Source games.

In the best case for the attacker, the bug is a denial of service that crashes other clients. In the worst case, it leads to RCE through ROP. The PoC itself only crashes the client; the researcher notes RCE is possible with substantial setup work.

Fix

The report does not describe a fix or a vendor response.

Variants to test

  • Other payload types in the same voice format (Opus PLC, Opus, Raw, Silence): a positive result is a decode path that also advances the output pointer across iterations without re-checking the destination bound.
  • Other callers of DecompressVoice beyond CS:GO: a positive result is a crash on a client that receives the crafted voice packet, which would show the same decoder is reachable from that title.
  • Payloads that stay under the voice rate limit: a positive result is a crash from a packet under 512 bytes, confirming the size constraint does not prevent the overwrite.

Hunting notes

This kind of bug hides in hand-written decoders that loop over a variable number of internal frames and check buffer bounds once, before the loop, rather than on every iteration. The signal during review is a do/while loop whose condition is set by the decoder library and whose body advances both input and output pointers, especially when the only guard against the multi-frame case is an Assert. In a bounty context, the researcher showed impact by crashing a second client on a shared server, which demonstrates the bug is reachable from untrusted voice data sent by another player.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 14 min read.

What happened, in plain words

Steam, the program most PC gamers use to buy and launch games, has a voice chat feature. When you speak into your microphone, Steam compresses your voice into a small packet of data, sends it over the internet, and the other players' computers decompress it back into sound. The part of Steam that does the decompressing is a piece of code called DecompressVoice(), and it lives in a toolkit Valve gives to game developers, the SteamWorks SDK.

A security researcher found that one of the decompression methods inside that function, the one called SILK, can be tricked. If an attacker sends a specially crafted voice packet, the decompressor writes more data into a memory area than that area can hold. In computing this is called a buffer overflow. The extra data spills over into neighbouring memory, which in the worst case lets an attacker take control of the victim's computer, and in the mildest case simply crashes the game and Steam.

The researcher demonstrated the crash in Counter-Strike: Global Offensive (CS:GO), a Valve shooter that uses the same voice code.

To follow the rest of this article you only need to understand a few ideas, explained as they come up.

The product and the feature

What an API is

An API (Application Programming Interface) is a published list of functions that one program offers to other programs. Think of a restaurant menu: you do not walk into the kitchen, you order from the menu and the kitchen does the work. Game developers do not write their own voice decompressor; they call Valve's function from the menu.

The function in question is DecompressVoice(), documented on the Steam partner site. It takes compressed voice data as input and returns raw audio data, the kind of data a speaker can play. The bug affects any service that uses this function, which the researcher states includes Steam itself and most Source engine titles.

The voice packet format

The decoder expects each voice packet to be laid out in a fixed structure:

Text
8 bytes - steamid
1 byte - payload type
2 bytes - payload size
<payload data>
4 bytes - CRC checksum

Line by line:

  • 8 bytes - steamid: the first 8 bytes identify which Steam account the voice belongs to. A byte is the smallest unit of computer memory, roughly one character of text.
  • 1 byte - payload type: a single byte saying which compression method was used for the audio that follows.
  • 2 bytes - payload size: two bytes giving the length of the audio data.
  • <payload data>: the compressed audio itself, of whatever length the previous field announced.
  • 4 bytes - CRC checksum: four bytes forming a checksum, a short mathematical fingerprint of the data used to detect accidental corruption during transmission.

Several payload types exist: Opus PLC, Opus, SILK, Raw and Silence. This report concerns the SILK decoder only. SILK is one particular audio compression method, and the others are alternative methods the same function can handle.

Setting up the demonstration

The proof of concept was run against CS:GO, chosen as one example of a service that calls DecompressVoice. Two devices are needed, both running CS:GO and joined to the same server. Device A runs the game with the -insecure launch parameter and carries the modified client; device B is the victim. The researcher notes that any empty vanilla server will do, and mentions one at s1.slidyb.at if needed.

The tooling is a compiled build of the public CSGOSimple cheat, which adds a console command send_voice_packet that sends voice payloads read from a file to the server. A second attachment, voice_payload, contains the crafted payload. The payload deliberately omits the SteamID and CRC fields described above: it is meant to be passed straight into CP2PVoiceSingleton::DecompressVoice(), or to have the SteamID and CRC added before that call.

A few words on the setup, since they matter later:

  • A cheat is a modified version of a game client that gives the player abilities the normal client does not have. Here it is used only as a convenient way to send a hand-made voice packet.
  • A console command is a text instruction typed into the game's built-in console instead of clicking buttons.
  • The -insecure launch parameter is used when starting the game on device A.
  • The server is the shared machine that all players connect to; it relays voice data between them.

Finding it

The researcher read the pseudo-code of the SILK decoder and looked at how it walks the input and output buffers. Pseudo-code is a simplified sketch of a program's logic, close to real code but written for reading rather than running. A buffer is a reserved block of memory used to hold data temporarily, like a tray you put ingredients on while cooking.

C++
unsigned int VoiceEncoder_SILK::Decode( const char* pPayloadData, size_t nPayloadSize, char* pDestBuffer, size_t nDestBufferSize )
{
	m_decControl.API_sampleRate = m_nSampleRate;
	int nSamplesInFrame = 20 * m_nSampleRate / 1000;
	int nBytesInFrame = 2 * nSamplesInFrame;

	const char* pPayloadCurr = pPayloadData;
	const char* pPayloadEnd = pPayloadData + pPayloadSize;

	char* pDestCurr = pDestBuffer;
	char* pDestEnd = pDestBuffer + nDestBufferSize;

	while ( pPayloadCurr < pPayloadEnd )
	{
		unsigned short nSize = *(short*)pPayloadCurr;
		pPayloadCurr += 2;
		if ( nSize == 0xFFFF )
		{
			return ( pDestCurr - pDestBuffer ) / 2;
		}

		if ( nSize )
		{
			//  [1] Make sure we're not reading past end of our input
			if ( pPayloadCurr + nSize > pPayloadEnd )
				break;

			//  [2] Make sure we have enough room in output for a full frame
			if ( pDestCurr + 2 * nBytesInFrame > pDestEnd )
				break;

			// Zero out the frame
			memset( pDestCurr, 0, nBytesInFrame );

			do
			{
				unsigned short nDecodedSamples = ( pDestCurr - pDestBuffer ) / 2;
				SKP_Silk_SDK_Decode( m_pDecoder, &m_decControl, 0, pPayloadCurr, nSize, pDestCurr, &nDecodedSamples );

				pPayloadCurr += nSize;
				pDestCurr += 2 * nDecodedSamples;

				Assert( m_decControl.moreInternalDecoderFrames == 0 ); // [3] We shouldn't get this condition in normal contexts
			}
			while ( m_decControl.moreInternalDecoderFrames );
		}
		else
		{
			pDestCurr += nBytesInFrame;
		}
	}

	return ( pDestCurr - pDestBuffer ) / 2;
}

Line by line, in plain words:

  • unsigned int VoiceEncoder_SILK::Decode(...): this is the function that decodes SILK audio. It receives four things: the compressed input (pPayloadData), how long that input is (nPayloadSize), the output buffer where the sound will be written (pDestBuffer), and how big that output buffer is (nDestBufferSize).
  • m_decControl.API_sampleRate = m_nSampleRate;: records the audio sample rate, the number of sound measurements taken per second.
  • int nSamplesInFrame = 20 * m_nSampleRate / 1000;: works out how many sound samples fit in one frame. A frame is a small fixed chunk of audio, here 20 milliseconds' worth.
  • int nBytesInFrame = 2 * nSamplesInFrame;: converts that to bytes, two bytes per sample.
  • const char* pPayloadCurr = pPayloadData; and const char* pPayloadEnd = pPayloadData + nPayloadSize;: set two markers, one at the start of the input and one just past its end. A pointer is simply a marker that says "the data is at this address in memory".
  • char* pDestCurr = pDestBuffer; and char* pDestEnd = pDestBuffer + nDestBufferSize;: the same two markers for the output buffer.
  • while ( pPayloadCurr < pPayloadEnd ): keep going as long as there is still input left to read.
  • unsigned short nSize = *(short*)pPayloadCurr;: read the next two bytes of input as a number, the size of the next chunk.
  • pPayloadCurr += 2;: move the input marker forward by those two bytes.
  • if ( nSize == 0xFFFF ): if the size is the special value 0xFFFF, stop and report how much sound was produced. 0xFFFF is hexadecimal notation for a particular number, used here as an end marker.
  • if ( nSize ): if the size is not zero, decode a chunk.
  • if ( pPayloadCurr + nSize > pPayloadEnd ) break;: check number one, marked [1]. If reading this chunk would run past the end of the input, stop. This prevents reading memory that does not belong to the packet.
  • if ( pDestCurr + 2 * nBytesInFrame > pDestEnd ) break;: check number two, marked [2]. If there is not room in the output for a whole frame, stop. This prevents writing past the end of the output buffer.
  • memset( pDestCurr, 0, nBytesInFrame );: fill the next frame's worth of output with zeros before decoding into it.
  • do { ... } while ( m_decControl.moreInternalDecoderFrames );: a loop that runs at least once and repeats while the decoder says it has more internal frames to produce. The decoder sets that flag itself.
  • unsigned short nDecodedSamples = ( pDestCurr - pDestBuffer ) / 2;: tell the decoder how many samples have been produced so far.
  • SKP_Silk_SDK_Decode( ... );: the actual SILK decoding call, which writes sound into the output buffer and updates the frame flag.
  • pPayloadCurr += nSize; and pDestCurr += 2 * nDecodedSamples;: move both markers forward by what was just consumed and produced.
  • Assert( m_decControl.moreInternalDecoderFrames == 0 );: check number three, marked [3]. An assert is a self-check a programmer inserts to catch impossible situations during development. In a release build without a debugger attached, it is ignored.
  • else { pDestCurr += nBytesInFrame; }: if the size was zero, just skip a frame's worth of output.
  • return ( pDestCurr - pDestBuffer ) / 2;: report how many samples were produced in total.

Three points in that listing matter:

  1. At [1], a bounds check ensures the decoder does not read past the end of the input buffer. A bounds check is a test that a position is still inside the allowed area, like checking you are not about to step off a pier.
  2. At [2], a bounds check ensures there is room in the output buffer for a full frame before writing.
  3. At [3], an assert checks that m_decControl.moreInternalDecoderFrames == 0. Without a debugger attached, that assertion is ignored.

The flaw sits in the do/while loop driven by m_decControl.moreInternalDecoderFrames. Inside the loop both pPayloadCurr and pDestCurr are advanced, but the checks at [1] and [2] are not repeated. If m_decControl.moreInternalDecoderFrames comes back true, the loop runs again and pDestCurr can be pushed past the end of the destination buffer, overwriting stack data.

The stack is the region of memory where a program keeps the small pieces of information it needs while running, including the address it should return to when a function finishes. Writing past a buffer that lives there is what makes this bug dangerous: the spilled data can land on that return address.

Exploitation

The PoC demonstrates the bug in CS:GO by crashing Steam and the game on every player on the server who receives the attacker's voice. The researcher is explicit that the PoC only overwrites the stack with garbage, producing a crash, and that turning this into RCE by placing a meaningful return pointer requires substantial setup work so that SILK decodes the payload into a valid ROP chain. The crash was chosen for an easier PoC.

Two terms from that paragraph:

  • RCE stands for remote code execution: an attacker gets their own instructions to run on someone else's machine. It is the worst outcome of a memory bug.
  • A ROP chain is a sequence of small existing code fragments stitched together through carefully chosen return addresses, a technique for running chosen actions without injecting new code. Building one through an audio decoder is fiddly work.

A practical constraint shapes the payload: CS:GO rate-limits voice data, so the whole voice packet must stay under 512 bytes. Rate limiting means the game refuses to accept more than a certain amount of voice data in a given time, so the attacker cannot simply send a huge packet.

The payload is built in three stages:

  1. Set nSize in the payload to 0 several times, which moves pDestCurr closer to pDestEnd, to just over one frame away.
  2. Trigger a call to SKP_Silk_SDK_Decode that also sets m_decControl.moreInternalDecoderFrames to true. pDestCurr is then incremented by one frame, leaving less than one frame of room in the destination buffer.
  3. Trigger another call to SKP_Silk_SDK_Decode. Because m_decControl.moreInternalDecoderFrames is true, no bounds check runs, there is no longer enough room for a frame, and the decode function writes past pDestBuffer into the stack.

In everyday terms: the attacker first walks the output marker to the very edge of the tray using harmless empty chunks, then asks the decoder for a chunk that makes it announce "there is more coming", and finally asks for another chunk. The second request skips the "is there room?" check because the code only performs it once, before the loop, and the data lands off the tray.

Step 1: prepare device A

Start CS:GO on device A with the -insecure launch parameter and join a server. Any empty vanilla server works. This device is the attacker's machine, and the modified client needs the anti-cheat disabled to run.

Step 2: load the modified client

Extract CSGOSimple.zip from the attachments onto device A and run injector.exe. Confirm the injection succeeded by checking that the send_voice_packet command exists in the console. Injection here means loading extra code into the running game process; the console command is the proof that the extra code is active.

Step 3: join with the victim

Start CS:GO on device B and join the same server. Device B is the victim's machine, and both players must be on the same server for voice data to travel between them.

Step 4: send the payload

From the CS:GO console on device A, run:

Text
send_voice_packet path\to\voice_payload

Here path\to\voice_payload is the absolute path to the voice_payload file with the C: stripped. An absolute path is the full address of a file on disk, starting from the drive letter. For a file at C:\Users\me\Desktop\voice_payload, the command is:

Text
send_voice_packet Users\me\Desktop\voice_payload

The crafted file is read and sent to the server as the attacker's voice.

Step 5: observe the result

Steam and CS:GO should both crash on device B. A crash is the visible sign that memory was overwritten with data the program could not make sense of.

Root cause

The bounds checks at [1] and [2] guard only the first iteration of the decode loop. The loop condition is m_decControl.moreInternalDecoderFrames, a value set by the SILK decoder itself, and each iteration advances pDestCurr by the number of decoded samples without re-checking it against pDestEnd. The only guard against the multi-frame case is the Assert at [3], which is ignored without a debugger attached. A payload that makes the decoder report more internal frames therefore drives writes past the end of the destination buffer.

In short: the safety check is done once at the door, but the loop can go round several times, and nobody checks again on the way back in.

Impact

The bug affects any service that uses the SteamWorks DecompressVoice function, which the researcher states includes Steam itself and most Source engine titles. It can be triggered against any client that can hear the attacker's voice data, including on official Valve matchmaking servers in Source games.

In the best case for the attacker, the bug is a denial of service that crashes other clients. Denial of service means making a service unusable without gaining control of it. In the worst case, it leads to RCE through ROP. The PoC itself only crashes the client; the researcher notes RCE is possible with substantial setup work.

Fix

The report does not describe a fix or a vendor response.

Variants to test

  • Other payload types in the same voice format (Opus PLC, Opus, Raw, Silence): a positive result is a decode path that also advances the output pointer across iterations without re-checking the destination bound.
  • Other callers of DecompressVoice beyond CS:GO: a positive result is a crash on a client that receives the crafted voice packet, which would show the same decoder is reachable from that title.
  • Payloads that stay under the voice rate limit: a positive result is a crash from a packet under 512 bytes, confirming the size constraint does not prevent the overwrite.

Hunting notes

This kind of bug hides in hand-written decoders that loop over a variable number of internal frames and check buffer bounds once, before the loop, rather than on every iteration. The signal during review is a do/while loop whose condition is set by the decoder library and whose body advances both input and output pointers, especially when the only guard against the multi-frame case is an Assert. In a bounty context, the researcher showed impact by crashing a second client on a shared server, which demonstrates the bug is reachable from untrusted voice data sent by another player.

Glossary

  • API: a published list of functions one program offers to other programs, like a menu you order from.
  • Assert: a self-check inserted by a programmer to catch impossible situations during development, usually ignored in release builds.
  • Bounds check: a test that a read or write stays inside the allowed memory area.
  • Buffer: a reserved block of memory used to hold data temporarily.
  • Buffer overflow: writing more data into a buffer than it can hold, so the extra data spills into neighbouring memory.
  • Byte: the smallest unit of computer memory, roughly one character of text.
  • Checksum (CRC): a short mathematical fingerprint of data, used to detect accidental corruption.
  • Console command: a text instruction typed into a game's built-in console instead of clicking buttons.
  • Crash: the sudden failure of a program, often caused by memory being overwritten with data it cannot use.
  • CS:GO: Counter-Strike: Global Offensive, a Valve shooter that uses the affected voice code.
  • CVSS: a standard scoring system for the severity of a security bug, from 0 to 10.
  • Denial of service (DoS): making a service unusable without gaining control of it.
  • Frame: a small fixed chunk of audio, here 20 milliseconds' worth.
  • Injection: loading extra code into a running program's process.
  • -insecure: a launch parameter that starts a game without Valve's anti-cheat protection.
  • Payload: the data carried inside a packet, here the compressed audio.
  • Pointer: a marker that says where data sits in memory.
  • Pseudo-code: a simplified sketch of a program's logic, written for reading rather than running.
  • Rate limit: a cap on how much data or how many requests are accepted in a given time.
  • RCE (remote code execution): an attacker getting their own instructions to run on someone else's machine.
  • ROP chain: a sequence of small existing code fragments stitched together through chosen return addresses, used to run chosen actions without injecting new code.
  • Sample rate: the number of sound measurements taken per second.
  • SILK: one particular audio compression method handled by the voice decoder.
  • Source engine: Valve's game engine, used by most of the titles affected here.
  • Stack: the memory region where a running program keeps small pieces of information, including where to return when a function finishes.
  • SteamWorks SDK: Valve's toolkit of functions that game developers call, including DecompressVoice().
  • Vanilla: unmodified, in its standard state.

More by slidybat

View all

2 more disclosed reports, best first.

More from Valve

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.