Live data from Hacker News

What The Rails Security Issue Means For Your Startup

kalzumeus.com

81–90 of 183 posts

Re: What The Rails Security Issue Means For Your Startup

#81

This quote caught my attention: There are many developers who are not presently active on a Ruby on Rails project who nonetheless have a vulnerable Rails application running on localhost:3000. If they do, eventually, their local machine will be compromised. (Any page on the Internet which serves Javascript can, currently, root your Macbook if it is running an out-of-date Rails on it. No, it does not matter that the I…

Wouldn't the same origin policy prevent requests to localhost?

Re: What The Rails Security Issue Means For Your Startup

#82
"Any page on the Internet which serves Javascript can, currently, root your Macbook if it is running an out-of-date Rails on it."

Why are you running Rails as the root user? This is a bad idea.

EDIT: I'm not really into client-side JavaScript these days, but when did browsers start allowing JavaScript to connect to anything except the server from which it came? That would be yet another Bad Idea.

Re: What The Rails Security Issue Means For Your Startup

#83
post #19

You do all deploy from your own cache of all the gems you depend on, right? No? Why not?

I'd love to. Any helpful guides on how to proceed?

  bundle package
will cache all of your deps in vendor/cache. You can install from this cache using:

  bundle install --local

Re: What The Rails Security Issue Means For Your Startup

#84
post #34

Earlier quoted context omitted.

So if I had told you at Christmas three salient facts: + Some objects are unsafe to instantiate if you don't pick all values you initialize them with very carefully. + YAML can instantiate objects from any class. + Rails uses YAML, in a lot of ways. You might have said "Yes, I am aware of all these three things. Do you have anything important to tell me?" Now, if I demonstrate to you working PoC code which combines t…

Anyone competent would, when knowing those three things, immediately think of the possible exploits.

And yet they didn't, and here we are.

Yes, it's super easy to call everyone involved with the YAML library incompetent, but let's be honest - they're not, in general. They fucked up here, and hindsight is 20/20, but I think it's only face-stabbingly obvious now because of what's actually happened.

Re: What The Rails Security Issue Means For Your Startup

#86

This quote caught my attention: There are many developers who are not presently active on a Ruby on Rails project who nonetheless have a vulnerable Rails application running on localhost:3000. If they do, eventually, their local machine will be compromised. (Any page on the Internet which serves Javascript can, currently, root your Macbook if it is running an out-of-date Rails on it. No, it does not matter that the I…

Note: From a sysadmin standpoint http://localhost:3000 commonly refers to http://127.0.0.1:3000 . When running "rails server" locally in development mode, you actually get http://0.0.0.0:3000 . These are not the same! 127.0.0.1 means that "rails server" can only be accessed from your local machine, where 0.0.0.0 means, it can be accessed on any address your computer is listening on. If you are on a local intranet, sa…

Again, even if your development box is being physically protected by the Swiss guard with a firewall that sprung from Donald Knuths' forehead with the River Styx separating it from all inbound connection attempts, it won't even matter, because you run a browser on your development box, that browser can always connect to your development box, and that browser can be instructed to pass malicious input to your development box if you do innocuous things with it like e.g. viewing web pages on the public Internet.

Re: What The Rails Security Issue Means For Your Startup

#87
post #81

This quote caught my attention: There are many developers who are not presently active on a Ruby on Rails project who nonetheless have a vulnerable Rails application running on localhost:3000. If they do, eventually, their local machine will be compromised. (Any page on the Internet which serves Javascript can, currently, root your Macbook if it is running an out-of-date Rails on it. No, it does not matter that the I…

Wouldn't the same origin policy prevent requests to localhost?

You can dynamically create an iframe in JavaScript and do a regular form post to localhost:3000 thorough it.

Re: What The Rails Security Issue Means For Your Startup

#88
post #81

This quote caught my attention: There are many developers who are not presently active on a Ruby on Rails project who nonetheless have a vulnerable Rails application running on localhost:3000. If they do, eventually, their local machine will be compromised. (Any page on the Internet which serves Javascript can, currently, root your Macbook if it is running an out-of-date Rails on it. No, it does not matter that the I…

Wouldn't the same origin policy prevent requests to localhost?

You might be thinking of preventing Javascript on host X from sending XMLHttpRequests to host Y. That will not prevent Javascript on host X from adding a form to the web page and having it post to host Y with arbitrary content, or from having an IMG tag on host X attempt to load (via a GET) a URL on host Y (assuming someone finds a pathway that works via GET requests for these or related vulnerabilities).

Re: What The Rails Security Issue Means For Your Startup

#89
post #86

Earlier quoted context omitted.

Note: From a sysadmin standpoint http://localhost:3000 commonly refers to http://127.0.0.1:3000 . When running "rails server" locally in development mode, you actually get http://0.0.0.0:3000 . These are not the same! 127.0.0.1 means that "rails server" can only be accessed from your local machine, where 0.0.0.0 means, it can be accessed on any address your computer is listening on. If you are on a local intranet, sa…

Again, even if your development box is being physically protected by the Swiss guard with a firewall that sprung from Donald Knuths' forehead with the River Styx separating it from all inbound connection attempts, it won't even matter , because you run a browser on your development box, that browser can always connect to your development box, and that browser can be instructed to pass malicious input to your developm…

Yeah, I get it. I guess I'm making an additional point, that anyone can have direct access to the development environment via any address your machine is listing on -- not just localhost.

Re: What The Rails Security Issue Means For Your Startup

#90
post #82

"Any page on the Internet which serves Javascript can, currently, root your Macbook if it is running an out-of-date Rails on it." Why are you running Rails as the root user? This is a bad idea. EDIT: I'm not really into client-side JavaScript these days, but when did browsers start allowing JavaScript to connect to anything except the server from which it came? That would be yet another Bad Idea.

Local privilege escalation is much easier than remote code execution. Once someone has the ability to execute code as a restricted user, there is generally at least one easily exploitable bug to get root. This is because people don't take local privilege escalation as seriously as remote code execution, and tend not to fix or patch them as quickly.
Post reply on HN