Malformed playlist.txt in GoldSrc games leads to Access Violation & arbitrary code execution
A crafted playlist.txt file causes a stack overflow in GameUI.dll when the game tries to play the Splash track, leading to a crash and potentially arbitrary code execution. An attacker could send this file from a server using precache_generic, but the client must be restarted for the exploit to trigger.
Originally disclosed on HackerOne
- Triaged in 11 days
- Fixed in 50 days
- Paid in 50 days
- Disclosed after 6 months
A crafted playlist.txt can be used to exploit a stack overflow vulnerability in GameUI.dll that can lead to arbitrary code execution.
Reproduction
Place attached playlist.txt in game directory (valve, cstrike, etc.). The game will crash when it tries to play Splash track.
Exploitability
The file can be sent from server with precache_generic function (custom mp.dll, amxx plugins, etc.). I don't know ant way to force reload the playlist, so for the exploit to trigger, the client must be restarted. In my opinion, it's still dangerous. And this method won't work if the client already had playlist.txt in the game directory.
Impact
The attacker can use this to do many things, from crashing the client to stealing important data.
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
Likely a stack buffer overflow in GameUI.dll when parsing the playlist.txt file, specifically when handling the Splash track.
Impact
The attacker can crash the client or potentially steal important data, but the exploit requires the client to be restarted and does not work if the client already has a playlist.txt in the game directory.
What the attacker needed
Attacker controls a game server; victim restarts the game client; victim does not already have playlist.txt
How it was found
- Place the crafted playlist.txt in the game directory (e.g., valve, cstrike).
- Restart the game client.
- The game crashes when it tries to play the Splash track.
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 overflow is when a program writes more data into a small memory area than it can hold, which can crash it or let an attacker run their own code. Here, a file called playlist.txt is read by the game and its contents overflow a buffer in a library called GameUI.dll. An attacker who controls a game server could send this file to players, but the player must restart the game for it to take effect.
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.