-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat: verify legitimate claim↔︎redeem by assigning a random phrase during email validation #399
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this is work-in-progress and leverages a (temporary) new route for ease of testing
the plaintext version of this is just dumped in roughly, due to storacha#356 while waiting for merge of storacha#403
6 tasks
This was referenced Feb 9, 2023
moving to #432 to merge main and fix tests |
Draft
8 tasks
Peeja
pushed a commit
to storacha/upload-service
that referenced
this pull request
Jan 17, 2025
Closes storacha#399 --------- Co-authored-by: Travis Vachon <travis@dag.house> Co-authored-by: Alan Shaw <alan.shaw@protocol.ai>
Peeja
pushed a commit
to storacha/upload-service
that referenced
this pull request
Jan 29, 2025
Closes storacha#399 --------- Co-authored-by: Travis Vachon <travis@dag.house> Co-authored-by: Alan Shaw <alan.shaw@protocol.ai>
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This branch fulfills the key piece of issue #347, adding a "validation phrase" that serves as a human-friendly nonce — enabling definitive verification of the validity of an email request.
(The other request metadata mentioned can help savvy users investigate any abuse further, but the phrase links one specific request to one specific email, completely out of the control of an attacker.)
Problem summary
The idea here is to avoid malicious account validation: currently, Eve can generate a new space keypair and request delegation against Alice's email address. Alice may not be able to tell if the request is legitimate (or may follow the activation link simply out of curiousity/confusion) and grant Eve access!
Solution provided
carat tender electronic tee guessed
.[At the moment can preview phrases via http://localhost:8787/phrase-test?bits=50 but that should likely get dropped before this PR is merged….]The
Agent.registerSpace
andAgent.recover
methods in this repo's@web3-storage/access/agent
package now take an (optional but strongly encouraged!) callback viaopts.handlePhrase
which will be called when the API provides amatch_phrase
in its response to each method's respective invocation. Thew3ui
components and any protocol documentation for third-party clients will need updating to support this on the requestor side!So this is a somewhat breaking change, but:
Note also that the phrase generation is done at an MVP or proof-of-concept level. I've generated a small word back and left the
DEFAULT_ENTROPY
forgenerateNoncePhrase
correspondingly low as well. Next steps here would be:TODO
Here:
{{ match_phrase }}
in HTML+plain emailsaccess-client
here to parse out responseOver in UI:
w3ui
low-level keyring stuff to handle phrasew3ui
high-level examples/components to display phraseThis is tracked in storacha/w3ui#307, and isn't a total blocker since you can either wait to update the templates in Postmark and/or just have the user click through even without being able to see the phrase.