A Security Analysis of CheriBSD and Morello Linux
This paper analyzes the security of CheriBSD and Morello Linux, demonstrating that despite the CHERI architecture's effectiveness against memory corruption, existing compartmentalization mechanisms remain vulnerable to bypass through simple bugs and attacks, and proposes specific mitigations and recommendations to address these weaknesses.
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 a high-security bank vault. In the past, if a thief broke a window (a software bug), they could run wild inside the bank, stealing everything from the teller's desk to the CEO's safe.
To stop this, engineers built a new kind of vault called CHERI. Instead of just locking doors, they gave every single item in the bank a special "magic key" (called a capability). This key doesn't just say "open this door"; it says, "You can open this specific door, but only between 9 AM and 5 PM, and you can only look inside, not touch anything."
The goal of CHERI is Compartmentalization: dividing the bank into tiny, isolated rooms. If a thief breaks into the "Gift Shop" room, the magic keys they find there should only let them open Gift Shop doors. They shouldn't be able to walk into the "Vault" room.
This paper is like a security audit report. The researchers asked: "If a thief gets into the Gift Shop, can they still sneak into the Vault?" They tested this on two different versions of the bank system: Morello Linux and CheriBSD.
Here is what they found, explained simply:
The Core Problem: Leaking the Master Keys
Even though the walls are strong, the researchers found four ways the "Gift Shop" thief could steal keys that open the "Vault."
1. The "Stack Walking" Attack (Looking in the Trash)
The Analogy: Imagine that every time a bank employee does a task, they write notes on a sticky note and stick it on a stack on their desk. When they finish, they move to the next task, but sometimes they forget to throw away the old sticky notes.
The Attack: The thief in the Gift Shop looks at the stack of sticky notes left behind by previous employees. They find a note that says, "Here is the key to the Vault." Because the system didn't clean up the notes (the memory), the thief steals the key and walks right into the Vault.
The Fix: The researchers suggest that the bank should have a "clean-up crew" that wipes every sticky note off the desk immediately after use, or give every employee their own private desk so they can't see each other's notes.
2. The "Dlopen" Leak (The Glitchy Map)
The Analogy: The bank has a central directory (a map) that tells you where all the rooms are. When a new room is added, the directory updates. The thief asks the directory for a map of the "Gift Shop."
The Attack: The directory gives them a map, but it's a "glitchy" version. Instead of just showing the Gift Shop, the map accidentally includes a secret list of every room in the bank, including the Vault, the CEO's office, and the safe. The thief uses this accidental list to find the keys to everywhere.
The Fix: The researchers suggest that the directory should give the thief a "sealed" map. The thief can see the map, but they can't read the secret parts of it unless they have a special seal-breaking tool (which they don't have).
3. The "Heap Scavenging" Attack (Digging in the Pile)
The Analogy: The bank has a big pile of discarded boxes (memory) in the corner. When a box is thrown away, it's supposed to be empty. But sometimes, the workers throw away boxes that still have tools or keys inside them because they forgot to empty them first.
The Attack: The thief digs through the pile of discarded boxes, looking for one that still has a key inside. If they find a key that was left behind by the "Vault" employee, they can use it to open the Vault.
The Fix: The bank needs a rule that says, "Before you throw a box away, you must sweep it clean." Or, the thief should only be allowed to dig in a pile of boxes that belongs to the Gift Shop, not the whole bank.
4. The "Heap Storing" Attack (The Time Bomb)
The Analogy: The thief grabs a box from the pile, writes their name on it, and hides it in their pocket. Later, the bank throws that same box away and gives it to a new employee.
The Attack: The thief waits. Later, they check their pocket. The box is now being used by the new employee to store the Vault's gold. Because the thief still has a "pointer" (a mental note) to that specific box, they can reach in and steal the gold, even though they aren't supposed to be there.
The Fix: The bank needs a system that "revokes" (destroys) the old keys to a box the moment it is thrown away, so the thief's mental note becomes useless.
The Results: Two Different Banks
The researchers tested these tricks on two different systems:
- Morello Linux: This system was very vulnerable. The thief could use all four tricks to break out of the Gift Shop and steal the private keys from the main Vault. It was like a bank with no security guards and dirty sticky notes everywhere.
- CheriBSD: This system was much better. It had built-in guards (called c18n and heap revocation).
- The "Stack Walking" trick didn't work because every employee had their own private desk (isolated stacks).
- The "Heap Storing" trick didn't work because the bank had a system that destroyed old keys immediately.
- However, the "Dlopen" leak and "Heap Scavenging" still worked. The thief could still find the secret map and dig through the dirty boxes.
The Big Takeaway
The researchers built a "Proof of Concept" (a test case) where they successfully stole a private key (like a master password) from a secure program using the "Dlopen" leak.
The Conclusion:
The CHERI architecture is a fantastic new invention that stops many old-school thefts (like smashing through walls). However, the software running on top of it (the operating systems and libraries) still has bugs. These bugs act like open windows or lost keys, allowing a thief to bypass the security even if the walls are strong.
The paper concludes that while the hardware is secure, we need to fix the software (clean up the sticky notes, fix the glitchy maps, and sweep the boxes) to make the system truly safe.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.