Key management
Security
Blog posts
go back

Understanding the security of web3 remote signing

What we need to do about a realistic attacker model

May 1, 2023
written by
Deian Stefan
Co-Founder & Chief Scientist
Fraser Brown
Co-Founder & CTO
tags
Key management
Security
Blog posts
In the [first post of this series](https://cubist.dev/blog/staking-keys-status-quo) we went over the basics of what you need to do to secure your staking keys: (1) use a remote signing tool and (2) ensure that the remote signer both _stores_ and _signs_ in secure hardware---otherwise an attacker can just exfiltrate your keys from memory. But as we hinted in the post, this is not enough.<br> <br> ## The attacker model<br> <br> To understand what else we need, let's first look at the attacker model of a typical <a href="https://ethereum.org/en/developers/docs/nodes-and-clients/node-architecture/" target="_blank">proof-of-stake validator setup</a> with remote signing. At a high level, there are three moving pieces: the validator or consensus client (used to participate in consensus protocol), the execution client (used to execute smart contracts), and the remote signing service (used to sign requests for the validation client).<br> <br> ![validator attacker model](https://assets-global.website-files.com/638a2693daaf8527290065a3/64cbef0e247dbfc903326e17_pos_validator_attacker_model.png)<br> <br> The validator and execution clients are complex pieces of software that are exposed to untrusted network traffic and execute untrusted code, respectively. So, using a remote signer is good for security not only because it allows you to keep your keys in hardware, but also because it introduces a boundary between the complex attacker-facing code and the security critical code that handles keys. And, if we turn this boundary into a _secure isolation boundary_, we can even safeguard keys from completely compromised clients.<br> <br> ## Isolation<br> <br> Unfortunately, trying to get isolation by running an off-the-shelf remote signing tool like Web3Signer in a separate process won't cut it. An attacker that compromises a client (or any other service running on the same machine) could just read the memory of the signer process (e.g., by reading `/proc/{pid}/mem`).<br> <br> Enforcing isolation by running a remote signer in a separate VM or enclave also won't do. This is because existing tools don't consider the code that _interfaces_ with them to be untrusted: they'll (almost always) sign whatever you ask them to sign with any key at any time. The one exception to the sign-anything approach is slashing protections, but even then, existing tools assume that requests are coming from a trusted client. Retrofitting an existing tool to treat everything as untrusted is a whack-a-mole game of trying to insert the right security checks into the right parts of the codebase.<br> <br> ## Least privilege + compartmentalization<br> <br> Even if we win the game of whack-a-mole, this only solves part of the problem. Existing signers do _a lot_: they're essentially large, monolithic web apps. The code handling keys run in the same process as the code handling untrusted HTTP requests, the code parsing the untrusted JSON objects coming from other validators, the code communicating with a database that stores the anti-slashing data, the log4j code managing logs, etc. To safeguard your keys (and, e.g., sign in hardware), you would have to break this system into multiple compartments, each running with least privilege. The signing code that uses secret keys should not be able to talk to the network or filesystem, and your logging library should _definitely_ not be in your trusted computing base.<br> <br> An alternative approach---and the one we've taken---is to design the system to be least-privileged and compartmentalized from the start. Ground up, security-centric design is much easier to get right: it's far simpler to reason about what code *should* be allowed to do than to reason about what code *should not* be allowed to do. It's the same reason we all prefer allow-lists over deny-lists.<br> <br>

Read more

Cubist joins the Allora Network as a node operator

Cubist joins the Allora Network as a node operator

As a node operator, Cubist is supporting Allora’s mission by operating a validator to secure the Allora chain and a Reputer to rate the performance of the ML models delivered by Allora Workers.

April 15, 2024
Slashing risks you need to think about when restaking

Slashing risks you need to think about when restaking

A proper anti-slashing setup mitigates these risks on AVSes which have designed their protocols to be anti-slashable, but this doesn’t mean just firing up an instance of Web3Signer.

March 28, 2024
Cubist + Really and the future of movie fan engagement

Cubist + Really and the future of movie fan engagement

Our newest partner, Really, is re-imagining moviegoing. Really wallets, powered by CubeSigner, allow movie fans to use NFTs access exclusive rewards, content, and events.

December 21, 2023