Get AI summaries of any video or article — Sign up free
The Unfixable ARM Memory Bug thumbnail

The Unfixable ARM Memory Bug

The PrimeTime·
5 min read

Based on The PrimeTime's video on YouTube. If you like this content, support the original creators by watching, liking and subscribing to their content.

TL;DR

ARM MTE is designed to crash on tag mismatches for every load and store, using pointer-embedded tags matched against memory tags.

Briefing

ARM’s Memory Tagging Extension (MTE) is designed to stop memory corruption by crashing the CPU when a pointer’s embedded tag doesn’t match the tag on the memory it’s accessing. A new research effort demonstrates a path to bypass that protection on ARM systems anyway—by combining speculative execution with a cache side channel to infer the correct memory tag, then using the recovered tag to make the protected access succeed. The result is a “memory bug” that isn’t just a software flaw; it targets a core hardware security mechanism meant to be robust against exactly this class of exploitation.

The attack builds on two realities of modern CPUs. First, memory corruption bugs like buffer overflows remain a common entry point for control-flow hijacking, because overwriting return addresses can redirect execution. Second, speculative execution—introduced to keep performance high when branch predictions are wrong—can temporarily perform operations that should not architecturally complete. Even when speculative paths are discarded, microarchitectural effects (especially cache behavior) can still leak information.

MTE works by attaching a tag to pointers and requiring that tag to match the tag associated with the target memory on every load and store. If the tags mismatch, the CPU raises an exception, preventing the corrupted access from proceeding. The researchers’ key move is to make the CPU speculatively dereference pointers in a way that would normally trigger a tag mismatch—yet avoid the crash because the faulting behavior doesn’t become architecturally visible during speculation. Instead, the attack measures whether a “test” pointer’s access caused the relevant cache lines to be filled. By timing those cache effects, the attacker can determine whether the guessed tag was correct.

Concretely, the method uses a speculative gadget: a code pattern that creates two pointers within the same 16-byte memory block so they share the same underlying tag context, then speculatively dereferences a guest pointer (the target) and a test pointer (controlled by the attacker). If the test pointer’s tag guess is wrong, the CPU won’t bring the corresponding data into cache in the way the attacker expects. If the guess is right, cache fill timing changes. Repeating this process lets the attacker iterate through candidate tags until the correct one is inferred.

Once the correct MTE tag is learned, the attacker can “launder” a pointer—effectively reconstructing a pointer that will pass MTE checks—and then proceed with traditional exploitation goals like stack smashing. The work also shows the technique can be carried out inside the V8 sandbox environment (the JavaScript engine used by Chrome and Node.js), by identifying “MTE leak gadgets” within V8 code paths that provide the needed speculative behavior. That combination—hardware protection bypass plus sandbox escape potential—raises the stakes beyond a theoretical CPU quirk, because it suggests the mitigation can be undermined in real-world, widely deployed software stacks.

Overall, the core finding is that MTE’s promise (“mismatched tags crash”) can be defeated when speculative execution and cache timing are used together to recover the tag before the protected access occurs. It’s a reminder that performance features built into CPUs can become security liabilities when attackers can measure the side effects they leave behind.

Cornell Notes

ARM’s Memory Tagging Extension (MTE) is meant to stop memory corruption by crashing when a pointer’s tag doesn’t match the tag on the memory being accessed. Researchers show a way to bypass that protection by using speculative execution plus a cache side channel to learn the correct tag anyway. The attack relies on speculative dereferences that avoid architecturally visible crashes, while still producing measurable cache-fill differences. By iterating guesses and timing cache effects, the attacker reconstructs a pointer that passes MTE checks and then continues with exploitation. The work further demonstrates the approach using “MTE leak gadgets” found inside the V8 sandbox, making the threat more practical.

How does ARM MTE normally prevent memory corruption from turning into an exploit?

MTE attaches a tag to pointers and requires that tag to match the tag associated with the target memory on every load and store. If the tags mismatch, the CPU raises an exception, stopping the corrupted access. The transcript also notes that the tag is effectively embedded in the pointer (described as 16 bits hiding in the first 16 bits of the pointer), so overwriting or forging pointers without the right tag should trigger a crash.

Why does speculative execution matter for breaking a protection like MTE?

Speculative execution lets the CPU run instructions ahead of the current control flow based on predictions. During speculation, operations that would normally fault (like a tag mismatch) may not become architecturally visible, meaning the CPU doesn’t necessarily crash the program in the way it would if the access were committed. However, speculative work can still change microarchitectural state—especially cache contents—creating a side channel that attackers can measure.

What role does the cache side channel play in the MTE tag leak?

The attack times whether a “test pointer” dereference caused the relevant cache lines to be filled. If the guessed tag is wrong, the speculative access won’t result in the expected cache fill behavior; if the guessed tag is correct, timing differences reveal that the data was effectively brought into cache. By repeating the process across tag candidates, the attacker can infer the correct tag.

What is a “tic tag gadget” (as described here), and why is it important?

A “tic tag gadget” is a code pattern that supports the speculative leak workflow: it sets up an address to leak, triggers speculative branching, and then allows the attacker to observe the outcome (via cache timing). The transcript describes researchers finding gadget templates and then searching for usable snippets inside real software—specifically within V8—so the leak can be performed in a sandboxed environment.

How does learning the MTE tag enable follow-on exploitation like stack smashing?

After inferring the correct tag, the attacker can craft or “launder” a pointer so it passes MTE checks during subsequent loads/stores. With MTE no longer blocking the corrupted memory access, the attacker can proceed with classic exploitation steps such as overwriting control data (the transcript references stack smashing and return-address overwriting as the typical endgame).

Why is demonstrating the attack inside V8 sandbox significant?

If the leak can be performed inside V8, it suggests the technique isn’t limited to contrived proof-of-concept programs. The transcript describes researchers identifying multiple MTE leak gadgets that work within the V8 VM, implying that JavaScript sandbox contexts could be a realistic target for tag-leak-based bypasses.

Review Questions

  1. What two CPU behaviors must be combined to turn MTE from a crash-based defense into a measurable side-channel leak?
  2. Explain how an attacker can avoid an MTE-triggered crash while still learning something useful from the speculative path.
  3. Why does finding MTE leak gadgets inside V8 increase the practical risk compared with a purely theoretical CPU attack?

Key Points

  1. 1

    ARM MTE is designed to crash on tag mismatches for every load and store, using pointer-embedded tags matched against memory tags.

  2. 2

    Speculative execution can perform tag-mismatching operations without triggering an architecturally visible crash, leaving measurable microarchitectural traces instead.

  3. 3

    Cache timing acts as the side channel: whether a speculative dereference fills cache lines reveals whether a guessed tag is correct.

  4. 4

    The attack iterates through tag guesses until timing indicates the correct tag, then uses that knowledge to craft pointers that satisfy MTE checks.

  5. 5

    Once MTE checks are bypassed, traditional memory corruption exploitation paths (like return-address overwriting) become feasible again.

  6. 6

    Researchers report MTE leak gadgets inside the V8 sandbox, suggesting the bypass can operate in widely deployed JavaScript environments.

Highlights

MTE’s “mismatched tags crash” guarantee can be undermined when speculative execution prevents the crash from becoming architecturally visible while still leaking via cache timing.
The tag leak works by repeatedly guessing a tag for a test pointer and using timing to detect when the speculative access causes cache fill.
The researchers tie the technique to real-world code by finding MTE leak gadgets inside V8, not just in isolated examples.

Topics

  • Memory Tagging Extension
  • Speculative Execution
  • Cache Side Channel
  • V8 Sandbox
  • Pointer Tagging

Mentioned

  • Ed Lowle
  • ARM
  • MTE
  • V8