← Latest papers
💻 computer science

Detecting speculative leaks with compositional semantics

This paper introduces a novel framework based on speculative non-interference (SNI) and a compositional semantics approach to formally detect and reason about information leaks caused by speculative execution, implemented in the Spectector tool to verify software defenses against Spectre-like attacks.

Original authors: Xaver Fabian, Marco Guarnieri, Boris Köpf, Jose F. Morales, Marco Patrignani, Jan Reineke, Andres Sanchez

Published 2026-04-01
📖 5 min read🧠 Deep dive

Original authors: Xaver Fabian, Marco Guarnieri, Boris Köpf, Jose F. Morales, Marco Patrignani, Jan Reineke, Andres Sanchez

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine your computer's processor is a super-fast, over-eager chef in a busy kitchen.

The Problem: The "Guessing Chef" and the "Spilled Soup"

To save time, this chef doesn't wait for the customer to finish ordering the whole meal before starting to cook. Instead, the chef guesses what the customer wants next.

  • If the customer says, "I'll have the soup," the chef immediately starts chopping vegetables for the soup while the customer is still deciding on the main course.
  • If the guess was right, great! The soup is ready instantly.
  • If the guess was wrong (the customer actually wanted a salad), the chef throws away the chopped vegetables and starts on the salad.

Here's the security flaw: Even though the chef "threw away" the chopped vegetables (the computer "rolls back" the wrong guess), the mess remains. The knife is still on the cutting board, the counter is stained, and the smell of the vegetables lingers.

In the real world, this "mess" is called a speculative leak. Attackers (like nosy neighbors) can sniff out these traces to steal secrets (like passwords or encryption keys) that the chef was only pretending to cook with. This is how the famous Spectre attacks work.

The Old Way: Checking One Ingredient at a Time

Before this paper, security experts tried to find these leaks by checking one type of guess at a time.

  • "Is the chef guessing the order of dishes correctly?" (Branch prediction)
  • "Is the chef guessing the ingredients correctly?" (Memory prediction)

The problem is that modern CPUs are like a kitchen with dozens of different guessing mechanisms happening all at once. Sometimes, a leak only happens when two specific guesses interact.

  • Analogy: Imagine a leak only happens if the chef guesses the order wrong AND guesses the ingredient wrong at the same time. If you only check the order, you miss the leak. If you only check the ingredient, you miss it too. You need to check the combination.

The Solution: A "Compositional" Kitchen Audit

The authors of this paper built a new framework called Spectector. Think of it as a modular kitchen audit system.

1. The "Always-Wrong" Chef (The Safety Net)

Instead of trying to guess exactly how a specific chef thinks (which is hard because every CPU is different), they created a model of a chef who always guesses wrong.

  • Why? If a program is safe even when the chef makes the worst possible mistakes, it's definitely safe when the chef makes good guesses. This simplifies the math and covers all bases.

2. The Lego Blocks (Compositional Semantics)

This is the paper's biggest innovation. Instead of building one giant, unmanageable model of the whole kitchen, they built small, specialized Lego blocks.

  • Block A: Models how the chef guesses the order of dishes.
  • Block B: Models how the chef guesses the ingredients.
  • Block C: Models how the chef guesses returning from a task.

The magic is that they can snap these blocks together.

  • If you want to see if a leak happens when guessing order and ingredients together, you just snap Block A and Block B together.
  • The paper proves mathematically that if Block A is safe and Block B is safe, then the combined Block A+B is safe unless they interact in a dangerous way. This allows them to test 18 different combinations of guesses without having to write a new proof for every single one.

3. The Detective Tool (Spectector)

They turned this theory into a software tool called Spectector.

  • You feed it a piece of code (like a recipe).
  • Spectector simulates the "Always-Wrong Chef" using the Lego blocks.
  • It checks: "If the chef guesses wrong, does he leave a trace that reveals a secret?"
  • If yes, it flags the code as Insecure.
  • If no, it proves the code is Secure.

Why This Matters

  1. It Finds Hidden Leaks: It found leaks that previous tools missed because those leaks only happened when two different guessing mechanisms worked together.
  2. It's Future-Proof: Because the system is built like Lego blocks, if a new type of "guessing" is discovered in future CPUs, researchers just need to build one new block and snap it onto the existing ones. They don't have to rebuild the whole kitchen.
  3. It Checks the Fix: It can also verify if a "patch" (like a compiler update that adds safety barriers) actually works, or if the compiler accidentally added a barrier that wasn't needed (wasting performance).

The Bottom Line

This paper gives us a universal, modular way to audit computer security against the "guessing" tricks of modern processors. It moves us from checking one isolated trick at a time to checking how all the tricks work together, ensuring that even our most eager, over-optimizing chefs don't accidentally spill our secrets.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →