[Portal 2] Remote Code Execution via voice packets
A stack buffer overflow in the voice data handling of Portal 2 allows a remote attacker to execute arbitrary code on another player's machine by sending a crafted voice packet. The attacker can open the calculator on the victim's computer as proof of code execution.
- Triaged in 5 days
- Fixed in 2 months
- Paid in 2 months
- Disclosed after 18 months
Summary by the program
#Description RCE can be achieved on other players via voice packets due to the lack of length validation when reading into a stack based buffer.
#POC
- As the victim, invite the attacker into a game.
- Wait until both players have loaded into the game.
- Inject the following DLL into the attackers portal 2 process: (source code: )
- View that calc has been opened on the victims computer.
If these steps are followed correctly the outcome should look like so
#Vulnerable Code
bool CGameClient::ProcessVoiceData( CLC_VoiceData *msg )
{
char voiceDataBuffer[4096];
msg->m_DataIn.ReadBits( voiceDataBuffer, msg->m_nLength );
SV_BroadcastVoiceData( this, Bits2Bytes(msg->m_nLength), voiceDataBuffer, msg->m_xuid ); // length is in bits
return true;
}
Impact
RCE allows arbitrary code execution on the attacker's victim.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The code reads a length-controlled amount of data into a fixed-size stack buffer without validating that the length does not exceed the buffer size.
Impact
An attacker could execute arbitrary code on the victim's computer, as demonstrated by opening the calculator.
What the attacker needed
Victim invites attacker to a game; both players loaded into the game; attacker injects a DLL into their game
How it was found
- As the victim, invite the attacker into a game.
- Wait until both players have loaded into the game.
- Inject the provided DLL into the attacker's Portal 2 process.
- Observe that the calculator has opened on the victim's computer.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A stack buffer overflow happens when a program copies more data into a fixed-size memory area than it can hold. Here, the game reads voice data into a 4096-byte buffer without checking the length, so an attacker can send extra data and run their own code, taking control of the victim's computer.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.