Finding and exploiting hidden features of Animal Crossing's NES emulator
The NES emulator in Animal Crossing includes an undocumented memory card ROM loader that parses a custom file format with tag-based metadata. Several tags, such as QDS, use 24-bit offsets in memcpy operations, allowing writes beyond the loaded ROM buffer on the heap, which could lead to code execution.
jamchamb.github.io
Published on jamchamb.github.io
While looking for ways to activate the developer menus left over in Animal Crossing, including the NES emulator game selection menu, I found an interesting feature that exists in the original game that was always active, but never used by Nintendo. In addition to the NES/Famicom games that can be obtained in-game, it…
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
Impact
An attacker could write data outside the ROM buffer on the heap, potentially leading to code execution, though the heap's sanity checks and limited forward range may restrict exploitation.
What the attacker needed
A memory card file with valid checksum; a generic NES console item in-game; crafted ROM file with malicious tag
How it was found
- Create a memory card file with the required name prefix and a valid checksum.
- Craft a ROM header and include a QDS tag with a large offset value.
- Load the file through the generic NES console item in the game.
- The game processes the tag and performs a memcpy using the attacker-supplied offset.
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.
Animal Crossing contains a hidden NES emulator that can load game files from a memory card. The code that reads these files has a flaw: it trusts a size or offset value from the file and uses it to copy data into memory without checking if it stays within the intended buffer. An attacker could craft a malicious file to write data outside that buffer, potentially taking control of the game console.
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.