General Graboids: Worms and Remote Code Execution in Command and Conquer
The game's network packet handlers contained a stack buffer overflow in filename parsing and an arbitrary file write, allowing a remote attacker to execute code on any peer. The authors built a worm that spreads via these flaws and can run commands or manipulate the game engine.
atredis.com
Published on atredis.com
This post details several vulnerabilities discovered in the online game Command & Conquer: Generals. We recently presented some of this work at an information security conference and this post contains technical details about the game’s network architecture, its exposed attack surface, discovered vulnerabilities, and…
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 the filename parsing loop copied untrusted data into a fixed-size stack buffer without bounds checking, and the file handler wrote attacker-supplied files to arbitrary paths.
What the attacker needed
Network access to game ports; no authentication required
The fix
Community patches address the issues, but EA declined to fix or issue CVEs for the legacy title.
How it was found
- Send a crafted NETCOMMANDTYPE_FILE packet with an overly long filename to a game peer.
- Trigger the stack overflow and control the instruction pointer.
- Use a ROP chain to allocate executable memory and run shellcode.
- Alternatively, send a file message with a .dll filename to drop a malicious library.
- Restart the game to load the dropped DLL for persistence.
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.
The game listens for network messages from other players. One part of the code copied a filename from a message into a fixed-size box without checking length, so a long name spilled over and let an attacker run their own code. Another part saved files sent by other players anywhere on disk, so a malicious file could be placed and loaded later.
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.