Skip to content
DoS Disclosed report Intermediate

[MK8DX] Improper metadata validation 2

The tournament metadata parser in Mario Kart 8 and Mario Kart 8 Deluxe did not validate chunk IDs against the expected range, so an out-of-range ID caused a read from a null pointer. An attacker could create a tournament whose metadata crashed any player who opened the Tournament menu.

crazy_man123 Follow

Originally disclosed on HackerOne

High 8.2 View original
  • Triaged in 17 hours
  • Fixed in 3 months
  • Paid in 3 months
  • Disclosed after 8 months

Summary by the program

Summary by the researcher

Introduction

This vulnerability impacts:

  • Mario Kart 8 Deluxe on the Switch
  • Mario Kart 8 on the WiiU

The vulnerability was fixed for Mario Kart 8 Deluxe the 9 March, 2023 with the release of v2.3.0 The vulnerability was fixed for Mario Kart 8 the 3 August, 2023 with the release of v4.2 (or v81 for the internal version)


 

The competition/tournaments (SimpleSearchObject) contains a 'metadata' field, it is used by the game to store tournament data such as:

  • Competition name (ID 2)
  • Description (unused but still exists, ID 4)
  • Red/Blue team names (if applicable, ID 7/8 respectively)
  • Icon type (ID 3)
  • etc ...

It's stored with the ChunkData format: (stored in little endian for MK8DX)

ChunkData

Type Description
uint16_t Magic (0x5a5a, 'ZZ' in ASCII)
ChunkDataList[] List of chunk data 'list', goes until end marker
uint8_t End marker ( 0xff)

ChunkDataList

Type Description
uint8_t ID
uint16_t Length
T Any data of size 'length' (previous field)

The ChunkDataList class in the client code can only hold a given range of ID (choosen by the dev, it's an argument of the constructor) the range is [0;12[ for MK8/MK8DX), the parsing code didn't have any range check (at least in production), so any "out-of-range" ID would trigger a read on a nullptr (because it didn't find a buffer with the given ID), triggering a crash of the process/console (depending on the platform).

So if you created a tournament with metadata containing an ID > 11 < 255 it would crash anyone loading your tournament


 

Impact

Combined with the bug that allowed to create official competitions, you could crash any players opening the "Tournament" menu

The original report as published on HackerOne, by crazy_man123. 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

Root cause

The metadata parsing code looked up a buffer by chunk ID without checking the ID was within the supported range, so an unknown ID led to a null pointer read.

Impact

An attacker could crash the game for any player who opened the Tournament menu, and combined with a separate bug allowing official competitions to be created, this could affect any players.

What the attacker needed

Ability to create a tournament; victim opens the Tournament menu

The fix

The vulnerability was fixed in Mario Kart 8 Deluxe v2.3.0 and Mario Kart 8 v4.2.

How it was found

  1. Create a tournament whose metadata contains a chunk ID above the supported range but below 255.
  2. Have a player open the Tournament menu so the game loads that metadata.
  3. The game reads a null pointer and the process or console crashes.

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.

Tournament data is stored as a list of labelled pieces, each with a number (an ID) saying what it is. The game assumed every ID would be one it knew about, and when it met an unexpected number it looked in an empty slot and crashed. Because other players load your tournament data, a crafted tournament could crash their console.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More by crazy_man123

View all

5 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.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.