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

chore: invites should use special invite ID, not project public key #571

Merged
merged 3 commits into from
Jun 11, 2024

Conversation

EvanHahn
Copy link
Contributor

A sophisticated bad actor who knows a project's public ID could spam invites to determine whether someone was in a project.

Now, they need the harder-to-get "project invite ID", which is a separate generated value.

Closes #559.

A sophisticated bad actor who knows a project's public ID could spam
invites to determine whether someone was in a project.

Now, they need the harder-to-get "project invite ID", which is a
separate generated value.

Closes [#559].

[#559]: #559
Copy link
Member

@gmaclennan gmaclennan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok to me. A surprising amount that needed changed! I got bored and didn't completely read the changes to the tests, but the rest looks ok with a couple of minor comments.

src/mapeo-manager.js Show resolved Hide resolved
src/utils.js Outdated Show resolved Hide resolved
* @param {Readonly<Buffer>} projectKey
* @returns {Buffer}
*/
export function projectKeyToProjectInviteId(projectKey) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this belongs in @mapeo/crypto, so that we can version it separately. We can move it in a follow-up PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EvanHahn added a commit to digidem/mapeo-crypto that referenced this pull request Jun 11, 2024
Similar to `keyToPublicId`, this adds a `keyToInviteId` for deriving an
invite ID.

This was originally added in `@mapeo/core` but should live here instead.
See <digidem/mapeo-core-next#571>.
@EvanHahn EvanHahn merged commit 31edfb3 into main Jun 11, 2024
7 checks passed
@EvanHahn EvanHahn deleted the evanhahn/559 branch June 11, 2024 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invites shouldn't use project public key, but instead project invite ID
2 participants