MobDojoStart learning free

Exploits, Tools & Data Recovery · Bug Classes & Mitigations · Lesson 3 of 5

Exploit Mitigations

The walls, shuffles, signatures and tags that make bugs much harder to use.

13 min70 XPLab in Pro

Walls, shuffles and no-run zones

Fixing every bug is the goal, but nobody gets there. So phone makers also add exploit mitigations: defenses that don't fix any particular bug, but make bugs much harder to turn into an attack, or limit the damage when one is used. Think of them as smoke alarms, fire doors and sprinklers, rather than a promise that nothing will ever catch fire.

Three have been standard for years:

None of these is perfect. A determined attacker might find a second bug that leaks where things are, or reuses code that's already allowed to run. But each mitigation forces the attacker to find and combine more bugs, which costs time and money and gives defenders more chances to catch them.

Signed pointers, tagged memory and chains

Newer mitigations are built into the chip itself.

A pointer is a note in memory that says where something else is, like "the next instruction is over there." Attackers love to overwrite pointers. Apple's Pointer Authentication Codes (PAC) add a small cryptographic signature to important pointers, made with a secret key. Before the pointer is used, the signature is checked. If someone changed the pointer, the check fails and the process stops. Apple says it was the first in the industry to ship PAC, in the A12 Bionic chip in 2018.

Memory tagging goes after the bugs themselves. Picture every block of memory and every key to it getting a matching secret color. Writing past the end of your form runs into a block of a different color. Opening a reassigned locker with an old key fails, because the locker was recolored. On a mismatch, the program is stopped instead of quietly corrupted. Arm's version is the Memory Tagging Extension (MTE).

This is why modern attacks need an exploit chain, several bugs used in sequence: one to run code, one to defeat randomization, one to escape the sandbox, and so on. Apple says the only system-level iOS attacks it sees in the wild come from mercenary spyware, with chains costing millions of dollars.

Test yourself

Can you answer these?

  1. An attacker's plan depends on knowing exactly where a system library sits in memory, but its location changes every time the phone starts the process. Which mitigation is in the way?
  2. What's the name of the Arm chip feature that gives memory blocks and the references to them matching secret tags, so a mismatch is caught? (an abbreviation or full name)

Answer them in the app to earn 70 XP (Pro).

Answer in the app