If you arrived at this thread hungry in hope of a sandwich, Iām sorry to disappoint. If you came for the ICP giveaway, youāll need to read to the end (thatās the point ). If you have an opinion about Swiss cheese, and/or are interested in minimising the chances of a ckERC20 Ledger Suite Orchestrator attack in the future, then please read and share your thoughts or questions.
Overview
In this post Iāll introduce my understanding of the ckERC20 Ledger Suite Orchestrator, and why on Earth Iām talking about Swiss cheeseā¦
-
Iāll explain why I believe this relatively new canister sets an important precedent in terms of IC NNS infrastructure and security.
-
Iāll describe why I believe the NNS needs to be capable of doing a better job of protecting this canister (and any similar canisters that follow the same precedent).
- The potential attack that Iāll describe would not be easy to pull off, and it would rely on a combination of technical know how, luck and human fallibility (and a lack of Swiss cheese). Iāll explain why I personally believe susceptibility to this attack is significantly increased with this new canister (given the current features provided by the NNS).
-
Iāll propose a simple means of removing potential for this attack.
-
Iāll ask the community to share their thoughts on whether this suggestion sounds worth while, or if Iām just being pedantic and need to lay off the Swiss cheese. See here for prior discussion that led to this post.
-
Iāll endeavour to use the word cheese at every opportunity (please let me know if I missed any good puns).
Iāll do my best to make this post easy to understand and accessible to all. Please correct me on any technical details if needed.
ckERC20 Ledger Suite Orchestrator
The Ledger Suite Orchestrator is a relatively new NNS canister in the fiduciary subnet that controls the ledger suite canisters of all ckERC20 tokens, including ckUSDC, and in due course should control a large number of other ckERC20 tokens introduced by the community. Basically, itās an important canister with a lot to be gained by an attacker if they could seize control.
The Ledger Suite Orchestrator has been expertly built by DFINITY to enable new ckERC20 tokens simply by members of the community passing the appropriate configuration to this canister (via an NNS proposal). Using this configuration the Ledger Suite Orchestrator then spawns a ledger suite for that new token and maintains control of those ledger suite canisters (facilitating ledger suite updates in the future via a configuration update proposal to the Ledger Suite Orchestrator). Importantly the WASM that the Ledger Suite Orchestrator is running does not need modifying when adding new tokens (itās just a configuration update).
System Canister Management
To my understanding, this new system canister sets a precedent in that itās the first time that the community has been encouraged to submit System Canister Management (SCM) proposals (usually prepared and submitted by DFINITY), in order for the community to introduce new ckERC20 tokens.
SCM proposals are designed to modify the WASM that a system canister is running (the change can be arbitrarily broad in scope, unlike a simple configuration update). The potential damage that can be caused by a bad actor who successfully manages to get an SCM proposal past the community is enormous.
Recall that a new ckERC20 token is just a configuration change to the Ledger Suite Orchestrator - thereās no need to modify the WASM. The proposal that enabled ckUSDC did not modify the WASM (see the canister upgrade history here and notice the unchanging hash for proposal 129750). On the other hand, note that the ckUSDC proposal itself states in the title āUpgrade Nns Canister: vxkom-oyaaa-aaaar-qafda-cai to wasm with hash: 658c5786cf89ce77e58b3c38e01259c9655e20d83caff346cb5e5719c348cb5eā. This is not at all what the proposal is essentially about - the WASM isnāt changed. This is the first sign that an SCM proposal (in its current form) isnāt the best fit for minor configuration updates to system canisters.
The Boy Who Cried Wolf
Aesopās Fables tell us a little bit about the dangers of repetitively claiming something thatās false (itās all well and good until the one time itās true, when thereās danger but no-one expects it). This can also be reframed as inattentional blindness caused by familiarity.
Imagine a scenario in the near future where there are 10s or possibly 100s of ckERC20 tokens controlled by the Ledger Suite Orchestrator. Imagine that a genuine update needs to be applied to all ledger suites (i.e. ledger, index and archive canisters) for each ERC20 token. As far as I understand, now a raft of SCM proposals would be submitted for the Ledger Suite Orchestrator canister, simply to update the Ledger Suite Orchestrator configuration which repoints each ledger suite to the latest version they should be running.
- 1st post update: @christian has clarified that a single proposal updates all ledger suites (thanks Christian). In such case my concerns lie with the addition of new ledger suites (which was my original concern)
- 2nd post update: What if the ledger suite config schema is updated to include more fields, requiring more information from the original submitters? In this scenario, I could imagine numerous ledger suite update proposals needing to be submitted by various community members In any caseā¦
None of these proposals should modify the WASM that the Ledger Suite Orchestrator itself is running, yet the proposals are required to include the ānewā WASM that the Ledger Suite Orchestrator should be running (even though it shouldnāt have changed). This is because the NNS does not provide a means of passing along the configuration without also specifying a new WASM to run.
Note that there are ways to make WASM hashes look very similar (but not identical) to a target hash, despite the WASM itself containing any number of changes (which can be nefarious). Build verification isnāt required for this proposal, because thereās nothing new to build. Instead itās sufficient to check that the proposed hash is the same as the hash for the WASM that the Ledger Suit Orchestrator is currently running (unless the Ledger Suit Orchestrator itself genuinely needs updating - e.g. 130342). As far as I understand, all it would take would be a well timed Trojan Horse, and some conditioned complacency and/or fatigue from voters (eyeballing the hashes, relying on uniformly randomly distributed hashes looking very different). This could lead to a very convincing looking SCM proposal (to make an expected minor configuration update to a single ledger suite) instead nefariously modifying the Orchestrator and seizing control over all ckERC20 ledger suites.
Note that this attack isnāt specific to updating existing ckERC20 ledger suites. Itās also potentially exploitable in the process of adding new ledger suites (itās hoped that thereāll be many).
This attack isnāt something Iām concerned about happening imminently, and itās also one that may never happen. Nonetheless, itās something Iām concerned about if the number of ckERC20 ledger suites significantly grows (which is the plan). My opinion is that some steps should be taken so that the NNS more effectively protects against this possibility in the future, and thereby make it much easier for voters to spot when something doesnāt look right (i.e. a proposal to modify the WASM of a system canister that simply has no business being modified for the proposed change).
Where does the Swiss Cheese come in?
No, itās not because IC is a Swiss-based foundationā¦ The Swiss Cheese model of incident causation is a well known model for understanding how significant incidents can occur in complex systems.
Putting it simply, layers of Swiss cheese represent layers of protection, but no single layer is perfect and has vulnerabilities. Itās important to layer these mitigating protection mechanisms, so the vulnerabilities of some processes or mechanisms are compensated by the strengths of others.
The opposite approach would be to intentionally leave out or remove layers of cheese (layers of protection) in a hope that it will encourage the other layers to function more effectively. This isnāt something that I would recommend, but something similar has been suggested - and this is what has prompted me to write up this post to get more opinions in the mix.
What am I suggesting?
Iām actually not suggesting anything that hasnāt been done before to help secure system canisters. Consider how the Bitcoin Canister receives configuration updates - itās a dedicated proposal to execute a specific function on the canister, passing along the configuration payload from the proposal (no WASM update misleadingly indicated or required - this specific attack vector simply isnāt there).
To avoid an endless explosion of NNS functions, I would suggest a single NNS function thatās agnostic to the specific canister and update function to call (this would be specified in the proposal). Iām not necessarily suggesting a need for a new NNS proposal ātopicā, just an NNS proposal ātypeā (so does not need to have any burden to the community in terms of updating neuron following).
Another approach would be to build tooling for easier verification, but this would likely be off-chain and involves more uncertainty than simply removing the attack vector.
What does the community think? Is this a threat worth investing a small amount of development time to protect against? Would it also simplify the process of enabling new ckERC20 tokens (not requiring the proposer to build and submit the Ledger Suit Orchestrator WASM even though theyāre not changing it)? Would it also make the proposals less misleading? Would it help protect system canisters from future changes that only require configuration updates, and nothing more? Would it make reviewersā and votersā lives easier (and safer)?
Thanks for reading, I have the ICās best interests at heart and thatās my only reason for putting time into this post
Reading this through once more, I didnāt use the word cheese anywhere near as much as Iād promised. My apologies.
Please note that I posted this as a follow-up to a discussion on another thread. I planted an Easter Egg in that thread - 5 ICP and a notional trophy to anyone who can find it (first come first serve, claim by identifying the Easter Egg and pointing it out in a reply to this post).