Skip to content

Reading keyshare from disk makes entropy-tss vulnerable to rollback attacks from host operator #1427

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ameba23 opened this issue May 8, 2025 · 0 comments · May be fixed by #1429
Open

Comments

@ameba23
Copy link
Collaborator

ameba23 commented May 8, 2025

This possible vulnerability was brought up by @dvdplm in a conversation on slack.

The host operator of is able to read and write the disk volume the entropy-tss CVM uses. We protect the CVM by keeping almost everything in a measured ramdisk. Except for things which require persistence accross reboots.

Everything we store in persistent storage is encrypted using authenticated encryption, so we have some integrity protection. But @dvdplm points out this is still vulnerable to rollback attacks where the attacker replaces the storage with a previous valid state.

I think for this reason we should avoid reading from storage unless we have no choice. The only time we have no choice is following a reboot.

Normally, when we read the keyshare from the kvdb, it will read a cached copy from the last write from memory. But this relies on the internal behavior of sled and is not guaranteed to be the case. For this reason i propose to keep the keyshare in memory as part of application state. When mutating it, we should also write the latest state to the kvdb, but reading it should always come from memory only.

There may also be some integrity checks we can do when restoring backups to check whether it appears to be the most recent state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📋 Backlog
Development

Successfully merging a pull request may close this issue.

1 participant