How Ethereum can be stolen through DNS rebinding
ret2got.wordpress.com
ret2got.wordpress.com
This is ludicrous. If a torrent client considers this class of bug to be a vulnerability[1], I don't see why folks who are trying to revolutionise money (something that is far more important than a few small RCEs) don't. While it is true you need to run it with the --rpc option, I'm confused why the RPC is unauthenticated by default, and whether there is any front-end that will start up the RPC server in the background (similar to electrum).
[1]: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-5702
And Ethereum is actually terrible.
How could anyone not consider this a vulnerability when it has an actual CVE assigned to it?
The discussion in the github issue also shows they took it pretty seriously: https://github.com/transmission/transmission/pull/468
On a single-user machine, an attack scenario where authenticating localhost would actually do some good would be some other account existing that's easier to break into than the account of the user actually doing stuff. But if no other login exists?
Modern desktops do not run at runlevel 1. All sorts of services and daemons run under different users, so having an unauthenticated service listening on localhost is less secure even on a desktop machine. If you have network services running on a desktop machine (common) then a simple RCE in an unprivileged user (with respect to the human user) can result in wallet compromise. If the API was authenticated that would not be possible.
Unix DAC protects users from one another, so any service which exposes personal information outside of the currently running user has objectively inferior security to a security model invented in the 1960s.
That's why a lot of the more technical people really dislike ethereum. It's not one or two problems. The entire system all the way through want made with the mentality of compromising stability in favor of getting features sooner.
Tech folk should be excited about blockchain but the hysteria over exchanges right now is off-putting once you understand how deeply rigged the markets are. My next venture will be blockchain-based but I have a few years before I'm free to pursue that. I'd rather see the fundamentals of the tech improved in the meantime rather than have it prematurely hyped and have the bubble pop as I seek to raise funding...
I imagine there are many others who are in the position of wanting to build apps based on blockchain tech but who are not yet able. For us, slow and steady wins the race.
Saying "they're missing the mark on marketing" about the second-largest crypto by market-cap, and surely top-5 in terms of ongoing development is at the very least a bit ironic. They exactly did NOT miss the mark on marketing. There are other technically superior products that don't get nearly as much funding, public attention, development resources etc.
As an entrepreneur, though, the market makes the final decision on whether you make money, whether it's "right" or "wrong." If you're "right" when the market is "wrong" as an entrepreneur, you lose—you're "ahead of your time" or some other pleasantry meaning "you weren't giving the market what it wanted."
If you want to sell something to the market, then if the market is irrationally exuberant, you have to be irrationally exuberant too.
Secondly, if the market is wrong and you dance to that tune, eventually when reality catches up the market will realise it’s mistake. Trust me, the market can sell out of your company faster than you can pivot your entire business model.
But sure, it is possible to make money following trends. But it’s not the only way. It’s not an immutable law of capitalism, and there’s plenty of money to be made providing actual, sustainable value.
Yes, but it is risky. If you don't follow trends/buzzwords you have two threats: 1) You bet that many people (the market) are wrong and you are right. Possible, but unlikely. 2) You bet that after these many people (the market) come to senses and realize that they were wrong (remember: nobody likes to admit that they were wrong), they acknowledge that you are right and buy your product. As the funny saying goes: "the market can stay irrational longer than you can stay solvent".
But in a way, being a market leader gives a lot of adoption and a big ecosystem of tools produced by other developers - which in this space means a lot, because a blockchain's usability increases with adoption, even somewhat exponentially.
The approach that a couple of currencies have taken (including the one I lead) is to make a separate blockchain entirely dedicated to their app. And I think that's a far better choice than anything out there, though it comes with the glaring downside of needing to build and run your own blockchain, which is a very difficult thing to do.
Most of the apps we are seeing today don't make any sense anyway. Very much smacks of the dotcom bubble, where people who suspected that the Internet would change the world were absolutely correct, but then the companies and ideas they put their money behind were missing the mark by miles.
We've got the same issue today. Most successful ICOs are going to fail very hard, due to known impossibilities, known poor uses of the technology, etc. It's just a general fever that has a lot of new entrants in the space innovating in the wrong direction.
It will get better. Dapp platforms will appear that make sense, have good foundations, and are easy to setup and use. But it's not around the corner, it's probably 3-5 years away.
This cannot be stressed enough. But, I disagree that building your own blockchain is the answer in comparison to using EVM. The amount of blockchains and services people might end up needing will be huge. So, it seems the correct usage for blockchain is still far out.
Bitcoin could easily be extended to have an EVM
are you talking about Script, or some other approach I don’t know about? I think it’s pretty optimistic to put the word “easily” anywhere near a proposed use of Script.
This is the crux of the problem. The cryptocurrencies with the highest valuations right now are ones with serious technical and social flaws--people are investing in cryptocurrencies based on hype rather than merit.
Ethereum is the most egregious example: the idea that a JavaScript-like language is what you'd want to write your security-intensive code in is mind-boggling-ly stupid, and after the community showed themselves to be willing to perform a 51% attack on their own blockchain to fix a problem with the DAO, it's not even decentralized any more. So technically you have all the downsides of writing secure software in JavaScript, and socially you have all the problems of centralization AND all the problems of decentralization. The security flaw this thread is about would be a critical vulnerability to any competent security developer, but it's really minor compared to the more fundamental flaws.
But even in competently-developed cryptocurrencies, the problems are still there because people don't understand or value decentralization, which is literally the entire reason Blockchain is worthwhile. The number of people who buy cryptocurrencies and then leave their coins sitting on an exchange is incredible. You're literally donating money to the world's biggest bug bounties when you do that.
The only reason you think the cash in your portemonai is worth something is that everybody else things the same. As soon as everybody stops believing it, the paper in your wallet can still be used to make fire. Same goes for authorities. Judges, policemen, presidents are what they are because everybody believes it. We have already an informal consensus of who is a policeman and who is not. Most of the time it resolves to whether somebody wears the uniform. Crypto tech promises to make this verifiably. No need for uniforms.
Huh? No. Distributed consensus was formalized in 1978 by Leslie Lamport and the first version of Paxos was introduced in 1989. If you're okay with centralization, Paxos or it's successor, Raft, are much faster and more scalable algorithms than blockchain, and have a wide variety of mature implementations.
Qtum sounds like the thing you could be looking for. To TL;DR; it, Qtum is a smart contract platform on an independent blockchain that supports PoS (not DPoS, true PoS) and designed to support multiple smart contract VMs. Right now it only supports the EVM and thus can only run Solidity smart contracts, but later this year we'll release a new VM based on the x86 architecture so that it will be possible to use mainstream languages like C++, Rust, Go, etc...
Anyway, ending the whole description bit, we built it because of similar thoughts as you. Tired of seeing the only suitable smart contract platform (Ethereum) be treated like some philosophical research project, rather than a platform that businesses and people stake hundreds of millions of dollars on. Everything we design is intended to be practical to not just use, but also implement. We pride ourselves in never missing any deadlines we set for ourselves, and in never having some pipe dream project that won't be ready to use for 5 years.
The truth is that the EVM is perfectly secure and the problems with Solidity are due to the fact that any new smart contract development environment was bound to have problems at the initial stages.
Solidity is being rapidly improved and there are several other programming languages under development for the EVM as well.
As for market significance, Ethereum is the only smart contract platform that's relevant.
There are now over a million MetaMask installations that can interact with any Ethereum Dapp, and millions of MEW wallets that can hold ERC20 tokens.
Ethereum-based tokens saw their share of the total token market cap grow from 73% to 92% from July 2017 to January 2018. The platform has 30X more developers working on it than the next most active one.
That means that almost all of the decentralized exchanges and other value-adding applications are compatible with the ERC20 standard, creating a positive feedback loop of encouraging new projects to build on Ethereum.
Ethereum is more likely than not going to be the platform for smart contract development.
lots of resources here, also recommend mentioning the discord here
This is where the primary technical discussion happens, and where all the devs hang out. Our company is here, mobile wallets are our first product :)
https://github.com/CityOfZion/OzoneWalletIOS https://github.com/CityOfZion/neo-swift
* This is a "browser bypass of SOP" issue. All your "unauthenticated" local services should be vulnerable.
* A good part of Geth's usage is for servers that do not browse the internet.
* You usually do not handle accounts inside of a geth node, instead you open the node's API via RPC and have another tool that sends already-signed transactions to it. That means that this attack would probably not yield much if not allow someone to use the geth node as a public node to query public information.
* If you do decide to handle accounts in there, you would probably (1) not open the node with RPC and (2) have the accounts be encrypted. See Ethereum's documentation[1] :
> It supports interactive mode, when you are prompted for password as well as non-interactive mode where passwords are supplied via a given password file. Non-interactive mode is only meant for scripted use on test networks or known safe environments.
[1]: https://github.com/ethereum/go-ethereum/wiki/Managing-your-a...
This specific problem is easily mitigated. However, for most people who dabble in cryptocurrencies, they don't realize relying on security and setting defaults is just asking for trouble.
DNS rebinding to bypass SOP is an old and known issue. There is nothing
particular about geth being vulnerable to this.
* The RPC api is not the primary protection against theft of ether, users are
encouraged to have a long and difficult password, presumably difficult to
bruteforce.
* Although I cannot find the ticket right now, we're already considering
being even more strict on Origin, so that geth would not accept
POST-requests from non-whitelisted Origin:s (by default).
https://www.reddit.com/r/netsec/comments/7s7cz9/dns_rebindin...I'm not sure about the first bullet point. You have to unlock your accounts before calling any balance-changing methods but I don't know if there is a default time after which the accounts get locked again.
Even if there is, isn't there a time period while your accounts would be vulnerable?
As this seems easily mitigated by a simple security token, I don't see why they shouldn't implement this.
How are DNS rebinding attacks not a valid vulnerability?
The vulnerability is allowing the service to run without authentication.
Rather, it's a problem of DNS resolvers and browsers.
Additionally this requires not having a password on your wallet.
Now your next mistake will be saying ‘but typically there’s only one user’ which is irrelevant because the system runs services as different users for isolation purposes and this vulnerability ignores this isolation.
This is true over http and browsers, as well as internal servers, sockets, and cross frame communication. There are no such things as trusted internal services, just services that have not yet been breached (looking at you hardware vendors).
> I regularly encounter users who don’t accept that websites can access services on localhost or their intranet. These users understand that services bound to localhost are only accessible to software running on the local machine, and that their browser is running on the local machine – but somehow believe that accessing a website “transfers” execution somewhere else. It doesn’t work like that, but this is a common source of confusion.
For example in unbound there's
private-address: <IP address or subnet>
Give IPv4 of IPv6 addresses or classless subnets. These are
addresses on your private network, and are not allowed to be
returned for public internet names. Any occurrence of such
addresses are removed from DNS answers. Additionally, the DNSSEC
validator may mark the answers bogus. This protects against
so-called DNS RebindingAnd for dns blacklists you can exempt their domains from these rules.
The thing I’m most disappointed with is that because we’ve been so lax about 127.0.0.1 and it’s usage, it’s become a means of different applications to blackhole requests suchas ad-blocking networks.
Better than that though, are the applications that are using localhost resolution from public names to communicate with local versions of their applications from the browser.
The sad thing, is that because of these we can’t just make a simple resolution policy. The one I would like to be true is that only localhost names can resolve to localhost (this doesn’t require any remote resolution), and that you must whitelist private domains for private address spaces (e.g. 10/8). For localhost it’s a very simple area in resolution code to drop RData with 127.0.0.1, private address spaces would need a little more but still easy to identify when to apply it.
For now it seems that we have to rely on applications to do a better job of using things like TLS to validate the endpoints to which they are connecting and verifying that the IP is in the expected scope.
There are many simple solutions (force auth, xsrf token) and it is mind-boggling that these mitigations are not considered standard-issue in the space.
---
We originally rejected the bounty report because:
* We always recommend people communicate with Geth via IPC, not HTTP. The APIs are too powerful for public access: even if noone can steal your Ether, they can exhaust all your local resources via eth_call for example. Our suggestion is to always run a custom proxy that properly rate limits and authenticates outside users vs. running an HTTP server inside Geth. CORS is a protection that always depends on browsers correctly enforcing it, which have been circumvented multiple times, so it's not a good enough security measure. * For a very long time now, we considered unlocking an account a dangerous operation recommended only to power users who can properly protect their setup. Mist and other applications transact via API endpoints that do not unlock accounts, so unless a user explicitly manually unlocks their account, they should be fine.
That being said... even though we consider the attack vector fairly convoluted and would require a lot of bad user practices to pull off; we agreed that if we can do anything meaningful to prevent it, then we should most definitely do that. For that reason we introduced the `--rpcvhosts` flag which is similar to CORS, but checks the requests origin via different means, and rejects DNS rebound HTTP actions server side.
As for the original report, although we rejected the bounty request initially, we agreed that it should be rewarded with a low-impact value since we did make a software modification based on the report. Unfortunately this bounty decision is waiting for approval since the 5th of February. Not sure why it got stuck in the pipeline, we apologize for the delay.
Sounds like a normal DNS rebind, nothing that is strictly a problem of ethereum.
Routers have had the same exact problem for years and it's been partially solved by filtering DNS answers on their side.
The easiest solution, of course, would be that browsers consider the origin of any domain pointing to 127.0.0.1 different to localhost itself. Or something in that postcode/general direction.
I do think that Ethereum ought to authenticate it's JSON-RPC service, but not because of DNS rebinding.
> I do think that Ethereum ought to authenticate it's JSON-RPC service, but not because of DNS rebinding.
Not so with many other firmwares.