-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Draft dapp html transaction authorization without CORS #107
Draft dapp html transaction authorization without CORS #107
Conversation
Nice proposal, thanks for thinking about user security, I think it's an important concern. First of all, the introduction is slightly deceptive. Users would still need to enable CORS. The benefit (as I see it) would be that the node would not need to run in account-unlocked mode, giving the user a chance to decline transaction requests. Couldn't this also be done with a middleware server in front of the RPC, that would hold the accounts, and do the signing? It seems like a fine architecture for a type of wallet, but I'm not sure I see the benefit of formalizing it into an RPC specification, since actually it's just about different account unlocking behavior, and there isn't any requirement for that account unlocking to be part of the RPC, and not part of some other wallet architecture. From the app perspective, they're still just submitting I see this mostly as a cultural proposal. We should stop asking users to run RPC nodes in account unlocked modes. Users should use wallet software or middleware to connect to unauthenticated RPCs, and should use that wallet software to regulate signatures. If some RPC servers offered features like this, it would be a good bonus, but I'm not sure I would mandate it as a requirement or recommendation for RPC nodes, as it fits nicely as an extension. |
@wighawag have you tried this at least as a proof of concept? I think it might be appealing for a number of users |
Thanks for the feedback. @FlySwatter It definitely works without CORS. The idea is that the authorization.html will be served by the node on the same rpc domain/port. I have just tested it. I had to fix a recent change as it was accessing some member of the opener window but it works again now. If you want to test it I have also created a Pull request for geth : ethereum/go-ethereum#2534 The main point for me was to have it as part of a node so that user do not require to trust anything else, hence the CORS being not required being very important. That's why it would need to be part of the RPC specification, hence the proposal here. Dapp would then be able to run on the web directly in user's everyday browser. This is for me a huge improvement to the ethereum user experience. A wallet (like mist) could even be run directly from a website without trust required. While we could argue that a dedicated wallet/dapp browser would serve the same role, I would argue that while the same role is fulfilled, it require the use of yet another software. Being able to use the user's everyday browser has a clear advantage in term of user experience. It also open access to all kind of machine that do not necessarly support a dedicated app but have a browser (they would still need a node though). In that new light, what do you think? @kumavis my dapp I am currently working on is using it. If this does not make it in the spec and the node before I launch, I still plan to use this html page but will require the user to enable CORS for the domain/port on which the html page is served. This is of course not ideal but I could alternatively offer the user a python or node script that they can download that serve the html page on a particular port. This way, trust is minimized as they can inspect the script and the page. They would still need to enable CORS but for localhost: only. |
Please forgive me @wighawag , I had initially skimmed and not understood your clever use of a This does look reasonably secure, and I now think it does actually require an EIP because it requires both the support of RPC nodes and the encouragement of Dapp developers to integrate this new iFrame protocol. A couple extra notes:
Ultimately, it's actually pretty great how simply this gets web-dapp compatibility into normal browsers. It doesn't answer larger questions about convenient account/identity management, but makes for a very efficient minimum viable ethereum browser. It wouldn't take much to add it to an RPC node, so most of the complexity is adding it to the list of things that Dapp developers should try in order to connect to a user's blockchain. I suppose we could roll all available strategies into a single recommended |
Corrected some grammar.
@FlySwatter thanks for taking the time to read it again. I am glad you see the benefits. I am not sure I follow your question regarding fixed port. The html page needs to be served on the same domain and port on which the node is listening on (for its rpc api) for it to not require CORS. But the node itself (and thus its html page) do not need to listen on localhost:8545. It does not even need to be localhost. It can be anywhere like the current nodes can. The dapp will just need to point the iframe and popup to the same url as the rpc url. I have such node (a private net) running here : http://146.185.139.84:8545 (future reader : the availability of this server is not guaranteed) The reasoning behind not allowing On that note, even in the case of Indeed, adding it to an RPC node is trivial. all the complexity reside in the html page itself. This also means that any fixes can be shared easily. Regarding dapp developer, I already made a web3-html-provider here: https://github.com/wighawag/web3-html-provider/blob/master/html-provider.js. I use it to test the authorization mechanism and this actually helped refine how the html page works internally, especially in regard to popup behaviors. The only thing the dapp developer need to do is
instead of
Note that HtmlProvider do not allow sync calls (as postMessage is async and confirmation of the user too obviously). Also, because of the usual browser's popup blocker behavior, any Thanks again for the feedback |
|
@tomusdrw thanks for the feedback. |
Hi everyone, I still think it is a bad practice to let people create transactions directly from their browser. The idea is to have some kind of control over the context in which you are susceptible of creating a transaction. Doing anything on the blockchain is very sensitive. If you do something wrong or you get fooled, you may lose everything you have on your account. More concretely, here are my two points against something like that:
|
Hi @adridadou thanks for the feedback.I personally do not think these are clear cut issues. Here are my replies:
In other word I do not see anything that make mist more trust worthy than a popup provided by the node. I think we need to take the view of the average user and dapp developer here as this is in that context that this proposal shines:
I am looking forward to the mist browser release but think having the option to allow user to interact with dapps with their everyday browser is something we should thrive to achieve. |
Hi, Any browser that wants access needs to ask to enable the capability. A whitelist is maintained per session. This way, each user know that he enters a website where Ethereum is used and it prevents phishing attacks. Then for each transaction, you need to see:
When I say that it has to be in Mist this is not Mist necessarily I'm talking more about having a special place for it. It's true that when you work on a dApp you tend to think of it as unlocking a user but it is more like leaving your online bank account session open. In any dApp manager / store, you never browse there. You usually open a specific application. Then, Mist has this logic where you have to explicitly link the dApp with an account. It takes the one account if you have only one or you can chose which one to use. So again I'm taking Mist as an example because it is the only one available today but this could be any dApp manager. So in the Mist browser, you know that you have to explicitly say for each dApp, I want to use my account on it so you are sure you won't have someone suddenly trying to make you send tx. And about phishing, imagine someone uses the system with your EIP. like everybody, he has around 20 tabs open. Now he is playing a dApp game that create a fair amount of transactions but an attacker has created a hidden page running in the background from one of the other tabs and the phisher hopes that if he creates tx in the middle of your game you won't notice it is for something else and you will confirm it. You are in the middle of your game, you have loads of tx to confirm, you don't pay attention and then you have sent ETH to your attacker. Regarding your points:
Regards |
@adridadou thanks for your comments, I like the idea of the dapp wesbite domain asking for permission before hand, this should be easily achievable. A popup would then say something like "the domain regarding the info to display:
regarding my points few clarifications:
What do you think now about the proposal? |
Hi, I am still not convinced about using your own browser for that. My main issue is that I think this is healthy to separate them. So to come again to the points:
I think that the main issue today is that Mist browser is not released with Mist wallet and therefore there is no easy way to tell to someone "come to my website with ... and play / work / do your thing". And I've been there and when I was working on my dApp I had the same idea too but then after building Mist browser I liked the security measures put in place and I think we need a controlled env where people are more aware of what they do. Again this is my subjective view, but as soon as you play with something valuable I think we need the security not only technical but social too. Especially non tech savvy ppl get easily manipulated when a message comes from a computer. I could even imagine ppl forging a false ethereum popup to steal your password and because they can see your account they can send transactions on your behalf at any time. Very interested to see the outcome of this discussion. Have a nice day |
https://blog.ethcore.io/parity-stepping-up-the-security-model-1-a-modular-approach-to-transaction-signing/ |
"Authorization fatigue" is a real problem, and @adridadou is right that it can lead to users authorizing things they didn't intend to. There are ways around this, however, by expanding the scope of authorizations: a DApp should be able to ask for permission to, for instance "Send transactions to address x with fees totalling at most y ether"; that authorization would then be good until they exhaust the allowed value. I think concerns about not allowing this in a browser are ill-founded. If we want DApps to become a part of everyday life, they have to interact with the web, not be their own little walled garden. |
EIP editor here: We've concluded that for ERCs like this, the best path to acceptance is to accept them when they have at least one implementation. Please tag with editor-needs-to-review when you feel it's ready to go. Also, please enable allow edits from maintainers |
Does the implementations need to be complete or can it just be functional ? |
Change of plans: We'll be accepting EIPs in and giving them numbers under 'draft' status. If you'd like to have this merged, please:
|
…IPs into draft-dapp-html-authorization
EIPS/eip-107.md
Outdated
@@ -0,0 +1,614 @@ | |||
<pre> | |||
EIP: draft |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please set this to 107.
@wighawag this EIP doesn't have a copyright statement. Can you please add one? EIP-1 suggests CC0 - see the |
No description provided.