11 ms·
Curl’s backdoor threat
- deleted 9y ago[deleted]
- aidos 9y agoI guess I'm a bit cynical but this seems hand wavy to me. (Note, I love curl and implicitly trust it). The argument that it would probably take too much code and would be too obvious doesn't seem solid. I'm no expert in this area but curl sends data over a network and sometimes runs as part of a larger application. It seems like the big dangerous bits are there and it wouldn't take a major bug to send the wrong thing.
- shakna 9y ago> There is only one way to be sure: review the code you download and intend to use. Or get it from a trusted source that did the review for you.
- elnygren 9y agoAgreed. However, this is unfeasible/impractical. Ain't nobody got time for that. Are there any commercial or non-profit organisations that maintain lists/repos of audited and trusted software with their checksums? It seems like there would a demand for a package manager like that. I suppose some Linux distros have pretty OK repositories? I wouldn't trust npm, pip, gem etc. though.
- shakna 9y agoThat's the second half of the quote: > Or get it from a trusted source that did the review for you. Incidentally, curl has been reviewed by the Mozilla Secure Open Source project [0], who maintain lists of audits which include checksums within the report. Maybe you're looking for something similar? [0] https://wiki.mozilla.org/MOSS/Secure_Open_Source https://wiki.mozilla.org/MOSS/Secure_Open_Source
- pjmlp 9y agoWhich version? In order for this process to be truly secure, every single software version needs to be audited.
- Xylakant 9y ago7.50.1 The repost can be found here https://wiki.mozilla.org/images/a/aa/Curl-report.pdf https://wiki.mozilla.org/images/a/aa/Curl-report.pdf You don't have to do a full audit on each version, auditing the deltas should be fairly comprehensive. Now, there could be some malicious code hidden that gets triggered by a begnin change, but otoh, no audit ever will guarantee full security.
- justonepost 9y agoThe best way is just defect density. How often do vulns show up? How serious are they? It's always a judgement call of course.
- Buge 9y agoHow is there an argument that it would take too much code? He gives the example of how inserting an off-by-one error can lead to complete compromise of your machine. Inserting an off-by-one error shouldn't be too much code.
- ghgr 9y agoBackdoors in software is one of those nightmarish scenarios that disturbs you until you just think about something else and kind of temporarily forget it (like nuclear war, killer bees, climate change or asteroid impact). Open Source just raises the bar but in no way solves these problems (for example OpenSSH's roaming feature/bug, OpenSSL and Heartbleed). In computing one can quickly become paranoid: software buttons for switching smartphones off (are they 'really' off?), always-on microphones, webcams (granted, you can cover it), blobs in your smartphone and home router, downloads from http://download.cnet.com http://download.cnet.com (note the lack of https), winscp, putty from www.putty.org (again, no https, which is not even the actual site, but nevertheless the first result from Google). In Linux the landscape is slightly better, but do you really trust all those packagers? Do you really understand each line of code when you "git clone foo; cd foo; ./configure; make; sudo make install"?, and in X11 you can easily make a key-logger without even being root! [1]. And not even full disk encryption can protect us (Evil Maid [2]). That's one of the reasons I'm skeptical of the Ethereum smart-contract concept. In theory it works, but in practice I'm not sure at all. The DAO heist was one early example of security bugs in smart contracts, but I fear they will become more common when malware developers turn to "contract-engineering". [1] https://superuser.com/questions/301646/linux-keylogger-without-root-or-sudo-is-it-real https://superuser.com/questions/301646/linux-keylogger-witho... [2] https://www.schneier.com/blog/archives/2009/10/evil_maid_attac.html https://www.schneier.com/blog/archives/2009/10/evil_maid_att...
- Buge 9y agoReminds me of badBIOS[1]. A security researcher became sure he was infected by a very advanced piece of malware that could hide itself completely. Many people think it was just his imagination. [1] https://arstechnica.com/information-technology/2013/10/meet-badbios-the-mysterious-mac-and-pc-malware-that-jumps-airgaps/ https://arstechnica.com/information-technology/2013/10/meet-...
- zdkl 9y agoAnd then the intel ME debacle became widely known and, as usual, the tinfoil hatted among us got to say "told you"
- synicalx 9y agoNot sure the title really conveys the right message here, genuinely thought I was about to read some kind of porn parody.
- _h_o_d_ 9y agoadvice before you get hellbanned: jokes like this are frowned upon and against the forum culture. Best to giggle to yourself instead.
- pvg 9y agoYou don't get 'hellbanned' for dumb jokes.
- mulle_nat 9y agoWhy does it say [flagged] when it's clearly [deleted] ?
- deleted 9y ago[deleted]
- andrew3726 9y agoI guess its because it was deleted by moderators instead of deleted by himself.
- deleted 9y ago[deleted]
- pvg 9y agoIt was flagged by users and then 'dead' because of the number of flags. You can turn on 'showdead' to see it. It wasn't deleted by moderators, they're generally quite open in the (rare) cases they modify a comment or ban a user.
- j_s 9y ago
- angrygoat 9y agoThe sort of hypothetical security vulnerability here is likely to depend on undefined behaviour (buffer over-runs, subverting parsers, etc etc). Just another reason to continue moving over to safe languages, especially for the lower level bits of our stacks. HTTP is big and complicated, I'm much happier exposing Rust/Go/C#/... to it than I am exposing C to it. In safe languages, backdoors must be far more explicit, so we close off the likely scenario posited here.
- moxious 9y agoThere's a good chance that if you were to rewrite some of today's existing stack in new languages you'd end up with more bugs, not fewer. C may be awful in some respects but for quality it's going to be hard to beat 15 years of peer review with any new languages cool features.
- StavrosK 9y agoThat makes no sense. There has been a ton of research. C, needing to be backwards-compatible, can only implement a subset of that research. More modern languages, not having this burden, are free to implement the entirety of this research. Therefore, C can only be at most equal to new languages, and overwhelmingly likely worse.
- jsymolon 9y agoMakes a lot of sense. You have 2 scenarios; 1) old code base in C, rewrite in language du jour. 2) new functionality in either C or spiffy lang 2.0 (SPIFFY). For scenario 1, all that functionality has to be duplicated, including "defects". Are you sure that the functionality is 100% there or did you miss any use cases? Decision for leaving it. Scenario 2, new widget. Most likely, coding in SPIFFY will be a better choice.
- sitkack 9y agoRun old anomalous traffic on old codebase that can handle the corner cases. Run the new traffic over the safe code that covers 80% of the use cases. Slowly expand the percentage of traffic coverable by the new safe code. The 80 percent case can be written and coded in a small amount of time. In curls example, it is fetching a file over http 1.1 using an encoding, possibly following some redirects. Then post and put requests, then chunked uploads, downloads, then? Need gopher and ftp? Run the old codepath.
- raesene6 9y agoThis is a very real threat for all software, open source and commercial, and hard to completely fix. That said there are a number of possible mitigations and the fact that they're not more widespread is, to me, an indication that people who rely on software don't think that this threat is worth the trade-off of the additional costs or time that mitigating it would take. For example :- - Requiring packages signed by the developers for all package managers (e.g. https://theupdateframework.github.io/ https://theupdateframework.github.io/ ) . This would help mitigate the risk of a compromise on the package managers hosting, but we see many large software repositories that either don't have the concept or don't make much use of it (e.g. npm, rubygems, pip) - Having some form of third party review of software packages. It would be possible for popular packages like curl to get regular security reviews by independent bodies. That doesn't completely remove the problem of backdoors but it makes it harder for one to go undetected. This one has obvious costs both in financial terms and also in terms of delaying new releases of those packages while reviews are done. There are some things which act a bit like this (e.g. bug bounty programmes) but they're not uniform or regular. - Liability for insecure software. Really only applies to commercial software, but at the moment there doesn't seem to be much in the way of liability for companies having insecure software, which in turn reduces their incentives to spend money addressing the problem. I'm sure a load of commercial software includes curl or libcurl, but if there was a backdoor in it that affected that sofware, I don't think the companies would have any liability for it at the moment, so there's no incentive for them to spend money preventing it.
- _pmf_ 9y ago> No. I’ve never seen a deliberate attempt to add a flaw, a vulnerability or a backdoor into curl. That's exactly what someone who has deliberately put a backdoor into curl would say.
- wiz21c 9y ago> Since most of them were triggered by mistakes in code I wrote myself, I can be certain that none of those problems were introduced on purpose Definitely. The issue here is now, how can we be collectively sure that the code is safe...
- im3w1l 9y agoYou can be sure that the code is unsafe. Along with almost all other code.
- tobltobs 9y agoNext paragraph after the one you quoted: > If I had cooperated in adding a backdoor or been threatened to, then I wouldn’t tell you anyway and I’d thus say no to questions about it.
- thinkMOAR 9y agoAs others write, this is not specific to curl and strict explicit egress filtering, the best (and imho only) safety, pain in the ass initially but avoid connections to any non whitelisted destination.
- davedx 9y agoI'm reading a book called 'Nexus' at the moment. Last night I read a part where they are deliberately installing a backdoor in their own system. They do it by modifying the compiler itself to inject malicious machine code into the binary. It's hands down the best technical description of hacking I've ever read in a work of fiction - highly recommended.
- Taniwha 9y agoAlready been done - it was the subject of Ken Thompson's Turing award paper http://delivery.acm.org/10.1145/360000/358210/reflections.pdf?ip=203.86.204.69&id=358210&acc=OPEN&key=4D4702B0C3E38B35%2E4D4702B0C3E38B35%2E4D4702B0C3E38B35%2E6D218144511F3437&CFID=983668164&CFTOKEN=60374561&__acm__=1505206740_44d52154950e9825dd69d394ccfb7d90 http://delivery.acm.org/10.1145/360000/358210/reflections.pd...
- Sean1708 9y agoYour link doesn't seem to work for me, but I presume you're talking about Reflections On Trusting Trust[0]? [0]: https://www.ece.cmu.edu/~ganger/712.fall02/papers/p761-thompson.pdf https://www.ece.cmu.edu/~ganger/712.fall02/papers/p761-thomp...
- Taniwha 9y agoyes, thanks - looks like the ACM hands out temp URLs
- noir_lord 9y agoIf you like that kind of book check out Daniel Suarez. Daemon had me hooked, it's great when an actual techie does sci-fi.
- andrewflnr 9y agoLooks interesting. Have you read Charles Stross (developer, sometime HN poster) and Vernor Vinge (CS professor)?
- bambax 9y ago> I’m convinced the most likely backdoor code in curl is a deliberate but hard-to-detect security vulnerability Evil organisations and/or big government agencies are probably working on finding vulnerabilities and using them without reporting them. That sounds more efficient and impossible to spot or prove, than trying to implement backdoors directly.
- WalterBright 9y agoSince one of the backdoor methods mentioned was introducing a memory safety bug (like a buffer overflow), one way to reduce the attack surface is to use a memory safe language. The thing is, one can write memory safe code in C. The problem is the difficulty in verifying it is memory safe. I've opined before that this is why, soon, people will demand that internet facing code be developed with a memory safe language.
- gfredtech 9y agoImmediately you mentioned memory safety, Rust is the language that came to mind. Memory safety is indeed important, but I find it hard to believe that in the future, ~80% of mainstream system tools will be migrated from C/C++ to Rust. Is it possible or has there been any attempts to write standalone tools that are able to check before compile-time that a particular C/C++ program won't have buffer overflows/dangling pointers? I don't expect such a tool to catch everything, but it should at least be able to track most of such bugs. EDIT: typos
- steveklabnik 9y agohttps://github.com/Microsoft/GSL https://github.com/Microsoft/GSL is an attempt at something like this. The Core Guidelines have been in development for a long time now; and they do only catch a subset of issues. I'm all in favor of making languages safer overall though!
- xamuel 9y agoDetecting 100% of buffer overflows with 0% false alarms, would require solving the Halting Problem. For applications that demand both maximum speed as well as maximum security, the best solution is probably something like a C compiler that requires the code to be accompanied by formal proofs of defined behavior. Even this will necessarily sacrifice speed in a theoretical sense, because there are certain problems for which the fastest solution is safe but can't be proven safe within (PA/ZF/ZFC/insert any consistent foundation of mathematics you like). Eventually we'll have people writing fast programs and proving their soundness using large cardinal axioms which might or might not actually be true. Then someday one of those large cardinal axioms will turn out to be inconsistent [1] and suddenly some "proven" code will be proven no more. [1] https://en.wikipedia.org/wiki/Kunen%27s_inconsistency_theorem https://en.wikipedia.org/wiki/Kunen%27s_inconsistency_theore...
- shp0ngle 9y agoWas there ever a big, significant backdoor in any widely used open source software? I don't mean a bug like heartbleed, but an actual intentional backdoor.
- dsr_ 9y agohttps://www.ece.cmu.edu/~ganger/712.fall02/papers/p761-thompson.pdf https://www.ece.cmu.edu/~ganger/712.fall02/papers/p761-thomp... (Reflections on Trusting Trust)
- benmmurphy 9y agotinfoil: why is he suddenly writing a blog post on how curl is not backdoored? does this mean curl is backdoored but he can't say directly that it is backdoored :)
- pdimitar 9y agoIt's a possibility, but I think he had one talk too many during which he got asked these same questions over and over again.
- sapphire_tomb 9y agoI was at dinner with Daniel the night before FOSDEM kicked off this year, and he said "I always get asked at some point in the Q&A about whether or not curl has a backdoor in it." The next day, I was due to meet a developer from a vendor organisation I'd been working with, and he came and found me during the curl talk Daniel was giving. Because the talk was ongoing, I didn't really get a chance to say hello to him or anything. Cue the Q&A section. My vendor contact sticks his hand up, and is the first person to be picked to ask a question. His question "Have you put any backdoors in curl?". You couldn't make it up. [edit] I can't spell "Daniel" :(
- Perados 9y agoSometimes I wonder, what would happen if one of these invisible heroes dies ? What would happen to Linux if Linus Torvalds dies? What would happen to curl is Daniel Stenberg dies? For curl for instance, only Daniel can sign a release. So what happens if he is not able to do so anymore? This is just a small example, but you get the idea. There is so much power under under these men that it sometimes gets very scary.
- hyyypr 9y agohttps://en.wikipedia.org/wiki/Bus_factor https://en.wikipedia.org/wiki/Bus_factor
- Perados 9y agoThank you for this! Will always keep it in mind!
- daenney 9y ago> For curl for instance, only Daniel can sign a release. I don't believe that's quite true. Anyone can sign a curl release, so can I. It's just that Daniel's key being used to sign a release of curl carries the trust that this is legitimate. If he were to pass away or be somehow incapacitated, another curl maintainer could start signing the releases.
- kowdermeister 9y agoI have a trusted friend and he will receive a mail when I'm gone automatically. Things like this are handled in it. It sucks to think about it, but I'm glad that I've set up Gmail's inactive account manager this way.
- vacri 9y agoThe Linux kernel is a massive project with a web of contributors and maintainers, and it's clear which of the senior level members could step in at any given time. Big open-source projects have plenty of meatspace to draw on. It's the little projects that 'come from somewhere' that actually only have one or two people 'in the know' that are the ones at risk.
- snomad 9y agoThis is why servers /network should be configured to reject/prevent out bound calls by default, only allowing connections from a white list.
- notacoward 9y agoThe bit about code signing is really important. The people who wrote distro package managers recognized this years ago, and ever since have at least tried to do the right thing. That can make getting code into those repos a bit cumbersome, but that's kind of the price you pay. Unfortunately, most of the language- and environment-specific package managers have pretty much ignored that issue. There's too often no way to verify that the code you just downloaded hasn't been tampered with. Heck, half the time you can't even be sure it's a version that's compatible with everything else you have. It's a total farce. Software distribution is too important, security-wise and other-wise, to leave it to dilettantes as an afterthought to other things they were doing. Others should follow curl's example, instead of just dumping code into an insecure repo or (even worse) putting it on GitHub with a README that tells users to sudo the install script.
- moobsen 9y agoAssuming one can trust git and GitHub (and CAs), is there a technical reason why you would consider distributing code via GitHub as unsafe?
- sneak 9y agoStolen GitHib credentials. The code is what we are trying to verify, not that someone claiming to be user x published it.
- bitexploder 9y agoThat is basically the same as trusting `apt install`. We just hope apt repo maintainers have higher levels of opsec. Most trust on a typical Ubuntu install, for example, is still chained back to an TLS download of an ISO (or maybe torrent file). That bootstraps your repo public keys.
- aeroevan 9y agoYou should always be verifying your downloads: https://tutorials.ubuntu.com/tutorial/tutorial-how-to-verify-ubuntu#0 https://tutorials.ubuntu.com/tutorial/tutorial-how-to-verify...
- otakucode 9y agoIt could simply be my lack of in-depth understading of curl, but wouldn't curl make for a pretty weird target for a backdoor? It doesn't serve content or remain running for long periods of time, does it?
- FrancoisBosun 9y agoNo it doesn't, but what if you can be convinced to use a compromised version of curl that downloads a compromised nginx? This is the threat model that we are looking at here. That's why we should always verify signatures for packages we download, to make sure we get the right bits.
- AgentME 9y agoBut it's used a lot and makes network connections. If it had a remote-code-execution vulnerability in how it handled connections, then it could provide an easy path for man-in-the-middle attackers to get into systems.
- wahB4vai 9y agoCurl is the back door. A modern idiom is "curl https://$THING/ https://$THING/ | sudo /bin/bash " And the arguments around it being secure because it's https...
- ageisp0lis 9y ago"If one of the curl project members with git push rights would get her account hacked and her SSH key password brute-forced, a very skilled hacker could possibly sneak in something, short-term. Although my hopes are that as we review and comment each others’ code to a very high degree, that would be really hard." Nip this entire discussion in the bud; just use a deterministic build process for any binaries you release. Like Gitian: https://gitian.org https://gitian.org I implemented this for Zcash (see https://z.cash/blog/deterministic-builds.html https://z.cash/blog/deterministic-builds.html), more software projects should be doing this in general.
- jzzskijj 9y agoFrom the article: "Additionally, I’m a Swede living in Sweden. The American organizations cannot legally force me to backdoor anything, and the Swedish versions of those secret organizations don’t have the legal rights to do so either (caveat: I’m not a lawyer). So, the real threat is not by legal means." Considering how well Assange's things turned out with Sweden, that makes me wonder. Of course he is Australian, so there is a big difference.