-
Notifications
You must be signed in to change notification settings - Fork 22
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
feat: verify legitimate claim↔︎redeem by assigning a random phrase during email validation #747
Draft
travis
wants to merge
19
commits into
main
Choose a base branch
from
feat/random-phrase-auth
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
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
I removed anything that seemed related to violence and a handful that seemed like they could lead to some awkward combinations
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in 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.
Originally PR #399, moving here to merge main and make it easier to move forward.
Original message:
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.
originally opened as #432