A Call of Duty exploit
A buffer overflow in the network handling of most Call of Duty games allows a player to execute arbitrary code on the match host's system. The author built a tool that injects crafted packets without modifying the game, achieving remote code execution and demonstrating effects like changing the map and displaying messages on all players' screens.
momo5502.com
Published on momo5502.com
A few years ago, I became aware of a security issue in most Call of Duty games. Although I did not discover it myself, I thought it might be interesting to see what it could be used for.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely a missing bounds check when copying network data into a fixed-size stack buffer in the game's network handling code.
Impact
An attacker could execute arbitrary code on the host's system, potentially accessing files or downloading and running executables, and could also manipulate the game for all players.
What the attacker needed
Play in a Call of Duty match; be the host or connect to host; use a tool to inject packets
The fix
The vulnerability was patched.
How it was found
- Capture the game's network traffic using WinDivert to analyse the protocol.
- Replicate enough of the network protocol to build custom packets that the game accepts and decrypts.
- Inject crafted packets that overflow the stack buffer and trigger the vulnerability.
- Use return-oriented programming (ROP) to call VirtualAlloc, write shellcode, and execute it.
- Restore the game's thread context using setjmp/longjmp to avoid crashing.
- Execute arbitrary code on the host, such as changing the map or displaying HUD elements.
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 write-up has not been written yet. The Original tab links to the source.
A buffer overflow happens when a program writes more data into a fixed-size memory area than it can hold, spilling into nearby memory. Here, a malicious player sends specially crafted network packets to the game host, and because the game does not check the size properly, the attacker can take control of the host's computer. The author made a tool that pretends to be the game to send these packets without modifying the game itself, so anti-cheat software does not notice.
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.