This document provides an analysis of the various security threats and possible mitigations that could affect the Mithril network and its participants.
This is an adversarial mindset document and aims to analyse the system from an attacker's perspective.
The threat model is a living document and is kept up-to-date with the latest mithril version
Maybe reduce and move details into architecture page
Also we should update the protocol page
System consists of three main components: signers, aggregator and clients.
Mithril signers do certify Cardano chain data using a mithril signing key. That means, mithril signers need access to a trusted cardano-node
and the mithril signing key to operate.
Mithril signing keys are rotated every epoch and need to be certified by the Cardano KES key. For this, the mithril signers need access to the KES key in order to register the signing key for this epoch.
Cardano KES keys are also used block producing cardano-node
and are typically located on the block producing machine.
Cardano KES keys need to be evolved every 36 hours, while they can be rotated from a root key when needed.
TODO: is there a Cardano threat model about this
All mithril signers and mithril clients connect to a single aggregator using HTTP over TLS.
Registering a Mithril signing key means that a signer sends its corresponding verification key to the aggregator, for the purpose of distribution to all other mithril signers.
A mithril aggregator coordinates creation of signatures by all registered signers. Mithril signers do ask the aggregater whether a signature is pending on a regular basis. The aggregator responds with information what to sign and a list of public information about all registered signers.
Each mithril signer verifies the information, produces a signature of the requested information to sign and submits that to the aggregator (which verifies the signature being correct upon receiving).
The aggregator repeatedly checks whether enough valid signatures (to reach the quorum) are available to aggregate a Mithril stake-based multi-signature into a certificate.
Mithril certificates are certifying some chain data using an aggregated multi-signature verification key and are chained up to some genesis certificate, which is signed by a genesis signing key.
Mithril clients do connect to an aggregator using HTTP over TLS to query mithril certificates for certified chain data and locate artifacts.
A mithril client can verify the received mithril certificate is linked to other certificates up to the genesis certificate and can be verified using the Mithril genesis verification key (see details).
TODO: missing: the currently recommended relay (reverse proxy)
This document is specifically targeting the standard deployment architecture where a mithril signer runs next to the block producing node, while access to the mithril aggregator is only done through a relay.
Listing dependencies for mithril-signer
% cargo-deps-list -e normal -p mithril-signer
...
slog-json v2.6.1 {default}
slog-scope v4.4.0
arc-swap v1.6.0
Total dependencies: 267
The core Mithril protocol is considered safe and its analysis is out of scope for this document, it is computationally infeasible to:
For each asset we first identify what protection is required: Availability, Confidentiality, Integrity ie. the CIA Triad
I follow Pascal's suggestion to identify assets as processes rather than particular resources, except in the case of actual pieces of data (eg. keys). The latter should be listed in the threats section and their protection mitigated
We then identify threats and countermeasures
Block diffusion process ensures the timely diffusion of blocks, both those produced "locally" and those received from upstream peers
Block production is the process of "minting" new blocks by block producers, driven by Stake-based random lottery.
The mithril-signer necessarily runs on the same host than a BP because it needs access to the KES signing key
A cardano-node maintains an on-disk database consisting of the chain's history. This database is updated by the node when new blocks are diffused through the network, or minted, and also contains a cache of the ledger state.
Mithril signer needs needs access to trusted and up-to-date Chain database in order to be able to sign snapshots.
Access to an accurate ledger state is needed by mithril signer to retrieve reliable Stake distribution. This access is currently done through a local connection (direct w/ Pallas or indirect with cardano-cli) to a trusted cardano-node
SPOs register their Mithril keys every epoch to be able to sign snapshots. An attacker could impersonate the SPO and sign invalid snapshots if they got hold of those keys
Signing keys are currently stored on-disk (?)
Mithril signer needs to register new key every epoch with aggregator (and ultimately other signers)
Mithril signers produces signatures every time a new immutable file is created in the Chain DB. Those signatures are generated from a random lottery based on the signer's stake and the protocol parameters.
Preventing mithril signers from signing decreases the number of signatures and could allow attacker to take control of the produced snapshot
Protocol parameters are needed to coordinate the production of valid multi-signatures. They are served by the aggregator
The era reader Era address and Era vkey are used by signers to extract information about the current Mithril Era which defines the structure of snapshots and therefore signatures
The key tied to the aforementioned era address
These are the assets that are relevant only when downloading and verifying certificates and full-node snapshots.
Verification process being trustless, does it really make sense to include those in the Threat Model?
Mithril clients download snapshots and verify associated certificates using the mithril-client library, either from a CLI tool or embedded in a browser
Mithril certificates are produced by the aggregator from the individual signatures. Mithril certificates' security rests upon a chain of trust ultimately pointing at the Genesis certificate. Mithril aggregator maintains snapshots and certificates (aggregated multi-signatures) to be served to clients
Mithril genesis verification key is stored in GitHub and only modifiable through an approved merged PR
The corresponding signing key is stored in IOG's VaultWarden, and used only once, when the genesis certificate is generated.
mithril-signer
running next to a cardano-node
being a relayDevelopers portal already provides thorough documentation on how to harden a linux-based host to run cardano-node