Pulsars
0 %
Log inSign up

Concrete attacks

Micro-architectural attacks (cache, Spectre)

The previous attacks targeted hardware you hold in your hand. Micro-architectural attacks, on the other hand, are carried out through software, between two programs that share the same processor — in a server, a cloud, your own browser.

The culprit: the shared cache

To go fast, a processor keeps recently used data in a small, very fast memory, the cache. The consequence is crucial for security:

  • accessing data present in the cache is fast;
  • accessing data that is absent forces a trip to main memory: that is slow.

This simple time gap is a side channel. And since the cache is shared between programs, a spying process can probe what another has left behind.

Flush+Reload: spying through the cache

The Flush+Reload technique exploits this gap when a memory area is shared (a common library, for example):

   espion              cache partagé          victime
  1. flush -----------> [ ligne vidée ]           |
  2. attend                              calcule (accède ?)
  3. reload ---------> [rapide ? lent ?] <---------|

   accès RAPIDE -> la victime y a touché (rechargé)
   accès LENT   -> la victime n'y a pas touché

By observing which slots the victim consults, the spy deduces the data — and therefore parts of the key, because the computation tables consulted depend on the secret.

Spectre and Meltdown: speculative execution

In 2018, Spectre and Meltdown caused a scandal: they exploit an optimization present in almost all modern processors, speculative execution.

To avoid waiting, the processor guesses the continuation of a program and executes instructions in advance. If the bet is wrong, it cancels the results… but the traces left in the cache remain. An attacker triggers a speculative read of a forbidden memory area, then recovers the value via Flush+Reload.

   if (i < taille_tableau):        # branche mal prédite
        y = tableau2[ tableau1[i] * 256 ]
        ^ exécuté PAR SPÉCULATION même si i est hors limites
          -> laisse dans le cache l'empreinte d'une donnée SECRÈTE
  • Meltdown crosses the barrier between a program and the operating system kernel.
  • Spectre tricks a program into leaking its own protected data.

These attacks break isolation: the guarantee that one process cannot read another's memory. On a cloud, one tenant could in theory spy on its neighbour.

The countermeasures

They are software and hardware, and often costly:

  • system patches isolating the kernel's memory;
  • barriers preventing certain speculations in sensitive code;
  • new processors fixing the flaw at the silicon level;
  • code with no memory access dependent on the secret (constant time, again).

The price to pay is sometimes a loss of performance: security against these leaks is not free.

In summary

Shared CPU caches leak information between processes: Flush+Reload deduces the victim's memory accesses through time. Spectre and Meltdown (2018) hijack speculative execution to read forbidden memory and break isolation. We protect ourselves with software patches, hardware revisions, and code with no secret-dependent access — at the cost of performance.