News for hackers. Stuff that matters.
Re:Create a web app from scratch in under 5 minutes with Met... by kisielk on Thursday February 07, 2013 @01:49PM (#5183815)
$ curl https://install.meteor.com | sh

I really wish people would stop giving instructions like this. Despite all the focus on web security and sandboxing, we continue to instruct people to run arbitrary code on their user account.

People should at least give any shell script they download from the internet a cursory look to see if it's doing what it should be doing instead of blindly executing the response from an HTTP request.

Re:Create a web app from scratch in under 5 minutes with Met... by geoffschmidt on Thursday February 07, 2013 @03:46PM (#5184396)
Meteor dev here.. We actually think this is more secure, or at least does more to raise awareness about security! We want people to BE AWARE that they're running arbitrary code, secured only by the certificate authorities in their local curl install.

Just about every other way of installing software ends up letting the remote run arbitrary code on your machine. The disadvantage of the other approaches is that you don't think about it, so you feel safer than you are, and you are more likely to make security-compromising mistakes.

- When you download an OS X installer package and run it, it can run arbitrary code during the install. Is that how you installed Postgres or Rails? Hope you downloaded that disk image over http. (The last time you downloaded a disk image, did you check the link to make sure it was https? ... Are you sure you never forget to do that?)

- OK, so let's say you download a tarball instead, and untar it into /usr/local, and put meteor in your path. Then the next thing you do is.. you type 'meteor', letting the tarball run arbitrary code. There's not much security difference between letting the remote code run at install time, and letting it run two seconds later when you actually start the program fo the first time.

- OK, let's say you downloaded a Meteor tarball, checked its SHA1-- wait, how did you get the correct SHA1? Did you get it off our website? (Best case, over https, bringing us back where we started?) Or did you call me on the phone.. using the phone number you got off of Facebook.. secured by https? (Best case, and only if you manually added https to your Facebook URL. Did you remember to do that?)

- No problem, I'll get it out of macports, fink, or homebrew, and hopefully they'll have the correct authoritative hash and validate the download. Well, how do you know you have the real macports? The chain of trust still goes through https and the CA. Arguably this is a little better because presumably many people will notice if the macports download site is hacked, but just as arguably, it's less secure because there's one more potential compromise point (volunteer macport maintainers -- how are they vetted? do they use two factor auth? what if their email account is compromised?)

There's really two separate issues here:

- Do you trust Meteor enough to run our code? If so, you shouldn't care whether you run curl | sh or whether you download a tarball and unpack it, and then run the program in it. If not, you shouldn't do either. They're equally bad.

- Do you trust https and the certificate authorities to protect you from MITM attacks, so that you get the authentic bits from meteor.com and not an imitation? If so, then curl https://foo solves your problem. If not, you are going to have to find something better than the CA's to serve as your root of trust.

Maybe there is an argument for "defense in depth" -- maybe you should fetch the tarball from one server with one CA, and the SHA1 from a second server with a different CA -- sure, in practice that could make a compromise less likely. But that's a bit much to ask of the random OS X user that just wants to come to meteor.com and install the tools.

Your best option is clearly to come to the monthly DevShop events at Meteor HQ in SF. If you come to DevShop to install Meteor, I will personally confirm the SHA1 for you :)

Re:Create a web app from scratch in under 5 minutes with Met... by kisielk on Thursday February 07, 2013 @11:09PM (#5186241)
All good points, but there's a big difference in trusting my distro's package manager to install packages from their secure repos, verified by certificates I installed with their OS in the first place, and running a shell script from a blog post linked from a news site.

I've never heard of meteor before, and it's likely that many of the people who are reading the article haven't either.

Yes the site is HTTPS, but anyone can buy an SSL certificate for any purpose. It's not even a case of being MITM'd.

Basically we're telling people "read this blog post, run this curl command that runs some random shell script from this server you've never heard of before".

That's a very different from installing packages from your development community's package server, your OS's package repository, or an app store.

I know it's not possible to fully inspect all the code we run, but I'd rather we didn't encourage the habit of entirely disregarding it.

Re:Create a web app from scratch in under 5 minutes with Met... by grinich on Thursday February 07, 2013 @06:42PM (#5185271)
But then how will he really know it's you, Geoff? ;)

In all seriousness, you should consider posting a response like this in your FAQ/Help and linking at the install tutorial. I'm really sick of this knee-jerk security reaction happening every time someone builds an installer like this.

Re:Create a web app from scratch in under 5 minutes with Met... by shredfvz on Friday February 08, 2013 @12:28PM (#5188962)
While it's ok for Meteor to keep doing what they're doing, it's hardly a "knee jerk security reaction" to criticize their installation instructions.

Story time. I'm at a hotel, connecting to the Web over Tor and using my distro's package manager (Pacman) to install software. I'm also routing Pacman over Tor because I trusted the hotel wifi even less than I trusted Tor. Anyway, Pacman has this wonderful feature of verifying md5sums - fingerprints of the original source code, as posted by the source code author - from source packages before installing any of the code onto your system. If the md5sums on the software you download don't match the author's posted true md5sums, something is probably wrong. You can tell where this story is going. As I'm installing a few packages, which I've done numerous times in the past, Pacman throws a warning: the md5sums don't match. Slightly annoyed, I then download the software directly from PyPi over the hotel's wifi connection, md5sum it and lo and behold, it's the correct md5. It's the exact same software version and everything.

Importantly, the source code must've somehow been modified between the time it was sent from the AUR/PyPi and when it ended up on my machine. Luckily, the md5sum check failed and the software didn't install, but it did scare me quite a bit.

If I had instead been installing Meteor, as per Meteor's current insecure directions, without checking md5sums or signatures, who knows what could've happened. The Meteor team should really consider releasing an md5sum, sha256sum, or better yet sign their packages, because otherwise there's no way to verify the contents of a download.

The Meteor team clearly has the resources to provide this to the inquisitive. It is SOP for all major FOSS. I get that there's something to be said about the ease of releasing packages from GitHub, but imagine if the Linux kernel did this? What Meteor has right now is ok for alpha software. They certainly have room to grow.

Re:Create a web app from scratch in under 5 minutes with Met... by _pius on Thursday February 07, 2013 @07:22PM (#5185437)
Best response I've seen yet to this particular brand of concern trolling.
Re:Create a web app from scratch in under 5 minutes with Met... by javajosh on Thursday February 07, 2013 @05:08PM (#5184839)
Good response. This is not directly related, but wouldn't it be nice to have some sort of convention where install scripts declare the access that they need and people could allow it (or not)? Something like the Unix permissions systems, but more fine-grained. E.g. perhaps a chroot jail with symlinks to the places that you want to give the script access. Indeed, the first run of the script could be to generate the symlink commands you'd need to execute before it really executes. If you don't like the permissions it wants, you just exit the jail, kill the parent process, and move on with your life.
Re:Create a web app from scratch in under 5 minutes with Met... by julian37 on Thursday February 07, 2013 @06:05PM (#5185119)
The UNIX permission system is ludicrously primitive for this day and age. Check out OLPC's Bitfrost for a more fresh take on the matter:

http://wiki.laptop.org/go/OLPC_Bitfrost#Foreword

Unfortunately, it doesn't look like it went anywhere even in the OLPC world... I'm not very familiar with OLPC, but the fact it carries a 2007 timestamp isn't very encouraging. I wonder if it fell victim to the "sugar" watering down of the project :-(

Re:Create a web app from scratch in under 5 minutes with Met... by vidarh on Friday February 08, 2013 @05:51AM (#5187210)
Which is why Linux, BSD's and most Unix versions have a wide range of more restrictive access control methods,such as various forms of containers, jails and VM's...

Personally I run pretty much everything in containers. Not always segregated from each others, but certainly segregated from most of the data I care about. All larger projects get their own containers or VMs, and I have several "scratch" VM's and containers of various types that I don't care if I lose.

Spawning a Virtualbox VM or LXC container (or equivalent) is so quick and painless today that there are few excuses to running all kinds of stuff unrestricted.

Re:Create a web app from scratch in under 5 minutes with Met... by javajosh on Friday February 08, 2013 @05:30PM (#5190509)
I don't really understand how that could possibly work. If you install tools on private machines then they never talk to each other.
Re:Create a web app from scratch in under 5 minutes with Met... by vidarh on Sunday February 10, 2013 @06:05AM (#5196080)
Of course they can: Via network interfaces (which can be firewalled). Via shared directories on shared filesystems. Etc. With e.g. LXC the extent of isolation is can be controlled at a very detailed level. In practice, though, very little stuff needs more than a network connection to interact with each others, and very few applications actually have any business interacting with the other applications I run other than in very specific circumstances.

This is not to say that I run everything isolated from everything else. I have a "unsafe" VM for example where I compile and mess around with a lot of public code I don't want to evaluate the security of. To get further into my network from that one still takes a little bit of work. I also group together various things based on tasks.

But random code I don't have a reason to trust won't go straight into my normal user account on my laptop.

Note that a "reason to trust" can be as simple as "has been signed by the Debian packagers" for some systems. It's a trade off.

Re:Create a web app from scratch in under 5 minutes with Met... by bphogan on Thursday February 07, 2013 @07:38PM (#5185516)
This. If you give me a shell script, I can curl it without piping it to a shell first so I can see what it's going to do. Unlike an installer on Windows where I have no clue what's going on.
Re:Create a web app from scratch in under 5 minutes with Met... by programminggeek on Thursday February 07, 2013 @09:57PM (#5186041)
I think the safest way would be for you to buy a new 13" Macbook Air, install Meteor, and deliver it to me in person. That way I know its legit.
Re:Create a web app from scratch in under 5 minutes with Met... by geoffschmidt on Thursday February 07, 2013 @10:49PM (#5186189)
If you send me enough good pull requests then I might do that!
Re:Create a web app from scratch in under 5 minutes with Met... by qiqing on Thursday February 07, 2013 @05:51PM (#5185059)
Re:Create a web app from scratch in under 5 minutes with Met... by shubber on Friday February 08, 2013 @01:37PM (#5189377)
Which is all interesting, except the shell script is a wrapper on "download this tarball and unpack it" or "download this rpm/deb and install it." So whatever security concerns existed on those approaches, you only concealed them. Why exactly?
Re:Create a web app from scratch in under 5 minutes with Met... by gcr on Friday February 08, 2013 @11:04PM (#5191602)
I wish we had shell script installers that are 1. easily proofreadable, and 2. served over SSL, like this:

    #!/bin/bash
    #
    # Installs a product from the Internet.
    # PLEASE READ CAREFULLY!
    #
    mkdir /tmp/foo-installer
    cd /tmp/foo-installer
    
    cat > file_2.sh <<________EOF_file2.sh________________________________________
    A very long script here....
    
    A very long script here....
    
    A very long script here....
    ________EOF_file2.sh________________________________________
    
    base64 -d > file2.png <<________EOF_file2.png_______________________________________
    iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz
    AAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAATdEVY
    dFRpdGxlAE9wdGljYWwgRHJpdmU+Z7oMAAABkUlEQVQ4jaWSvy9DURTHv6d9ty0tSgivkdBUkGgR
    GotNxGoXjY21SJp0ag2CR8SE2oQ0Qiw2RPwDSASLkDL5EbwOlDZpj6mJ5z2/4puc5eZ7P/ec7z3E
    zPiPJKPDjsF4q7u2cvj2XvVbhUjuTPd2HhIlAKCd2f0lwD+0KsuVZTGrTTTcPyRfhZBSP3VAzAz/
    0KrsLHZsZbNZ8fzyFiemoxzlzg5i/Te/GsFTI08mru7CRpeUmckIwEEQkqHRsPszgIxCVJSJAaZc
    H0BtPm9zmc/bnI2vrewTm+KhUHhZY2ZmTU0p4wu7e9tspN29bZ5Sxhc++k2fX2cg0N3VA1V91FV3
    Vw8YCOgy0BxIkv3k9Bg+b4tutKvrBCRJsn8LAICK8gpcXJ4jlUpBTT5BCAEAcJaU6ryGALPZjAKb
    DSYTwWIRyGTSSGfSsDscOq8uAwAoLMx3SWAA+X8ig63XAYgQXVyaR1FRMaqqXPC469BY3wSXXI2N
    zXUQIarxG+3B7JwSYdYa8/CRYGjsR8BfZJjBX/QObiW573fRhdIAAAAASUVORK5CYII=
    ________EOF_file2.png_______________________________________
Re:Create a web app from scratch in under 5 minutes with Met... by bpatrianakos on Thursday February 07, 2013 @02:21PM (#5183978)
You're right but this is just kind of a nit-pick. It should be up to the user to decide if they trust the source. The way I see it, it all comes down to the question of do you trust the source. If the source is trustworthy from there you've got to worry about an attacker compromising your trusted source. That happens and it sucks but its life and I for one am not going to stop `gem install`ing and `curl`ing because Rubygems.org was compromised once or some other source was tampered with.

I know my sources, I trust them. If they're compromised and they take me down with them, I'm going to cry a little but it's not like I'm working on a nuclear reactor - I'm making some shit CRUD app. Now as the importance of a codebase increases the kind of attitude like I have should decrease of course.

Re:Create a web app from scratch in under 5 minutes with Met... by JPKab on Thursday February 07, 2013 @02:35PM (#5184054)
"it's not like I'm working on a nuclear reactor - I'm making some shit CRUD app."

Finally, some much needed humility on HN. Refreshing. And true.

Re:Create a web app from scratch in under 5 minutes with Met... by alinajaf on Thursday February 07, 2013 @03:51PM (#5184425)
> "I'm going to cry a little but it's not like I'm working on a nuclear reactor"

Great for you, but you're a developer who presumably works on 'shit CRUD apps' for other people who pay you for the effort.

What happens when a script from a compromised source that you run on your devbox grabs the entire contents of ~/.ssh/ and sends it to the bad guys inbox? Congratulations, all your clients have been thoroughly owned.

Re:Create a web app from scratch in under 5 minutes with Met... by hoverkraft on Thursday February 07, 2013 @05:22PM (#5184917)
That being said, you'd be amazed at how many ruby gems are required to run the average nuclear reactor.
Re:Create a web app from scratch in under 5 minutes with Met... by bretthoerner on Thursday February 07, 2013 @02:02PM (#5183882)
I don't understand this argument, unless you include things like gem, pip, npm, etc.

`pip install foobar-py` runs a Python setup script, which can do anything bash can. Do you inspect all of those, and comment about their insecurities on HN?

Re:Create a web app from scratch in under 5 minutes with Met... by sergiosgc on Thursday February 07, 2013 @02:08PM (#5183917)
This method makes you vulnerable to attacks that change the script being run. DNS spoofing, HTTP proxy hacking or hacking of the source server itself.

Good package management systems use digital signatures to ensure that the original package wasn't tampered with. Not that hacking of the central repositories never happened, but it's a major (and thus infrequent) event.

Re:Create a web app from scratch in under 5 minutes with Met... by timdorr on Friday February 08, 2013 @12:32AM (#5186469)
But I know for at least gem and npm, while they support signing, they are not used in practice. And those two repositories are used by a large number of people browsing this site.
Re:Create a web app from scratch in under 5 minutes with Met... by ohazi on Thursday February 07, 2013 @02:08PM (#5183916)
Don't these generally do some sort of cursory signature check?
Re:Create a web app from scratch in under 5 minutes with Met... by lotyrin on Thursday February 07, 2013 @04:31PM (#5184616)
Against a signature they fetched how? Over HTTPS?

Just because this style makes you think about it harder, doesn't mean it's less secure. It's the simplest and best case.

Re:Create a web app from scratch in under 5 minutes with Met... by patio11 on Friday February 08, 2013 @02:20AM (#5186706)
This is a security red herring that as far as I can see is justified entirely by an aesthetic preference to think of oneself as "able to quickly audit code just by skimming it."

Compare it to alternatives like "gem install NAME_ANY_GEM_HERE", which also executes arbitrary code and which, for the typical Ruby/Rails developer, is totally impenetrable. (If you think otherwise, tell me, when's the last time you did a line-by-line audit of every single dependency prior to installing a gem?)

Even the embedded assumptions like e.g. the Rubygems server is, as of this instance, being operated by Rubygems and not being operated by The Adversary are really, really tenuous.

Re:Create a web app from scratch in under 5 minutes with Met... by timdorr on Friday February 08, 2013 @12:40AM (#5186492)
While I agree that there should be some more transparency with the install process, my problem with this is more practical: because I've installed via a non-standard means, how do I uninstall? How do other packages of software know I have meteor installed as a prerequisite? How do I easily ensure I have the latest version? How do I lock my install to a particular version to avoid breaking changes in new versions?

Whilst the security aspect is a background concern, these functional concerns are far more important to me. Because npm or some other system wasn't used, meteor is now an outlier and doesn't easily fit into most of my development flow. I've now been burdened with an external maintenance process that requires separate tools and workflow to accommodate.

Honestly, that's the biggest turn-off I have about meteor right now. Hopefully that will change before the big 1.0.

Re:Create a web app from scratch in under 5 minutes with Met... by thisishugo on Thursday February 07, 2013 @01:57PM (#5183853)
At least it's https; I've seen sites on HN recently[1] that suggest you run code pulled over plain http, as if that wasn't an even more horrible security risk than just blindly running a script from the Internet.

[1] http://chocolatey.org/

Re:Create a web app from scratch in under 5 minutes with Met... by TazeTSchnitzel on Thursday February 07, 2013 @02:37PM (#5184063)

  @powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('http://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin
Goodness, that looks awful.
Re:Create a web app from scratch in under 5 minutes with Met... by orionblastar on Thursday February 07, 2013 @04:49PM (#5184733)
Heh the least they could do is put that into a batch file to be downloaded and clicked on to run.

Chocolatey is sort of like an alternative apt-get for Windows, except that it doesn't need s sudo command and your password to install software. It uses cinst to install stuff:

cinst firefox

Installs Firefox.

The UAC asks the current user to allow the setup program to run and that is about it. No password needed to install like apt-get has.

Oh yeah if your PC doesn't have Powershell installed you are SOL if you try to use that command to install Chocolatey. Some administrators remove it because it can be used to install software without being known to the user.

Re:Create a web app from scratch in under 5 minutes with Met... by serge2k on Thursday February 07, 2013 @10:32PM (#5186147)
Right, because UAC assumes someone who is logged in as an admin is supposed to be. I configure sudo like this on some of my dev machines, easier and I don't care about them (usually just VMs).

Why not just restrict the execution policy? I don't really know PS thta well, but doesn't that stop arbitrary (or any) scripts?

Re:Create a web app from scratch in under 5 minutes with Met... by orionblastar on Sunday February 10, 2013 @11:23PM (#5199370)
You are revealing the security flaws of Windows. Cancel or Allow?
Re:Create a web app from scratch in under 5 minutes with Met... by webreac on Friday February 08, 2013 @04:01AM (#5186972)
I really like instructions like this because I understand easily what needs to be done. Probably the content of the script will also be easy to read. Of course, I will never do a copy paste of these instructions. I will redirect to a file and read it before executing. And if I have doubts, I launch a VM.
Re:Create a web app from scratch in under 5 minutes with Met... by spullara on Thursday February 07, 2013 @03:42PM (#5184377)
It would be great if shasum would let you check against a sha on the command line so you could do something like:

curl https://install.meteor.com | shasum -c 6fa3128600e9bd73a161a625f8503e6614b44b2b | sh

Could be built into curl possibly.

Re:Create a web app from scratch in under 5 minutes with Met... by mayanksinghal on Thursday February 07, 2013 @07:45PM (#5185560)
But if the DNS is compromised or if this a MITM attack (in spite of being https) there is no guarantee that the checksum is any more trustworthy.
Re:Create a web app from scratch in under 5 minutes with Met... by spullara on Friday February 08, 2013 @02:45PM (#5189719)
How is this any less safe than any other checksum scheme that people typically use when delivering software over the internet?