Skip to content
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

Please implement support for Blind Key Rotation (privacy feature) #398

Closed
kaniini opened this issue Dec 30, 2018 · 3 comments
Closed

Please implement support for Blind Key Rotation (privacy feature) #398

kaniini opened this issue Dec 30, 2018 · 3 comments
Labels
A: Backend Code running on the server A: Federation Stuff related to Federation A: Security C: Enhancement New feature or request

Comments

@kaniini
Copy link

kaniini commented Dec 30, 2018

Background

Blind Key Rotation is a mitigation for the problem that JSON-LD Linked Data Signatures are irrevocable. It is also useful (albeit less so) in the context of HTTP Signatures, since HTTP Signatures only sign headers and not the object itself, and are also detached from the object.

As Plume implements JSON-LD Linked Data Signatures, implementing Blind Key Rotation is important for resolving trust and safety issues with this signature scheme!

Implementation - receiving objects

Supporting Blind Key Rotation in the validation pipeline is simple enough: if a signature validation fails, refetch the remote actor and recheck the signature accordingly.

This would be done here:

let actor = User::from_url(&conn, actor_id).expect("instance::shared_inbox: user error");
if !verify_http_headers(&actor, &headers.0, &data.0).is_secure() &&
!act.clone().verify(&actor) {
println!("Rejected invalid activity supposedly from {}, with headers {:?}", actor.username, headers.0);
return Err(status::BadRequest(Some("Invalid signature")));
}

Implementation - deleting objects

Supporting Blind Key Rotation to enhance the deniability of deleted objects is also simple enough: send the Delete signed with the original key and then silently replace the keypair. The new keys will be fetched when the user publishes new content.

I'm not quite certain where to implement this part, but it is probably not that hard to implement.

Questions?

Contact me on fediverse: https://pleroma.site/kaniini

@mcrosson
Copy link
Contributor

An activity pub user has also opened a small bounty for this https://social.holdmybeer.solutions/objects/44515888-e4c2-4043-b0e8-96e15b7a254c

@trinity-1686a trinity-1686a added A: Federation Stuff related to Federation P: Medium A: Security A: Backend Code running on the server C: Enhancement New feature or request labels Dec 30, 2018
@trinity-1686a
Copy link
Contributor

trinity-1686a commented Dec 30, 2018

So if I understood well:

  • when receiving object: re-fetch the actor if signature validation fail
  • when sending Delete (do Undos count too?) : sign with the current key, then regenerate a new one
  • when sending other activities : work as before

Am I right?
I have a few more questions:

  • do the original key (in deleting Object) need to be the one which was used in the Create activity, or can it be an other key assuming something else was deleted between creation and deletion of this Object?
  • Keys have an id, with Plume it's currently https://<domain>/@/<user>/#main-key. Should this value be updated whenever a new key is issued, or not?
  • Should the new key be "advertised" as soon as the Delete activity is sent, or some time later (how much?) to make sure instances who did not know the key for this Delete can still fetch it to validate the deletion?

@kaniini
Copy link
Author

kaniini commented Dec 30, 2018

@fdb-hiroshima

Your understanding is basically correct. I would suggest rotating the key a little while after the Delete so if there's multiple Delete activities you can batch them together.

The original key should be whatever key would normally sign the Delete.

The key ID should not ever be updated when rotated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: Backend Code running on the server A: Federation Stuff related to Federation A: Security C: Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants