# Buffer overrun in Steam SILK voice decoder

SILK voice decoder in Steam's DecompressVoice skips output bounds checks inside the moreInternalDecoderFrames loop, letting a crafted voice packet overflow the stack and crash or RCE remote clients.

- Payout: $7,500
- Severity: critical
- Program: Valve
- Found by: slidybat
- Disclosed: 2021-09-13
- Write-up quality: 8/10
- Original: https://hackerone.com/reports/1180252
- Library page: https://bugbountylibrary.com/r/h1%3A1180252
- Tags: area:os domain:desktop impact:dos impact:rce kind:bounty platform:hackerone sev:critical technique:incomplete-fix technique:source-review vuln:dos vuln:memory-corruption

**Target:** SteamWorks SDK ISteamUser::DecompressVoice / VoiceEncoder_SILK::Decode (steam.exe, Source engine voice)
**Root cause:** The do/while loop over SKP_Silk_SDK_Decode increments pPayloadCurr and pDestCurr but never re-checks the input/output bounds established before the loop, so when moreInternalDecoderFrames stays true the destination pointer advances past pDestEnd.
**Steps:**
1. Craft voice payload: repeat `nSize=0` entries to push pDestCurr to just over one frame from pDestEnd
2. Add a SILK frame that sets `m_decControl.moreInternalDecoderFrames=true`, advancing pDestCurr by one frame
3. Add another SILK frame; loop re-enters without bounds check and SKP_Silk_SDK_Decode writes past pDestBuffer
4. Keep total packet under 512 bytes to satisfy CS:GO voice rate limit
5. Inject CSGOSimple, run `send_voice_packet path\to\voice_payload` on attacker client joined to same server
6. Victim client receiving voice crashes (stack overwrite)
**How found:** Code review of the SILK decoder pseudocode: noticed bounds checks at [1] and [2] occur only before the do/while loop, while pPayloadCurr/pDestCurr are mutated inside, and the moreInternalDecoderFrames assert is compiled out in release builds.
**Exploitation:** Attacker joins a Source/CS:GO server with a modified client, sends a sub-512-byte crafted SILK voice packet via send_voice_packet; the victim's DecompressVoice processes it and the unchecked loop writes garbage past the stack destination buffer, crashing Steam/CS:GO. RCE via ROP is possible but requires crafting SILK-decodable payload that yields a valid ROP chain.
**Escalation:** From DoS crash to potential RCE by shaping decoded output into a ROP chain overwriting the return pointer; affects any client hearing attacker voice including official matchmaking.
**Insight:** When auditing decoders, check whether loop-invariant bounds checks are re-evaluated after each iteration mutates the cursor; an assert guarding a 'shouldn't happen' state is a strong hint that state is attacker-controllable in release builds.

