Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

Just a note: @homakov is no longer suspended, as of about 25 minutes ago: https://github.com/rails/rails/commit/b83965785db1eec019edf1...


sort by: page size:

I lost a tremendous amount of respect for Github when I heard they'd suspended his account.

I have more of an issue with the Rails team for not accepting that this "feature" is a massive bug that they should've changed ages ago, though.


That almost happen couple of years ago with that nasty default rails behaviour that /u/homakov alerted them about.

Homakov kind of gave the impression he had discovered a previously unknown vulnerability in Rails. This is not the case. Rather, he discovered an instance in which one very prominent Rails app (Github) failed to implement a standard Rails security practice.

For those not familiar with Rails, it boils down to this: You as the programmer need to use a security feature built into Rails called mass assignment security. If you fail to use this feature, you have a vulnerability. In other words, the default is insecure by design. The alternative would be to make Rails secure by default, but that would mean pretty much nothing would work until you explicitly granted access where necessary. I guess the core team figured "not working by default" was worse than "insecure by default."

Homakov obviously disagreed with this design decision. I can understand why, and I mostly feel the same way.

So Homakov posted an issue to the Rails repo Github (https://github.com/rails/rails/issues/5228) suggesting the default be changed. He made a good case and was initially polite. A few days passed, and nobody else had posted to his thread.

So, presumably to draw attention to this issue, he exploited the fact that Github had failed to use mass assignment protection. Specifically, he posted a comment with a far-future timestamp, which obviously should be impossible. (I think that's what he did, although Github seems to to have fixed the timestamp now.) He then said this should be proof enough that the Rails defaults need to be changed.

The problem with Homakov's argument, as pointed out in subsequent comments in the thread, is that Homakov's hack only demonstrated a mistake on Github's part, not a bug in Rails. It didn't prove anything about Rails that we didn't already know. The only thing surprising he demonstrated was that Github had left open a rather serious vulnerability.

TL;DR: Rails has some less-than-secure defaults which all Rails developers are expected to understand and deal with. Homakov found out that Github failed to do so in at least one instance, and he wanted to use that as proof the Rails defaults should be changed.


Probably the drama surrounding a recent Rails commit [0] and DHHs follow-up blog post. [1]

[0] https://github.com/rails/rails/commit/61b91c4c55bcbd5a2ec85d...

[1] http://david.heinemeierhansson.com/2012/rails-is-omakase.htm...


I hope those who ripped into Homakov initially are feeling more mellow towards him. They certainly were justified in thinking him being rash, but his action raised far more awareness about this issue than the typical proper channel.

Rails devs (some, not all of them) had dismissed his complaint because "Every Rails developer hears about attr_accessible." Well, I'll be the first to say that I can't remember the last time that this update_attributes vulnerability had been pointed out to me. I certainly can remember all the times that Rails docs reminds me to use their sanitizing helpers when making ActiveRecord queries.

To be fair, I haven't developed apps that required the use of user-facing access to update_attributes, and maybe when I got around to using that, I would've wisely consulted the dev guides to make sure I was following best practice. But knowing me, I probably would've likely thought, "Well, that seems simple enough, here goes."

It's not that the logic behind this vulnerability is hard to understand...in retrospect, it's as clear and blatant as the processes that lead to SQL injection.

But surgical patients die because elite surgeons sometimes forget to wash their hands (Google "Atul Gawande checklist"). It's not an impossibility that a skilled dev team would overlook the update_attributes issue.

The Rails team was right in arguing that this wasn't a security risk given a half-competent dev. But they were looking at the problem from the wrong perspective and assumed that everyone is as familiar with Rails best practices as they were. So how else could Homakov convince them otherwise other than pricking a high-profile dev group?

What if Homakov managed to alert the Github team, and they managed to fix it quietly? Github would be safe but thousands of Rails sites would still be operating in ignorance. It truly stinks for the Github group that they had to respond to a five-alarm emergency on a Sunday...on the other hand, I think there are going to be a lot of Rails devs who are thankful that they (involuntarily) took one for the team. Thanks to Homakov, it was a small hit.


I don't think he can be blamed too much though. As per the bug filed here - https://github.com/rails/rails/issues/5228, the bug was being closed by others after being given a cursory look, and was being reopened again for consideration. Maybe a little immature, but there was a mild provocation.

I have to agree that suspending the account was dumb as if he wanted to be malicious, he'd have created dummy accounts and would have committed malicious code to popular projects.

But then, going so far to say losing all trust in github.. there was a bug, it's fixed and they suspended the "attacker". I wonder what will happen in the following days with script kiddies trying to "hack" all rails website. In fact, isn't the overloading of parameters something as old as the earth that security experts would check first as a vulnerability?



I'm impressed they kept up in Rails versions, starting apparently with 3.0 beta

https://github.com/diaspora/diaspora/commit/0390bbde8a74ec30...


At the end of the post, the author says: "this issue wont be fixed for now." I asked on Twitter for more details, and this was his reply:

> response was roughly like "We might change this in Rails 4" and "$affected_lib should fix it on its side"[1]

[1] https://twitter.com/joernchen/status/298836052410519552


Just to clarify, in case this is needed: I totally agree. Just posted that to bring fuel to the discussion.

My hope is that expiration will be soon baked-in (or easier to bake in), after reading https://github.com/rails/rails/pull/11168


Good for Egor Homakov. I don't necessarily agree with his methods in this case, but in the end, the net result of his actions was positive for web security. And as so many others have pointed out, when the proper channels aren't working, sometimes a little spectacle is just what you need to instigate change.

In other news, I'm not sure why the rails core team was so against this in the first place. Making things safe by default is usually a good idea. This change doesn't seem to add too much additional ceremony, and people had been asking for this for some time.


the only thing google turned up is AC's allow_concurrency switch has been removed (in June)

http://github.com/scottburton11/rails/commit/0c9281e82140f3a...


There are a bit more vulns hanging around 'params' http://homakov.blogspot.com/2013/01/rails-security-digest-el...

So if I got this right, this is the order of how things happened.

1. Egor finds a vulnerability and reports it. https://github.com/rails/rails/issues/5228

2. It gets ignored and he is being called a troll.

3. He proves that he was right by doing a harmless commit to to the rails master repo.

4. The vulnerability gets fixed quickly as it got the focus of the community.

5. His account gets suspended

Not sure I agree with the suspension.


This is not a "rails community" issue. These are individual members. Rails is software that works for a lot of people. The "community" doesn't tweet.

Most of us just want to write code.


It's worth mentioning that Github has forked Rails and is working off their own private branch of Rails 2.3. Not saying that was relevant to this exploit, mind you.

https://github.com/github/rails

http://www.kalzumeus.com/2013/06/17/if-your-business-uses-ra...


From 3 days ago:

"What I want you to see in that thread I mentioned is the way the core team perceives this. You are not discovering anything unknown, we already know this stuff and we like attr protection to work the way it is."

(https://github.com/rails/rails/issues/5228#issuecomment-4292...)

After reading for how long he tried to bring attention to this and only got a top guy to say that kind of stuff. The guy who hacked is not right in any way but I don't even have words to describe the person who wrote the above line.


It was an unintended consequence of Github's use of rails. So I think my characterization (Github's rails bug) is fair.
next

Legal | privacy