News for hackers. Stuff that matters.
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_______________________________________