Skip to content
Memory corruption Write-up Advanced

Tetsuji: Remote Code Execution on a GameBoy Colour 22 Years Later

A buffer overflow in the GameBoy Colour's Mobile Adapter GB protocol allows an attacker to execute arbitrary code on the console by sending a crafted email or HTTP response. The exploit, named Tetsuji, was demonstrated on Pokemon Crystal and is believed to be the first remote code execution on the GameBoy Colour.

xcellerator Follow

Published on xcellerator.github.io

It’s that time of year again - the Binary Golf Grand Prix is back for a third year running! You can also check out my entries to the first and second times this amazing competition ran.

xcellerator (@TheXcellerator), on xcellerator.github.io

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 buffer overflow in the game's handling of data received from the Mobile Adapter, specifically in parsing email or HTTP responses, allowing overwriting of memory and control flow hijacking.

Impact

An attacker could execute arbitrary code on the GameBoy Colour, potentially taking full control of the console.

What the attacker needed

Mobile Adapter GB accessory; GameBoy Colour with Pokemon Crystal; Attacker controls email or HTTP server

How it was found

  1. Connect the Mobile Adapter GB to the GameBoy Colour and start Pokemon Crystal.
  2. The game opens a connection to a POP3 server and retrieves an email.
  3. The email contains a specially crafted payload in its body or headers.
  4. The game parses the email and the payload triggers a buffer overflow, leading to code execution.

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 GameBoy Colour could connect to the internet using a special accessory called the Mobile Adapter GB. The game Pokemon Crystal had a feature to trade Pokemon over the internet, but the code that handled incoming data from the internet had a bug that let an attacker take control of the console. This is like a remote code execution, where someone else can run their own code on your device.

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.

More from Nintendo

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.