Skip to content
Memory corruption Disclosed report Advanced

NEX: Stack overflow in UnicodeToUtf8

A stack overflow in the UnicodeToUtf8 function used during matchmaking allowed an attacker to send a malicious IP address that, when converted, could crash or execute code on victim consoles. On 3DS and Wii U, remote code execution was immediate due to lack of ASLR; on Switch, RCE required bypassing ASLR.

kinnay Follow

Originally disclosed on HackerOne

Informational View original
  • Disclosed after 6.5 years

Summary by the program

Summary by the researcher

During match making, Nintendo games send an IP address to the game server, which forwards it to other consoles in order to facilitate NAT traversal. The receiving console converts the IP address from a platform-specific encoding to UTF-8. On the 3DS, Wii U and Switch, the function that does the conversion was vulnerable to a stack overflow.

In Switch games, an attacker could crash the game on a victim console, or gain remote code execution if the attacker is able to bypass ASLR. In 3DS and Wii U games, an attacker could immediately gain remote code execution through ROP, since there are no ASLR protections in place.

Due to the way that NAT traversal is implemented, an attacker could request the server to send the exploit to many consoles at once.

The vulnerability was fixed by validating the IP address on the server before forwarding it to other consoles.

More details about the vulnerability can be found here.

The original report as published on HackerOne, by kinnay. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

Impact

An attacker could crash the game on a victim console, or achieve remote code execution if ASLR could be bypassed (Switch) or immediately (3DS/Wii U), and could target many consoles at once via the matchmaking server.

What the attacker needed

Attacker participates in matchmaking; victim console receives forwarded IP

The fix

The vulnerability was fixed by validating the IP address on the server before forwarding it to other consoles.

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.

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 by kinnay

View all

2 more disclosed reports, best first.

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.