The Hero's Skip and the Hacker's Leap: Exploring Null References from Hyrule to the Enterprise.
Luke Wurst
BSides Canberra VIII (2025) · Day 3 · Off-Main Track
Overview
In a captivating presentation at BSides Canberra, Luke Wurst took the audience on an unconventional journey, bridging the seemingly disparate worlds of speedrunning the classic Nintendo 64 game The Legend of Zelda: Ocarina of Time and exploiting real-world software vulnerabilities. Titled "The Hero's Skip and the Hacker's Leap," Wurst's talk aimed to demystify complex cybersecurity concepts, primarily Use-After-Free (UAF) vulnerabilities and Arbitrary Code Execution (ACE), by illustrating them through the lens of a beloved video game. His unique approach made sophisticated technical ideas accessible, demonstrating how the same fundamental principles underpin both game-breaking glitches and critical enterprise security flaws.

Key moments
- 0:00 Introduction: Zelda Ocarina of Time speedrun
- 5:45 Ocarina of Time Any% world record: 3 minutes 47 seconds
- 8:20 Understanding the Use-After-Free (UAF) vulnerability
- 12:00 Setting up the Zelda Ocarina of Time UAF exploit
- 15:00 Arbitrary code execution via controller input
- 17:50 Real-world Chromium Use-After-Free exploit example
- 19:55 Speedrunners' monumental Ocarina of Time decompilation effort
- 22:30 Protecting against Use-After-Free vulnerabilities
The Hero's Skip and the Hacker's Leap: Exploring Null References from Hyrule to the Enterprise.
Speakers: Luke Wurst
Conference: BSides Canberra
YouTube: https://www.youtube.com/watch?v=jf2J3nn7vJI
Overview
In a captivating presentation at BSides Canberra, Luke Wurst took the audience on an unconventional journey, bridging the seemingly disparate worlds of speedrunning the classic Nintendo 64 game The Legend of Zelda: Ocarina of Time and exploiting real-world software vulnerabilities. Titled "The Hero's Skip and the Hacker's Leap," Wurst's talk aimed to demystify complex cybersecurity concepts, primarily Use-After-Free (UAF) vulnerabilities and Arbitrary Code Execution (ACE), by illustrating them through the lens of a beloved video game. His unique approach made sophisticated technical ideas accessible, demonstrating how the same fundamental principles underpin both game-breaking glitches and critical enterprise security flaws.
Wurst's core premise highlights that whether the actor is a speedrunner striving for a world record or a malicious hacker targeting a system, the objective remains the same: to exploit system weaknesses to achieve a specific goal. For speedrunners of Ocarina of Time (OOT), this goal is to reach the game's end credits in the fastest possible time, often by any means necessary, including executing arbitrary code within an unmodified game. By drawing parallels between the intricate, frame-perfect exploits used in OOT speedruns and the memory corruption bugs found in modern software like the Chromium web browser, Wurst underscored the universal nature of vulnerability research and exploitation.
The talk serves as a powerful reminder that a deep understanding of how software interacts with memory and executes code is crucial for both offense and defense. It celebrates the ingenuity of speedrunning communities, whose efforts in reverse-engineering and exploiting game mechanics often parallel the rigorous work of professional security researchers. Ultimately, Wurst's presentation urges a reconsideration of how we perceive "glitches," transforming them from mere game anomalies into profound insights into system security.
Background
▶ Watch: Introduction: Zelda Ocarina of Time speedrun (0:00)
To understand the sophisticated exploits discussed, Wurst first laid a foundational understanding of key terminology and system mechanics. In the context of game development, an object is any item within the game world, while an actor is an object with which the player can interact. Actors possess specific attributes and functions – pieces of code that define their behavior. For instance, a thrown rock (an actor) might have a function to shatter upon collision. Wurst used "glitch" and "exploit" interchangeably, emphasizing that both refer to unintended behaviors leveraged for a specific outcome. He also highlighted the extraordinary skill of speedrunners, often requiring frame-perfect inputs – hitting a button within a mere 40-millisecond window – to trigger these glitches.
The case study for the talk was The Legend of Zelda: Ocarina of Time, a seminal 1998 Nintendo 64 title. While a casual playthrough might take 25-35 hours, speedrunners have drastically reduced this. Wurst revealed that the current world record for the "any%" category – reaching the end credits by any means – stands at an astonishing 3 minutes and 47 seconds in an unmodified game, a testament to the depth of its exploitation. This feat is achieved through Arbitrary Code Execution (ACE), a critical method for malicious actors in any system.
Wurst then delved into fundamental computer architecture, explaining the memory map and program counter. A memory map illustrates the allocation of memory for various components, including RAM, ROM (the game cartridge data), and I/O devices like controllers. Every interaction, from button presses to display updates, occurs through specific memory addresses. The program counter dictates which piece of machine code is currently executing. As Wurst demonstrated with MIPS CPU assembly (the N64's processor), the program counter is "relatively dumb," simply executing whatever instruction it points to. If an attacker can manipulate the program counter to point to attacker-controlled code, they can achieve ACE.
Crucially, Wurst issued a "mea culpa," clarifying that while his talk proposal mentioned "null references," the specific exploit he detailed was actually a Use-After-Free (UAF) vulnerability. A UAF condition occurs when a program frees a block of memory but then attempts to use that memory again, or when memory is dereferenced (meaning the program no longer holds a pointer to it) but not properly deallocated. This leaves a "stale" pointer or a block of memory marked as free, which can then be reallocated for another purpose while the original object's code still attempts to access or update it. This creates a highly vulnerable state, allowing an attacker to inject their data or code into a location the program unexpectedly trusts.
Key Findings
▶ Watch: Understanding the Use-After-Free (UAF) vulnerability (8:20)
The central revelation of Luke Wurst's talk is the incredible potential for Arbitrary Code Execution (ACE) within seemingly benign environments, specifically an unmodified video game like Ocarina of Time. The 3-minute, 47-second world record for Ocarina of Time's "any%" category is not just a display of gaming prowess, but a sophisticated demonstration of chaining multiple glitches to achieve a Use-After-Free (UAF) condition, ultimately leading to ACE and a forced jump to the end credits. This highlights that deep technical vulnerabilities exist even in consumer software and can be exploited with sufficient understanding and effort.
Wurst meticulously detailed how the Ocarina of Time speedrunning community discovered and perfected this exploit chain, showcasing the level of dedication required to achieve such a feat. Their work involved an exhaustive understanding of game mechanics, memory management, and processor behavior. This extensive effort by a volunteer community serves as a powerful analogy for the resources and determination that state-sponsored actors might deploy to find and exploit vulnerabilities in critical systems, as illustrated by the historical example of the Iranian hostage crisis where shredded documents were painstakingly reassembled.
Furthermore, the talk underscored the pervasive and critical nature of UAF vulnerabilities in modern software. Wurst cited statistics from Chromium, revealing that 70% of its serious security issues are memory-related, and a significant 36.1% of those are specifically Use-After-Free bugs. This finding directly connects the "game-breaking" glitches of Ocarina of Time to severe, real-world cybersecurity threats, emphasizing that the underlying memory management flaws exploited in a 1998 game are still prevalent and dangerous in contemporary, complex software systems. The talk thus establishes UAF as a fundamental and persistent challenge across the entire software development landscape.
Technical Deep Dive
▶ Watch: Arbitrary code execution via controller input (15:00)
The technical core of Wurst's presentation revolved around the intricate Use-After-Free (UAF) exploit chain in Ocarina of Time that enables Arbitrary Code Execution (ACE). In Ocarina of Time, like many games, actors (such as rocks) are loaded into memory when they are in view and their memory is typically freed when they are unloaded or no longer needed. The UAF condition arises from a specific game mechanic related to how objects are rendered and managed.
Speedrunners discovered that when the camera zooms out, certain objects, like specific rocks, cease to be rendered on screen to save system resources. While not rendered, they are still technically present in the game world and can be interacted with. Crucially, when these rocks are not rendered, a specific attribute – their ability to traverse a loading zone – is not set.
The exploit chain begins with the player performing a series of preparatory glitches, including "walking while talking," which locks the camera in place. With the camera locked, Link can navigate blindly to a specific location and pick up one of these unrendered rocks. Because the camera is locked and the rock is not being rendered, its "traversable" attribute remains unset. The player then enters a loading zone – typically a curved corridor designed to load the next area and unload the previous one. When Link, still carrying the unrendered rock with its unset attribute, passes through this loading zone, the game engine encounters an inconsistency. It attempts to manage the rock, but its state is corrupted due to the missing attribute. This results in the rock's associated memory being dereferenced (the game loses its valid pointer to the object) but not properly deallocated, creating the Use-After-Free vulnerability.
With the UAF condition established, the next phase is Arbitrary Code Execution. The "freed" memory location, now susceptible to reallocation, is targeted. Speedrunners discovered that by performing a specific action – spawning a seed from Link's slingshot – they could force the game to allocate the seed's data into the very memory location that was previously occupied by the UAF'd rock. The rotation data associated with this newly spawned seed, when interpreted as code by the MIPS CPU, acts as the initial stage of ACE. This rotation data is crafted to be a jump instruction.
This jump instruction then directs the program counter to read another piece of attacker-controlled data: the "file name" attribute associated with the slingshot. This "file name" is not a literal file name but a specially crafted sequence of bytes that, when interpreted as code, performs a critical action: it copies the first piece of this "file name" into the game's cutscene register. This register, when triggered, will play the cutscene whose ID is stored within it – in this case, the ID for the game's end credits.
To ensure the exploit works reliably and doesn't crash the game, further manipulation is required. The speedrunners discovered that by holding the Nintendo 64 controller's analog stick in a very specific position and pressing certain buttons, they could write specific machine code into a predictable memory location that the exploit would then jump to. This crafted code, combined with the cutscene register manipulation, causes the game to "void out" the player – essentially losing track of Link's position. When the game loses the player, it defaults to playing the next available cutscene, which, thanks to the attacker-controlled "file name" data, is the end credits.
The consistency of this exploit is largely due to the Nintendo 64's architecture and the era it comes from. Unlike modern systems that employ Address Space Layout Randomization (ASLR), the N64's memory addresses for functions and game data were static and predictable. This allowed speedrunners to target precise memory locations and jump to known code addresses without needing to bypass randomization, making the UAF and ACE highly reliable once the setup was perfected.
Demo / Proof of Concept
▶ Watch: Real-world Chromium Use-After-Free exploit example (17:50)
Luke Wurst’s presentation included a compelling demonstration of the Ocarina of Time exploit, serving as a practical proof of concept for the theoretical concepts discussed. While the actual triggering of the exploit itself was described as "incredibly boring" – merely bringing a rock back into view to trigger a function – the setup and the immediate consequence were anything but.
The demonstration started by showing a modified version of Ocarina of Time that visualized the attributes associated with game objects, specifically highlighting how a rock's properties change or remain unset under certain conditions. This visual aid helped to concretize the abstract idea of an attribute not being set when an object is not rendered.
The core of the demo then walked the audience through the elaborate exploit chain:
- Preparation: The player acquires the Ocarina and Slingshot.
- Camera Lock: The "walking while talking" glitch is performed, locking the camera in a fixed position.
- Blind Navigation: Link is guided blindly to a specific location where an unrendered rock can be picked up. The visual effect showed Link moving without the player seeing the environment, emphasizing the precision and memorization required by speedrunners.
- Loading Zone Traverse: Link then moves into a loading zone while still carrying the "corrupted" rock.
- UAF Trigger: As Link exits the loading zone, the camera snaps back, and the rock above Link's head disappears. This visual cue signifies the moment the Use-After-Free (UAF) condition is established.
- Arbitrary Code Execution: The subsequent steps of spawning the seed/slingshot and positioning the analog stick, while not visually dramatic, were explained as the crucial inputs that inject and execute the arbitrary code.
- End Credits: The immediate and dramatic outcome: the game abruptly cuts to the end credits, completely bypassing the remaining gameplay.
This demonstration effectively illustrated the phenomenal complexity involved in identifying and exploiting such issues. It showed how a seemingly minor glitch in rendering logic could be chained with other game mechanics to achieve full arbitrary code execution and dictate the game's flow. By showcasing this in a familiar context, Wurst made the abstract concepts of UAF and ACE tangible and comprehensible, directly linking the "hacker's leap" in a video game to the types of vulnerabilities researchers find in modern, complex software like Chromium.
Defensive Implications
▶ Watch: Protecting against Use-After-Free vulnerabilities (22:30)
The detailed exploration of Use-After-Free (UAF) vulnerabilities and Arbitrary Code Execution (ACE), particularly through the lens of Ocarina of Time and Chromium, carries significant defensive implications for modern software development and cybersecurity practices.
Firstly, the talk strongly advocates for the adoption of memory-safe languages. As highlighted, languages like Rust and Java inherently prevent many common memory corruption issues, including UAF. Rust, in particular, achieves this through its strict ownership and borrowing rules, which ensure that pointers are always valid and memory is properly managed, thus making it "immune from use after free and many other memory exploits." For organizations still relying on languages like C or C++, which offer direct memory access, secure coding practices are paramount. This includes diligently setting pointers to null immediately after freeing memory and ensuring that memory is deallocated correctly and only once.
Secondly, the importance of patching and software updates cannot be overstated. The Ocarina of Time exploit, for instance, only works on version 1.0 of the Japanese game. Subsequent versions likely patched the specific glitches that enabled the UAF condition. This mirrors the real world, where vulnerabilities are constantly discovered and patched. Regular, timely updates to all software, from operating systems to applications and browser components (like Chromium), are a fundamental defense against known exploits.
Thirdly, modern security features like Address Space Layout Randomization (ASLR) are critical. The Ocarina of Time exploit's reliability stemmed from the predictable memory layout of the Nintendo 64, where functions and data resided at fixed addresses. ASLR, by randomizing the memory locations of key executable areas, makes it significantly harder for attackers to predict where to jump or inject code, thereby complicating ACE. Defenders should ensure ASLR and other exploit mitigations (such as Data Execution Prevention - DEP) are enabled and properly configured across their systems.
Finally, the talk implicitly emphasizes the sheer complexity of modern systems. As demonstrated by the Chromium bug fix, the interdependencies between hundreds of packages make it incredibly difficult to identify and resolve every potential memory issue. This complexity underscores the need for robust testing, including fuzzing and static/dynamic analysis tools, to uncover these subtle vulnerabilities. For defenders, understanding these low-level memory concepts is not just an academic exercise but a practical necessity to build resilient systems and effectively counter sophisticated threats.
Key Takeaways
- Use-After-Free (UAF) is a Pervasive and Critical Vulnerability: Whether in a classic video game like Ocarina of Time or a modern browser like Chromium, UAF vulnerabilities represent a significant and common class of memory corruption bugs that can lead to severe security implications, including Arbitrary Code Execution.
- Complex Exploits Often Chain Multiple Subtle Glitches: Achieving advanced exploits like ACE typically requires chaining several seemingly minor flaws or unintended behaviors. The Ocarina of Time speedrun demonstrates how an intricate sequence of frame-perfect inputs and environmental manipulations can lead to a powerful exploit.
- The Dedication of "Amateur" Communities Mirrors Professional Research: The Ocarina of Time speedrunning community's effort to decompile the entire game and meticulously document its functions for exploitation highlights an incredible level of reverse-engineering skill and dedication, comparable to professional security researchers.
- Nation-State Actors Possess Immense Resources and Motivation: The analogy of the Iranian hostage crisis underscores that if a volunteer community will go to extreme lengths for a game, nation-states with clear objectives and vast resources will dedicate even greater efforts to find and exploit vulnerabilities in critical systems.
- Memory-Safe Languages and Modern Security Features are Crucial Defenses: Adopting languages like Rust or Java can inherently mitigate many memory corruption issues. Additionally, modern exploit mitigations such as Address Space Layout Randomization (ASLR) and consistent patching are essential layers of defense against UAF and ACE.
- Understanding Low-Level Memory Concepts is Vital for Robust Security: For both offensive and defensive security professionals, a deep understanding of how software interacts with memory, manages pointers, and executes code at a fundamental level is indispensable for identifying, preventing, and mitigating sophisticated vulnerabilities.
About the Speaker(s)
Luke Wurst is a passionate and engaging speaker, driven by a desire to simplify complex technical topics for a broader audience. His presentation at BSides Canberra showcased his unique ability to draw insightful parallels between seemingly unrelated fields, using the intricate world of The Legend of Zelda: Ocarina of Time speedrunning to illuminate the nuanced concepts of Use-After-Free vulnerabilities and Arbitrary Code Execution. Wurst's enthusiasm for the subject matter is evident, as is his deep respect for the "phenomenal skills" of both speedrunners and professional vulnerability researchers who "do this for a living." He approaches cybersecurity from an analytical perspective, emphasizing the fundamental principles that govern how actors exploit systems, whether for game completion or malicious intent.