feat(auth): add seal-key-derived pubkey integrity tags with auth enforcement and unseal backfill #43

Manually merged
Skipper merged 0 commits from Client-key-replacement-attack into main 2026-04-05 08:26:59 +00:00
Member

closes #40

closes #40
CleverWild added 1 commit 2026-03-29 22:17:40 +00:00
feat(auth): add seal-key-derived pubkey integrity tags with auth enforcement and unseal backfill
Some checks failed
ci/woodpecker/pr/server-lint Pipeline failed
ci/woodpecker/pr/server-audit Pipeline was successful
ci/woodpecker/pr/server-vet Pipeline failed
ci/woodpecker/pr/server-test Pipeline failed
a02ef68a70
Skipper requested changes 2026-04-02 19:12:00 +00:00
Skipper left a comment
Owner

ed25519 signing and generalization plz

ed25519 signing and generalization plz
@@ -49,6 +49,7 @@ pem = "3.0.6"
k256.workspace = true
rsa.workspace = true
sha2.workspace = true
hmac = "0.12"
Owner

not sure we should bring hmac.
maybe better approach would be to derive ed25519 key from root key and sign with that.

not sure we should bring hmac. maybe better approach would be to derive ed25519 key from root key and sign with that.
Skipper marked this conversation as resolved
@@ -170,2 +173,4 @@
}
/// Derives a dedicated key used only for user-agent pubkey integrity tags.
pub fn derive_useragent_integrity_key(seal_key: &mut KeyCell) -> KeyCell {
Owner

I would generalize this piece of code for all data that might require signing by seal key.
there is no point in specializing it for useragent pubkey only, and in future (very near future) we might need to sign every piece of data.

For example, program client, grants, etc -- all should be signed, because in practice this attack applies to each database table

I would generalize this piece of code for all data that might require signing by seal key. there is no point in specializing it for useragent pubkey only, and in future (very near future) we might need to sign every piece of data. For example, program client, grants, etc -- all should be signed, because in practice this attack applies to each database table
CleverWild marked this conversation as resolved
@@ -257,6 +262,28 @@ impl KeyHolder {
}
// Decrypts the `aead_encrypted` entry with the given ID and returns the plaintext
Owner

comment drifted

comment drifted
CleverWild marked this conversation as resolved
@@ -223,0 +314,4 @@
return Err(Error::UnregisteredPublicKey);
};
let Some(expected_tag) = self.try_sign_pubkey_integrity_tag(pubkey).await? else {
Owner

this is a very dangeours code.
Better solution long term would be to return AttestationStatus enum instead of ().
I image those variants:

  • Attested
  • NotAttested (db tamper detected)
  • Unavailable (db sealed)
this is a very dangeours code. Better solution long term would be to return `AttestationStatus` enum instead of `()`. I image those variants: - Attested - NotAttested (db tamper detected) - Unavailable (db sealed)
CleverWild marked this conversation as resolved
@@ -88,2 +86,4 @@
}
}
async fn backfill_missing_useragent_pubkey_integrity_tags(&mut self) -> Result<(), Error> {
Owner

nice thinking, but this is not needed because we are pre-deploy. So it's fine to make breaking changes

this is probably llm output tho

nice thinking, but this is not needed because we are pre-deploy. So it's fine to make breaking changes ~~this is probably llm output tho~~
Author
Member

Your both guesses are right. That was my order to LLM to implement this :3

Your both guesses are right. That was my order to LLM to implement this :3
Author
Member

And... should I remove this or what?

And... should I remove this or what?
Owner

yes

yes
Skipper marked this conversation as resolved
CleverWild added 3 commits 2026-04-04 10:15:11 +00:00
feat(auth): implement attestation status verification for public keys
Some checks failed
ci/woodpecker/pr/server-audit Pipeline was successful
ci/woodpecker/pr/server-lint Pipeline failed
ci/woodpecker/pr/server-vet Pipeline failed
ci/woodpecker/pr/server-test Pipeline failed
ci/woodpecker/pr/useragent-analyze Pipeline failed
0bb6e596ac
Skipper added 2 commits 2026-04-04 12:31:08 +00:00
fix(server): previously, user agent auth accepted invalid signatures
Some checks failed
ci/woodpecker/pr/server-lint Pipeline failed
ci/woodpecker/pr/server-audit Pipeline was successful
ci/woodpecker/pr/server-vet Pipeline failed
ci/woodpecker/pr/server-test Pipeline failed
ci/woodpecker/pr/useragent-analyze Pipeline failed
352ee3ee63
Skipper added 1 commit 2026-04-04 12:32:07 +00:00
refactor(user-agent): remove backfill pubkey integrity tags
Some checks failed
ci/woodpecker/pr/server-audit Pipeline was successful
ci/woodpecker/pr/server-lint Pipeline failed
ci/woodpecker/pr/server-vet Pipeline failed
ci/woodpecker/pr/server-test Pipeline failed
ci/woodpecker/pr/useragent-analyze Pipeline failed
4a50daa7ea
Skipper added 1 commit 2026-04-04 12:33:54 +00:00
housekeeping(server): fixed clippy warns
Some checks failed
ci/woodpecker/pr/server-audit Pipeline was successful
ci/woodpecker/pr/server-vet Pipeline failed
ci/woodpecker/pr/server-lint Pipeline failed
ci/woodpecker/pr/server-test Pipeline failed
ci/woodpecker/pr/useragent-analyze Pipeline failed
01b12515bd
Author
Member

@Skipper, is it assigned?

@Skipper, is it assigned?
Skipper manually merged commit 7aca281a81 into main 2026-04-05 08:26:59 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MarketTakers/arbiter#43