-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Password protect the JSONRPC interface #3374
Comments
Even if a hacker got access to your wallet somehow it's still encrypted with strong password i hope. |
The JSONRPC interface is not about your personal wallet at home. It is mostly used by web servers for remotely executing commands, like handling a wallet via a web interface or accepting web payments. While the electrum daemon is running, someone on a different virtual host of the web server could easily access your wallet via the local RPC port. Currently, there is no security/authentication, giving someone access to the RPC port full access to the wallet. |
Hello, I'm not a bitcoin user, a colleague pointed me at this bug report because localhost RPC servers drive me crazy 😛. I installed Electrum to look, and I'm confused why this isn't being treated as a critical and urgent vulnerability? If this bug wasn't already open for months, I would have reported this as a vulnerability, but maybe I misunderstand something. The JSON RPC server is enabled by default, it does use a random port but a website can simply scan for the right port in seconds. I made you a demo. It's very basic, but you get the idea. If you did set a password, some misdirection is required, but it's still game over, no? Here is how I reproduced:
(Note: i dont use bitcoin, you can steal my empty wallet if you like) |
Looks like electrum unconditionally returns a positive CORS pre-flight check. Looks like a serious issue. |
The code doing this dates back to the original implementation: Lines 32 to 42 in 2c67de8
I suspect this should just be removed, but there may be a reason it's there? |
As far as I can tell, there is no need to allow this, and doing so poses severe security risks (see spesmilo#3374).
thanks for pointing this out. this was introduced when the jsonrpc interface was merged with the daemon 4682d95 |
Thanks for investigating so quickly, in my opinion this merits a new release and an announcement, what do you think? I think just scanning for people in the background of a website is really easy, and seems likely someone will try that. Even with encrypted wallets, you can still change options, change destination addresses, deanonymize users via Maybe there is a way to do more, like setting |
indeed we will do a new release |
As far as I can tell, there is no need to allow this, and doing so poses severe security risks (see spesmilo#3374).
As far as I can tell, there is no need to allow this, and doing so poses severe security risks (see spesmilo#3374).
As far as I can tell, there is no need to allow this, and doing so poses severe security risks (see #3374).
A new release (3.0.4) is available on the website and on Google Play, that disables CORS. |
TBH simply disabling CORS doesn’t seem to be a proper solution, given that there is plenty of software other than browsers that runs locally. I’d expect this RPC server to at least be disabled by default and, even better, password protected, given that, I suspect, the vast majority of users never use it and don’t even know that it exists. |
@kirelagin The application itself uses the RPC server to work. Password protection is currently being implemented. |
@SomberNight Oh, I see. In that case you’ll still need a way to securely agree on a password betwen the daemon and the GUI app. I mean, if you simply write the password to a file for the GUI to read, rouge local apps will also get it from there :(. |
@kirelagin Yes, I know. Though the same apps might as well go for the wallet file directly, right? |
@SomberNight Yep, you are right, there is nothing you can do about that, so that’s the problem of the user who doesn’t set a password. |
From the release notes [1]: * Fix a vulnerability caused by Cross-Origin Resource Sharing (CORS) in the JSONRPC interface. Previous versions of Electrum are vulnerable to port scanning and deanonimization attacks from malicious websites. Wallets that are not password-protected are vulnerable to theft. See this [2] for explanation. [1] /~https://github.com/spesmilo/electrum/blob/3.0.4/RELEASE-NOTES [2] spesmilo/electrum#3374
from upstream #3659, spesmilo/electrum#3374
Is it correct that without explicitly loading the wallet with |
good work guys. We ported the patch to E.C. thanks. |
@h43z It is not correct. The RPC daemon is started automatically as soon as you launch the GUI app. |
@h43z No, there is a load_wallet rpc, |
got ya guys. One can load the the wallet via rpc... 🤦♂️ |
To sum up the parts that are probably the most interesting,
|
@loshchil it is irresponsible itself if a user decides not to encrypt their wallets. However, I agree that we need a proper way to let users know there are critical bugs. |
The current situation we are in is a good example that the above-mentioned view is hard to defend if user's security is taken into account. More specifically, a few moments after the vulnerability appeared on github, a ton of responsible users who used the most recent version so far have become targets to trivial exploits (i.e., hundreds or thousands of hackers are qualified to implement them) which could allow to hack wallets with or without brute-forcing their passwords. I appreciate your proposal to come with a solution and a PR. However, I will limit my contribution to this reply here. My proposal would be to |
This fixes a critical security issue: <spesmilo/electrum#3374> * gnu/packages/finance.scm (electrum): Update to 3.0.5.
@attritionorg, invalid reference, because that bug i submitted is not by any means related to this issue, if you had properly read and understood the bug report you would understand that, but youre probably too busy sending people boxes of feces to care |
what if I never access to the previous version and deleted the wallet software? which means keeping as cold storage? |
@msadar you were only susceptible to an attack while Electrum was running and your wallet unlocked. |
It is an excellent example why you should use only the ported version: |
@ecdsa re CVE id, is there a place where we will know it has been issued? Or will you be posting it here when it has been issued? |
That sheet is for assignments requested via DWF, a CNA that handles some open source software. If you request via the form on MITRE's web site, you won't be able to look it up until it is published, or the requesting party receives the assignment and posts it here. |
Hi. Do you need help getting a CVE assigned, or is the process already in progress? I could ask the Debian security team for one, if it is useful. |
@petterreinholdtsen I filled the form on MITRE, and my request is listed on the document linked above. Is there something else I need to do? I am not familiar with the process. |
I'm not sure either, but have no better suggestion. I asked on #debian-security and it seem to be the recommended approach based on the feedback there. |
The assigned CVE for this issue looks to be CVE-2018-1000022 |
@carnil have a reference for that? CVE-2018-6353 was assigned and opened: |
CVE-2018-6353 is for #3678, a different issue. |
@attritionorg: it was apparently assigned by DWF project. I got that confirmation by MITRE, since I stumpled over the CVE when I was investigating CVE-2018-6353, which mentioned "a different vulnerability than CVE-2018-1000022". I queried about this MITRE, who confirmed that DWF has assigned the CVE (but not yet published back?). As @mithrandi stated the CVE-2018-6353 is for #3678, whereas CVE-2018-1000022 is for #3374 |
Someone could please delete file posted by @Ruethairat? |
The JSONRPC interface is currently completely unprotected, I believe it should be a priority to add at least some form of password protection.
Scans for the JSONRPC interface of Ethereum wallets have already started:
https://www.bleepingcomputer.com/news/security/theres-some-intense-web-scans-going-on-for-bitcoin-and-ethereum-wallets/
The text was updated successfully, but these errors were encountered: